Tracking Issue for WebAssembly exception handling #118168
Open
Description
opened on Nov 22, 2023
This is a tracking issue for wasm native exception handling, which would allow panic=unwind
to function properly for code targeting wasm.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Initial compiler support (Support for native WASM exceptions #111322)
- Standard library support (std support for wasm32 panic=unwind #121438)
- LLVM support for newest iteration of try/catch instructions (see Reintroducing exnref WebAssembly/exception-handling#280, LLVM support of the latest proposal WebAssembly/exception-handling#296)
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
-
-C target-feature=+exception-handling
vs-C panic=unwind
-- does one imply the other, or is one of them redundant?- panic=unwind should enable exception-handling
- Should
-C llvm-args=-wasm-enable-eh
be passed by default on all wasm targets, to be stripped out if theexception-handling
target feature is disabled?- yes: afaict
-wasm-enable-eh
does not affect codegen in general, only isel for the wasm.throw instruction.
- yes: afaict
- Should exception-handling instructions (e.g. from prebuilt libstd) be stripped out if
panic=abort
? If so, by whom?wasm-ld
?wasm-opt
does currently implement a--strip-eh
pass; maybe that's good enough if users want to target wasm MVP?- this problem is similar to the one that
atomics
(Tracking issue for WebAssembly atomics #77839) faces, of a single prebuilt libstd coming into conflict with some users needing backwards compatibility with wasm-MVP and others wanting to use more recently stabilized features
- this problem is similar to the one that
Activity