about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-01-13 20:43:49 -0500
committerGitHub <noreply@github.com>2025-01-13 20:43:49 -0500
commit05ae6bfeb480b2601ed87bb38080f88cb91c9ef5 (patch)
tree10a44e17d83ec60210fffdb8127055d122972375 /compiler
parent78aa0b917a111afb974362aee15007a878223289 (diff)
parent4d0a83800138be8e8515d200e58d32ec02351f11 (diff)
downloadrust-05ae6bfeb480b2601ed87bb38080f88cb91c9ef5.tar.gz
rust-05ae6bfeb480b2601ed87bb38080f88cb91c9ef5.zip
Rollup merge of #135450 - hoodmane:wasm-eh-abort-fix, r=workingjubilee
Fix emscripten-wasm-eh with unwind=abort

If we build the standard library with wasm-eh then we need to link with `-fwasm-exceptions` even if we compile with `panic=abort`.

Without this change, linking a `panic=abort` crate fails with: `undefined symbol: __cpp_exception`.

Followup to #131830.

r? workingjubilee
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index e4b3ad19801..df35b5e8426 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -2451,10 +2451,10 @@ fn add_order_independent_options(
     }
 
     if sess.target.os == "emscripten" {
-        cmd.cc_arg(if sess.panic_strategy() == PanicStrategy::Abort {
-            "-sDISABLE_EXCEPTION_CATCHING=1"
-        } else if sess.opts.unstable_opts.emscripten_wasm_eh {
+        cmd.cc_arg(if sess.opts.unstable_opts.emscripten_wasm_eh {
             "-fwasm-exceptions"
+        } else if sess.panic_strategy() == PanicStrategy::Abort {
+            "-sDISABLE_EXCEPTION_CATCHING=1"
         } else {
             "-sDISABLE_EXCEPTION_CATCHING=0"
         });