Skip to content

Commit 4d0a838

Browse files
committed
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.
1 parent 7a202a9 commit 4d0a838

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+3
-3
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2451,10 +2451,10 @@ fn add_order_independent_options(
24512451
}
24522452

24532453
if sess.target.os == "emscripten" {
2454-
cmd.cc_arg(if sess.panic_strategy() == PanicStrategy::Abort {
2455-
"-sDISABLE_EXCEPTION_CATCHING=1"
2456-
} else if sess.opts.unstable_opts.emscripten_wasm_eh {
2454+
cmd.cc_arg(if sess.opts.unstable_opts.emscripten_wasm_eh {
24572455
"-fwasm-exceptions"
2456+
} else if sess.panic_strategy() == PanicStrategy::Abort {
2457+
"-sDISABLE_EXCEPTION_CATCHING=1"
24582458
} else {
24592459
"-sDISABLE_EXCEPTION_CATCHING=0"
24602460
});

0 commit comments

Comments
 (0)