Skip to content
/ rust Public
forked from rust-lang/rust

Commit 05ae6bf

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#131830. r? workingjubilee
2 parents 78aa0b9 + 4d0a838 commit 05ae6bf

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)