Skip to content

Commit 849d884

Browse files
committed
Remove --fatal-warnings on wasm targets
These were added with good intentions, but a recent change in LLVM 18 emits a warning while examining .rmeta sections in .rlib files. Since this flag is a nice-to-have and users can update their LLVM linker independently of rustc's LLVM version, we can just omit the flag.
1 parent 6265a95 commit 849d884

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

compiler/rustc_target/src/spec/base/wasm.rs

-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ pub fn options() -> TargetOptions {
3838
// supposed to be imported and have all other symbols generate errors if
3939
// they remain undefined.
4040
concat!($prefix, "--allow-undefined"),
41-
// Rust code should never have warnings, and warnings are often
42-
// indicative of bugs, let's prevent them.
43-
concat!($prefix, "--fatal-warnings"),
4441
// LLD only implements C++-like demangling, which doesn't match our own
4542
// mangling scheme. Tell LLD to not demangle anything and leave it up to
4643
// us to demangle these symbols later. Currently rustc does not perform

compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ use crate::spec::{
55
pub fn target() -> Target {
66
// Reset flags for non-Em flavors back to empty to satisfy sanity checking tests.
77
let pre_link_args = LinkArgs::new();
8-
let post_link_args = TargetOptions::link_args(
9-
LinkerFlavor::EmCc,
10-
&["-sABORTING_MALLOC=0", "-Wl,--fatal-warnings"],
11-
);
8+
let post_link_args = TargetOptions::link_args(LinkerFlavor::EmCc, &["-sABORTING_MALLOC=0"]);
129

1310
let opts = TargetOptions {
1411
os: "emscripten".into(),

0 commit comments

Comments
 (0)