Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't export __heap_base and __data_end on wasm32-wasi. #102385

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1320,10 +1320,12 @@ impl<'a> Linker for WasmLd<'a> {

// LLD will hide these otherwise-internal symbols since it only exports
// symbols explicitly passed via the `--export` flags above and hides all
// others. Various bits and pieces of tooling use this, so be sure these
// symbols make their way out of the linker as well.
self.cmd.arg("--export=__heap_base");
self.cmd.arg("--export=__data_end");
// others. Various bits and pieces of wasm32-unknown-unknown tooling use
// this, so be sure these symbols make their way out of the linker as well.
if self.sess.target.os == "unknown" {
self.cmd.arg("--export=__heap_base");
self.cmd.arg("--export=__data_end");
}
}

fn subsystem(&mut self, _subsystem: &str) {}
Expand Down