Skip to content

Commit

Permalink
Unrolled build for rust-lang#135450
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rust-timer authored Jan 14, 2025
2 parents 1ab85fb + 4d0a838 commit 65b97e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
});
Expand Down

0 comments on commit 65b97e8

Please sign in to comment.