Skip to content

Commit

Permalink
Rollup merge of #98146 - hoodmane:remove-memory-init-flag, r=petroche…
Browse files Browse the repository at this point in the history
…nkov

Remove --memory-init-file flag when linking with Emscripten

This flag does nothing. It only applies when generating asmjs JavaScript.
``@sbc100``
  • Loading branch information
Dylan-DPC authored Jun 19, 2022
2 parents 6e8f541 + 3fb6d45 commit 88cb597
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1120,8 +1120,6 @@ impl<'a> Linker for EmLinker<'a> {
OptLevel::Size => "-Os",
OptLevel::SizeMin => "-Oz",
});
// Unusable until https://github.com/rust-lang/rust/issues/38454 is resolved
self.cmd.args(&["--memory-init-file", "0"]);
}

fn pgo_gen(&mut self) {
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_target/src/spec/asmjs_unknown_emscripten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use super::{wasm32_unknown_emscripten, LinkerFlavor, Target};

pub fn target() -> Target {
let mut target = wasm32_unknown_emscripten::target();
target
.post_link_args
.entry(LinkerFlavor::Em)
.or_default()
.extend(vec!["-s".into(), "WASM=0".into()]);
target.post_link_args.entry(LinkerFlavor::Em).or_default().extend(vec![
"-sWASM=0".into(),
"--memory-init-file".into(),
"0".into(),
]);
target
}

0 comments on commit 88cb597

Please sign in to comment.