diff --git a/IDE/src/BuildContext.bf b/IDE/src/BuildContext.bf index 6a588245..3a643473 100644 --- a/IDE/src/BuildContext.bf +++ b/IDE/src/BuildContext.bf @@ -630,7 +630,7 @@ namespace IDE compilerExePath.Append(@"/upstream/emscripten/emcc.bat"); //linkLine.Append(" c:\\Beef\\wasm\\BeefRT.a -s STRICT=1 -s USE_PTHREADS=1 -s ALIASING_FUNCTION_POINTERS=1 -s ASSERTIONS=0 -s DISABLE_EXCEPTION_CATCHING=0 -s DEMANGLE_SUPPORT=0 -s EVAL_CTORS=1 -s WASM=1 -s \"EXPORTED_FUNCTIONS=['_BeefMain','_BeefDone','_pthread_mutexattr_init','_pthread_mutex_init','_emscripten_futex_wake','_calloc','_sbrk']\""); linkLine.Append(" ", gApp.mInstallDir); - linkLine.Append("..\\..\\wasm\\BeefRT.a -s STRICT=1 -s USE_PTHREADS=1 -s ALIASING_FUNCTION_POINTERS=1 -s ASSERTIONS=0 -s DISABLE_EXCEPTION_CATCHING=0 -s DEMANGLE_SUPPORT=0 -s EVAL_CTORS=1 -s WASM=1"); + linkLine.Append("..\\..\\wasm\\BeefRT.a -s STRICT=1 -s USE_PTHREADS=1 -s ASSERTIONS=0 -s DISABLE_EXCEPTION_CATCHING=0 -s DEMANGLE_SUPPORT=0 -s EVAL_CTORS=1 -s WASM=1"); String workingDir = scope String(); if (!llvmDir.IsEmpty) @@ -642,6 +642,8 @@ namespace IDE workingDir.Append(gApp.mInstallDir); } + linkLine.Replace('\\', '/'); + //linkLine.Append(" --no-entry --export-all"); var runCmd = gApp.QueueRun(compilerExePath, linkLine, workingDir, .UTF8); diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index 5adb831a..2d4218fd 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -8004,7 +8004,7 @@ namespace IDE } }*/ - const int cArgFileThreshold = 0x7800; + const int cArgFileThreshold = 0x2000 - 1; public ExecutionQueueCmd QueueRun(String fileName, String args, String workingDir, ArgsFileKind argsFileKind = .None) { @@ -8012,7 +8012,7 @@ namespace IDE executionQueueCmd.mFileName = new String(fileName); executionQueueCmd.mArgs = new String(args); executionQueueCmd.mWorkingDir = new String(workingDir); - if (args.Length > cArgFileThreshold) + if (fileName.Length + args.Length + 1 > cArgFileThreshold) { // Only use UTF16 if we absolutely need to if ((argsFileKind == .UTF16WithBom) && (!args.HasMultibyteChars())) diff --git a/bin/build_wasm.bat b/bin/build_wasm.bat index d3ffc43c..c7db0417 100644 --- a/bin/build_wasm.bat +++ b/bin/build_wasm.bat @@ -1,4 +1,4 @@ mkdir ..\wasm cd ..\wasm -call emcc ..\BeefRT\rt\Math.cpp ..\BeefRT\rt\Object.cpp ..\BeefRT\rt\Thread.cpp ..\BeefRT\rt\Internal.cpp ..\BeefySysLib\platform\wasm\WasmCommon.cpp ..\BeefySysLib\Common.cpp ..\BeefySysLib\util\String.cpp ..\BeefySysLib\util\UTF8.cpp ..\BeefySysLib\third_party\utf8proc\utf8proc.c -I..\ -I..\BeefySysLib -I..\BeefySysLib\platform\wasm -g -DBF_DISABLE_FFI -c -DBF_SMALL -s WASM=1 -s USE_PTHREADS=1 +call emcc ..\BeefRT\rt\Math.cpp ..\BeefRT\rt\Object.cpp ..\BeefRT\rt\Thread.cpp ..\BeefRT\rt\Internal.cpp ..\BeefySysLib\platform\wasm\WasmCommon.cpp ..\BeefySysLib\Common.cpp ..\BeefySysLib\util\String.cpp ..\BeefySysLib\util\UTF8.cpp ..\BeefySysLib\third_party\utf8proc\utf8proc.c -I..\ -I..\BeefySysLib -I..\BeefySysLib\platform\wasm -g -DBF_DISABLE_FFI -c -s WASM=1 -s USE_PTHREADS=1 emar r BeefRT.a Common.o Internal.o Math.o Object.o String.o Thread.o UTF8.o utf8proc.o WasmCommon.o \ No newline at end of file