Unconditionally pass -wasm-enable-eh

This commit is contained in:
Noa 2024-02-22 16:52:48 -06:00
parent 861c7e74c8
commit 658a0a20ea
No known key found for this signature in database
GPG Key ID: 7F9F7DB1768C59CF
2 changed files with 7 additions and 12 deletions

View File

@ -99,12 +99,12 @@ fn llvm_arg_to_arg_name(full_arg: &str) -> &str {
}
}
if sess.panic_strategy() == PanicStrategy::Unwind {
if sess.target.os == "emscripten" {
add("-enable-emscripten-cxx-exceptions", false);
} else if wants_wasm_eh(sess) {
add("-wasm-enable-eh", false);
}
if wants_wasm_eh(sess) {
add("-wasm-enable-eh", false);
}
if sess.target.os == "emscripten" && sess.panic_strategy() == PanicStrategy::Unwind {
add("-enable-emscripten-cxx-exceptions", false);
}
// HACK(eddyb) LLVM inserts `llvm.assume` calls to preserve align attributes

View File

@ -60,12 +60,7 @@
))] {
#[path = "gcc.rs"]
mod real_imp;
} else if #[cfg(all(target_family = "wasm", panic = "unwind"))] {
// for now, PanicStrategy::Unwind is not the default for wasm targets,
// so we need the panic = "unwind" in the cfg above. to use llvm.wasm.throw,
// we need to pass -wasm-enable-eh to LLVM, but that only happens if rustc
// is compiling with -C panic=unwind. So, this lets us -Zbuild-std with
// panic=unwind, while keeping the default panic=abort working.
} else if #[cfg(target_family = "wasm")] {
#[path = "wasm.rs"]
mod real_imp;
} else {