How can i get native WASM exception handling to work #17526
-
Hi everybody, For this my CMakeLists.txt that contains all the link and compile options looks like this (reduced of course) target_compile_options(mwNGSPWASM PRIVATE
-g2
-pthread
-fwasm-exceptions
-O0 #reduce code size
)
target_link_options(mwNGSPWASM PUBLIC
-fwasm-exceptions
-sEXPORT_EXCEPTION_HANDLING_HELPERS=1 #https://github.com/emscripten-core/emscripten/blob/f08ae1c1d30954ae77802f8ea92638b22b4ff4ee/src/settings.js#L686
-sDISABLE_EXCEPTION_THROWING=0
-O0 # Hopefully reduces link time
-g2 #don't use -g for now as the DWARF debug infos take to much memory to generate (40gb +)
--profiling-funcs #Preserve function names in profiling, but otherwise minify whitespace and names as we normally do in optimized builds
-gsource-map
# -sABORT_ON_WASM_EXCEPTIONS=1 # maybe this gives us a stack trace, when an exception happens https://github.com/emscripten-core/emscripten/issues/13868
-lembind # Links against embind library
-sLLD_REPORT_UNDEFINED #more detailed diagnostics when symbols are undefined at link time
-sINITIAL_MEMORY=65536000
-sNO_DISABLE_EXCEPTION_CATCHING
-sPTHREAD_POOL_SIZE=8
-sASSERTIONS=1
-sDEMANGLE_SUPPORT=1
-pthread
--no-entry # otherwise wasm-ld complains about a missing entry point, but we call the functions from JS anyway
--preload-file assets
-Wl,-error-limit=0
-sFULL_ES2 # full OpenGL ES 3 support
-sMIN_WEBGL_VERSION=2# only target webgl2
-sMAX_WEBGL_VERSION=2
-sOFFSCREEN_FRAMEBUFFER=1
-sEXPORTED_RUNTIME_METHODS=FS
) However, when i try to build my project using this settings, i always get the following error message:
Any idea what i am doing wrong and get this missing export errors? My version:
BTW: The reason why I want to switch to WASM EH in the first place, is that i hope to see some actual stack traces, when i get a CPP exception. This would make debugging much easier. But this already discussed here: #17437 and here #17466 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 13 replies
-
Can you try removing both |
Beta Was this translation helpful? Give feedback.
Can you try removing both
-sDISABLE_EXCEPTION_THROWING=0
and-sNO_DISABLE_EXCEPTION_CATCHING
.. i believe those options are only relevant when targeting emscripten exceptions.