Skip to content

Commit 4f322db

Browse files
Disable unwinding for emscripten again
1 parent b9f3bdf commit 4f322db

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_middle::bug;
1212
use rustc_session::config::PrintRequest;
1313
use rustc_session::Session;
1414
use rustc_span::symbol::Symbol;
15-
use rustc_target::spec::{MergeFunctions, PanicStrategy};
15+
use rustc_target::spec::MergeFunctions;
1616
use smallvec::{smallvec, SmallVec};
1717
use std::ffi::{CStr, CString};
1818
use tracing::debug;
@@ -109,10 +109,6 @@ unsafe fn configure_llvm(sess: &Session) {
109109
}
110110
}
111111

112-
if sess.target.os == "emscripten" && sess.panic_strategy() == PanicStrategy::Unwind {
113-
add("-enable-emscripten-cxx-exceptions", false);
114-
}
115-
116112
// HACK(eddyb) LLVM inserts `llvm.assume` calls to preserve align attributes
117113
// during inlining. Unfortunately these may block other optimizations.
118114
add("-preserve-alignment-assumptions-during-inlining=false", false);

compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::{cvs, wasm_base};
2-
use super::{LinkArgs, LinkerFlavor, PanicStrategy, Target, TargetOptions};
2+
use super::{LinkArgs, LinkerFlavor, Target, TargetOptions};
33

44
pub fn target() -> Target {
55
let mut options = wasm_base::options();
@@ -16,7 +16,11 @@ pub fn target() -> Target {
1616
let mut post_link_args = LinkArgs::new();
1717
post_link_args.insert(
1818
LinkerFlavor::Em,
19-
vec!["-sABORTING_MALLOC=0".into(), "-Wl,--fatal-warnings".into()],
19+
vec![
20+
"-s".into(),
21+
"ABORTING_MALLOC=0".into(),
22+
"-Wl,--fatal-warnings".into(),
23+
],
2024
);
2125

2226
let opts = TargetOptions {
@@ -27,7 +31,6 @@ pub fn target() -> Target {
2731
exe_suffix: ".js".into(),
2832
linker: None,
2933
is_like_emscripten: true,
30-
panic_strategy: PanicStrategy::Unwind,
3134
post_link_args,
3235
families: cvs!["unix", "wasm"],
3336
..options

library/panic_abort/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub unsafe fn __rust_start_panic(_payload: *mut &mut dyn BoxMeUp) -> u32 {
116116
pub mod personalities {
117117
#[rustc_std_internal_symbol]
118118
#[cfg(not(any(
119-
all(target_family = "wasm", not(target_os = "emscripten")),
119+
all(target_family = "wasm"),
120120
all(target_os = "windows", target_env = "gnu", target_arch = "x86_64",),
121121
)))]
122122
pub extern "C" fn rust_eh_personality() {}

library/test/src/lib.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,8 @@ pub fn run_test(
457457
) -> Option<thread::JoinHandle<()>> {
458458
let TestDescAndFn { desc, testfn } = test;
459459

460-
// Emscripten can catch panics but other wasm targets cannot
461-
let ignore_because_no_process_support = desc.should_panic != ShouldPanic::No
462-
&& cfg!(target_family = "wasm")
463-
&& !cfg!(target_os = "emscripten");
460+
let ignore_because_no_process_support =
461+
desc.should_panic != ShouldPanic::No && cfg!(target_family = "wasm");
464462

465463
if force_ignore || desc.ignore || ignore_because_no_process_support {
466464
let message = CompletedTest::new(id, desc, TrIgnored, None, Vec::new());

0 commit comments

Comments
 (0)