Skip to content

Commit

Permalink
Unrolled build for rust-lang#120278
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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`](llvm/llvm-project#78658 (comment)).
  • Loading branch information
rust-timer committed Jan 25, 2024
2 parents d93fecc + 849d884 commit c47044b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 0 additions & 3 deletions compiler/rustc_target/src/spec/base/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit c47044b

Please sign in to comment.