about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorHood Chatham <roberthoodchatham@gmail.com>2024-10-17 13:00:35 +0200
committerHood Chatham <roberthoodchatham@gmail.com>2025-01-06 10:29:54 +0100
commit49c74234a79107afa7f86ca947708c3abef07674 (patch)
treebcab0a33a1e21dfe913687778b3ac5eba25188f0 /compiler/rustc_codegen_llvm/src/llvm_util.rs
parentbf6f8a4d328f7f3b0f6ea8205ad28591cc11aafd (diff)
downloadrust-49c74234a79107afa7f86ca947708c3abef07674.tar.gz
rust-49c74234a79107afa7f86ca947708c3abef07674.zip
Add support for wasm exception handling to Emscripten target
Gated behind an unstable `-Z emscripten-wasm-eh` flag
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs5
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 628c0b1c29c..b3e1210632f 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);
         }