diff options
author | Aleksey Kliger (λgeek) <alklig@microsoft.com> | 2022-06-14 19:54:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-14 19:54:00 +0300 |
commit | 3428247624deb717d79ceaf348f63dbb530acfd0 (patch) | |
tree | de36dbb3cab7ee5ba39d1683927cfd8d300b0492 /src/mono/wasm | |
parent | 20cb077d22658a1264fd4619ae8f96697a02453e (diff) |
[wasm] Fix Debug configuration builds (#70683)
* Fix cmake error
```
Manually-specified variables were not used by the project:
CONFIGURATION_WASM_OPT_FLAGS
```
* Build the interpreter with -O1 on Wasm in Debug configs
Otherwise `interp_exec_method` and `generate_code` can easily overflow the stack in some browsers with even a few recursive calls (for example during .cctor initializaiton)
Diffstat (limited to 'src/mono/wasm')
-rw-r--r-- | src/mono/wasm/runtime/CMakeLists.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mono/wasm/runtime/CMakeLists.txt b/src/mono/wasm/runtime/CMakeLists.txt index f857028e5ad..f15ed2ec402 100644 --- a/src/mono/wasm/runtime/CMakeLists.txt +++ b/src/mono/wasm/runtime/CMakeLists.txt @@ -34,6 +34,8 @@ set_target_properties(dotnet PROPERTIES LINK_FLAGS "@${NATIVE_BIN_DIR}/src/emcc-default.rsp @${NATIVE_BIN_DIR}/src/emcc-link.rsp ${CONFIGURATION_LINK_FLAGS} --extern-pre-js ${NATIVE_BIN_DIR}/src/cjs/runtime.cjs.iffe.js --pre-js ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.pre.js --js-library ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.lib.js --js-library ${NATIVE_BIN_DIR}/src/pal_random.lib.js --post-js ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.post.js --extern-post-js ${NATIVE_BIN_DIR}/src/cjs/dotnet.cjs.extpost.js " RUNTIME_OUTPUT_DIRECTORY "${NATIVE_BIN_DIR}") +set(ignoreMeWasmOptFlags "${CONFIGURATION_WASM_OPT_FLAGS}") + if(CMAKE_BUILD_TYPE STREQUAL "Release") add_custom_command(TARGET dotnet POST_BUILD COMMAND ${EMSDK_PATH}/upstream/bin/wasm-opt --enable-exception-handling ${CONFIGURATION_WASM_OPT_FLAGS} --strip-dwarf ${NATIVE_BIN_DIR}/dotnet.wasm -o ${NATIVE_BIN_DIR}/dotnet.wasm |