diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-01-06 22:04:13 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-06 22:04:13 -0500 | 
| commit | 4e4a93c2dd4bae8472924d03c37f387fbf3b074c (patch) | |
| tree | c8db61e78f14c45c4121735e00d7d6d7c8e5d35d /compiler/rustc_codegen_llvm | |
| parent | 0f1e965fec3bc2f97b932e9dd8e85fca6d7faadc (diff) | |
| parent | 49c74234a79107afa7f86ca947708c3abef07674 (diff) | |
| download | rust-4e4a93c2dd4bae8472924d03c37f387fbf3b074c.tar.gz rust-4e4a93c2dd4bae8472924d03c37f387fbf3b074c.zip | |
Rollup merge of #131830 - hoodmane:emscripten-wasm-eh, r=workingjubilee
Add support for wasm exception handling to Emscripten target This is a draft because we need some additional setting for the Emscripten target to select between the old exception handling and the new exception handling. I don't know how to add a setting like that, would appreciate advice from Rust folks. We could maybe choose to use the new exception handling if `Ctarget-feature=+exception-handling` is passed? I tried this but I get errors from llvm so I'm not doing it right.
Diffstat (limited to 'compiler/rustc_codegen_llvm')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm_util.rs | 5 | 
1 files changed, 4 insertions, 1 deletions
| diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index e18e91e569f..c3d7c217861 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -109,7 +109,10 @@ unsafe fn configure_llvm(sess: &Session) { add("-wasm-enable-eh", false); } - if sess.target.os == "emscripten" && sess.panic_strategy() == PanicStrategy::Unwind { + if sess.target.os == "emscripten" + && !sess.opts.unstable_opts.emscripten_wasm_eh + && sess.panic_strategy() == PanicStrategy::Unwind + { add("-enable-emscripten-cxx-exceptions", false); } | 
