-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 |
Are there any plans on how wasm vs JS exceptions are going to be configured? ( |
Well if you look at the MCP and [the PR] (#131830) you'll see in the discussion that we aren't really thinking about stabilizing it to a There is a cfg flag for it but you have to enable an internal feature to access it. I'm not sure if you can enable internal features outside the standard library though. |
I do not necessarily need legacy exception handling myself, but I'm maintaining a crate that needs to use different code for different EH ABIs, hence I'm interested in knowing what the way forward is going to be so that I can update the code preemptively. I understand this whole crate idea is based on thin ice, so I'll just hardcode |
Cool! I appreciate that you are making the effort to support emscripten. |
@workingjubilee should we close this as resolved via the |
Wasm EH is still utterly broken, see e.g. #135665. Please don't. |
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: