about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-11-10 10:04:17 -0800
committerAlex Crichton <alex@alexcrichton.com>2018-11-25 20:27:18 -0800
commitcc9c91d3858332766b7b7aa534fa4d6e2431d4a5 (patch)
treebde3acd5f58d5b03d8aa843245616a7974675f7d
parentc86b1529a5d2141bd61586f9464bcec665830231 (diff)
downloadrust-cc9c91d3858332766b7b7aa534fa4d6e2431d4a5.tar.gz
rust-cc9c91d3858332766b7b7aa534fa4d6e2431d4a5.zip
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!
-rw-r--r--src/librustc_codegen_ssa/back/linker.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs
index 7e1ea4655fe..f3cc344254f 100644
--- a/src/librustc_codegen_ssa/back/linker.rs
+++ b/src/librustc_codegen_ssa/back/linker.rs
@@ -1037,6 +1037,12 @@ impl<'a> Linker for WasmLd<'a> {
         // indicative of bugs, let's prevent them.
         self.cmd.arg("--fatal-warnings");
 
+        // The symbol visibility story is a bit in flux right now with LLD.
+        // It's... not entirely clear to me what's going on, but this looks to
+        // make everything work when `export_symbols` isn't otherwise called for
+        // things like executables.
+        self.cmd.arg("--export-dynamic");
+
         // LLD only implements C++-like demangling, which doesn't match our own
         // mangling scheme. Tell LLD to not demangle anything and leave it up to
         // us to demangle these symbols later.