Unconditionally pass -wasm-enable-eh
This commit is contained in:
parent
861c7e74c8
commit
658a0a20ea
2 changed files with 7 additions and 12 deletions
|
@ -99,12 +99,12 @@ unsafe fn configure_llvm(sess: &Session) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if sess.panic_strategy() == PanicStrategy::Unwind {
|
if wants_wasm_eh(sess) {
|
||||||
if sess.target.os == "emscripten" {
|
add("-wasm-enable-eh", false);
|
||||||
add("-enable-emscripten-cxx-exceptions", false);
|
}
|
||||||
} else 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
|
// HACK(eddyb) LLVM inserts `llvm.assume` calls to preserve align attributes
|
||||||
|
|
|
@ -60,12 +60,7 @@ cfg_if::cfg_if! {
|
||||||
))] {
|
))] {
|
||||||
#[path = "gcc.rs"]
|
#[path = "gcc.rs"]
|
||||||
mod real_imp;
|
mod real_imp;
|
||||||
} else if #[cfg(all(target_family = "wasm", panic = "unwind"))] {
|
} else if #[cfg(target_family = "wasm")] {
|
||||||
// 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.
|
|
||||||
#[path = "wasm.rs"]
|
#[path = "wasm.rs"]
|
||||||
mod real_imp;
|
mod real_imp;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue