Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,11 @@ impl<'a> Linker for GccLinker<'a> {
self.sess.dcx().emit_fatal(errors::VersionScriptWriteFailure { error });
}
self.link_arg("--dynamic-list").link_arg(path);
} else if self.sess.target.is_like_wasm {
self.link_arg("--no-export-dynamic");
for (sym, _) in symbols {
self.link_arg("--export").link_arg(sym);
}
} else {
// Write an LD version script
let res: io::Result<()> = try {
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_target/src/spec/base/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ pub(crate) fn options() -> TargetOptions {
// threaded model which will legalize atomics to normal operations.
singlethread: true,

// Symbol visibility takes care of this for the WebAssembly.
// Additionally the only known linker, LLD, doesn't support the script
// arguments just yet
limit_rdylib_exports: false,

// we use the LLD shipped with the Rust toolchain by default
linker: Some("rust-lld".into()),
linker_flavor: LinkerFlavor::WasmLld(Cc::No),
Expand Down
Loading