1
Fork 0

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
This commit is contained in:
Jacob Pratt 2025-01-13 20:43:49 -05:00 committed by GitHub
commit 05ae6bfeb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"
});