-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Support wasm exception handling for Emscripten target #112195
Comments
If a target has more than one stack unwinding ABI is there some standard way to switch between them? |
Ah it seems that the following may work to disable js exceptions and enable wasm ones: -C link-arg=-fwasm-exceptions \
-C link-arg=-sDISABLE_EXCEPTION_CATCHING=1 \
-C llvm-args=-enable-emscripten-cxx-exceptions=0 \
-C llvm-args=-wasm-enable-sjlj |
@rustbot label O-wasm |
Which tools do you call? |
The issue is that Rust always adds |
I made a bit more progress over here: It seems that we need to adjust the ir generated for the try intrinsic and I have a guess of what the IR should be. But I would probably need help from someone who understands |
Currently the Rust Emscripten target supports js exception handling. I've been trying to get it to support also wasm exception handling. The patch to get it to exclusively use wasm exception handling is quite small. The following suffices:
Patch
I'm not sure what the best way is to add support for a choice between these two options.
@aheejin Is there any way to turn
-enable-emscripten-cxx-exceptions
back off by adding another argument? It would be convenient to be able to inject-mllvm -disable-emscripten-cxx-exceptions -mllvm -wasm-enable-sjlj
and get wasm exceptions to work...The text was updated successfully, but these errors were encountered: