ENH Move --memory-init-file flag from EmLinker to asmjs target spec

This commit is contained in:
Hood Chatham 2022-06-15 12:33:27 -07:00
parent 8e430bfa9a
commit 3fb6d45af9
2 changed files with 5 additions and 7 deletions

View File

@ -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) {

View File

@ -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
}