Skip to content

Commit cc9c91d

Browse files
committed
Pass --export-dynamic to LLD for wasm
This should handle recent symbol visibility changes happening, although we'll likely want to tweak this in the future!
1 parent c86b152 commit cc9c91d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc_codegen_ssa/back/linker.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,12 @@ impl<'a> Linker for WasmLd<'a> {
10371037
// indicative of bugs, let's prevent them.
10381038
self.cmd.arg("--fatal-warnings");
10391039

1040+
// The symbol visibility story is a bit in flux right now with LLD.
1041+
// It's... not entirely clear to me what's going on, but this looks to
1042+
// make everything work when `export_symbols` isn't otherwise called for
1043+
// things like executables.
1044+
self.cmd.arg("--export-dynamic");
1045+
10401046
// LLD only implements C++-like demangling, which doesn't match our own
10411047
// mangling scheme. Tell LLD to not demangle anything and leave it up to
10421048
// us to demangle these symbols later.

0 commit comments

Comments
 (0)