about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-01-25 08:39:43 +0100
committerGitHub <noreply@github.com>2024-01-25 08:39:43 +0100
commit565961bbf0450153ff37fddbdea7ff1cba424355 (patch)
tree3450b5491f98edd1ba662e33cb5f75fd4bb7f0e9
parent55d5ea321a672dbd45fdaf9b27b4401cccd9f197 (diff)
parent849d884141530c1e5b04a7cd66a0332fe9dd1d7a (diff)
downloadrust-565961bbf0450153ff37fddbdea7ff1cba424355.tar.gz
rust-565961bbf0450153ff37fddbdea7ff1cba424355.zip
Rollup merge of #120278 - djkoloski:remove_fatal_warnings_wasm, r=oli-obk
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.

See [this comment on wasm targets' uses of `--fatal-warnings`](https://github.com/llvm/llvm-project/pull/78658#issuecomment-1906651390).
-rw-r--r--compiler/rustc_target/src/spec/base/wasm.rs3
-rw-r--r--compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs5
2 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs
index 87ade9e58cf..4b4d2aca26e 100644
--- a/compiler/rustc_target/src/spec/base/wasm.rs
+++ b/compiler/rustc_target/src/spec/base/wasm.rs
@@ -38,9 +38,6 @@ pub fn options() -> TargetOptions {
                 // supposed to be imported and have all other symbols generate errors if
                 // they remain undefined.
                 concat!($prefix, "--allow-undefined"),
-                // Rust code should never have warnings, and warnings are often
-                // indicative of bugs, let's prevent them.
-                concat!($prefix, "--fatal-warnings"),
                 // LLD only implements C++-like demangling, which doesn't match our own
                 // mangling scheme. Tell LLD to not demangle anything and leave it up to
                 // us to demangle these symbols later. Currently rustc does not perform
diff --git a/compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs b/compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs
index 394f02ecac4..e9e874297d3 100644
--- a/compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs
+++ b/compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs
@@ -5,10 +5,7 @@ use crate::spec::{
 pub fn target() -> Target {
     // Reset flags for non-Em flavors back to empty to satisfy sanity checking tests.
     let pre_link_args = LinkArgs::new();
-    let post_link_args = TargetOptions::link_args(
-        LinkerFlavor::EmCc,
-        &["-sABORTING_MALLOC=0", "-Wl,--fatal-warnings"],
-    );
+    let post_link_args = TargetOptions::link_args(LinkerFlavor::EmCc, &["-sABORTING_MALLOC=0"]);
 
     let opts = TargetOptions {
         os: "emscripten".into(),