-
Notifications
You must be signed in to change notification settings - Fork 40
Make exception handling models better configurable for the wasm kernel #440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -83,6 +83,8 @@ if(EMSCRIPTEN) | |||||
| set(XEUS_CPP_USE_SHARED_XEUS_CPP OFF) | ||||||
| # ENV (https://github.com/emscripten-core/emscripten/commit/6d9681ad04f60b41ef6345ab06c29bbc9eeb84e0) | ||||||
| set(EMSCRIPTEN_FEATURES "${EMSCRIPTEN_FEATURES} -s \"EXPORTED_RUNTIME_METHODS=[ENV']\"") | ||||||
| set(XEUS_CPP_WASM_KERNEL_EXTRA_FLAGS "-fwasm-exceptions" CACHE STRING "Extra compiler/linker flags for wasm builds") | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
If you look at the Windows Emscripten jobs in this CppInterOp PR https://github.com/compiler-research/CppInterOp/pull/803/checks which tests this xeus-cpp PR, you'll see that it has undefined errors for symbols such as
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does that make any sense ? Aren't we cross compiling here for the emscripten-wasm32 target ? If it works of any platform X, it should work on platform Y.
Also I remember going through the source code for this upstream. Its a simple check, nothing to do with any platform is what I remember. Check the windows CI for cppinterop if that's concerning. If you can't figure it out, I'll add this !
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has been set to resolved, without actually resolving. Please apply this change if you would like to resolve this comment. Without this change CppInterOp cannot drop the need for EMCC_CFLAGS when building xeus-cpp, since |
||||||
| set(XEUS_CPP_WASM_KERNEL_EXTRA_ARGS "-fwasm-exceptions;-mllvm;-wasm-enable-sjlj" CACHE STRING "Extra argv entries for wasm kernel.json") | ||||||
| endif() | ||||||
|
|
||||||
| # Dependencies | ||||||
|
|
@@ -123,6 +125,10 @@ endif () | |||||
| function(configure_kernel kernel) | ||||||
| if(EMSCRIPTEN) | ||||||
| set(prefix "wasm_") | ||||||
| set(XEUS_CPP_WASM_KERNEL_EXTRA_ARGS_JSON "") | ||||||
| foreach(arg IN LISTS XEUS_CPP_WASM_KERNEL_EXTRA_ARGS) | ||||||
| string(APPEND XEUS_CPP_WASM_KERNEL_EXTRA_ARGS_JSON "\"${arg}\", ") | ||||||
| endforeach() | ||||||
| else() | ||||||
| set(XEUS_CPP_PATH "$ENV{PATH}") | ||||||
| set(XEUS_CPP_LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}") | ||||||
|
|
@@ -220,7 +226,7 @@ macro(xeus_cpp_set_common_options target_name) | |||||
| target_compile_options(${target_name} PUBLIC /wd4018 /wd4267 /wd4715 /wd4146 /wd4129) | ||||||
| target_compile_options(${target_name} PUBLIC /EHsc) | ||||||
| elseif (EMSCRIPTEN) | ||||||
| target_compile_options(${target_name} PUBLIC -fwasm-exceptions) | ||||||
| target_compile_options(${target_name} PUBLIC ${XEUS_CPP_WASM_KERNEL_EXTRA_FLAGS}) | ||||||
| else () | ||||||
| target_compile_options(${target_name} PUBLIC -fexceptions) | ||||||
| endif () | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to have
sSUPPORT_LONGJMP=wasmas it is enabled by default based on the EH model (wasm or emscripten)https://emscripten.org/docs/porting/setjmp-longjmp.html#c-setjmp-longjmp-support
Can still mention it, if we want !