]> git.lizzy.rs Git - rust.git/commitdiff
Pass `--export-dynamic` to LLD for wasm
authorAlex Crichton <alex@alexcrichton.com>
Sat, 10 Nov 2018 18:04:17 +0000 (10:04 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 26 Nov 2018 04:27:18 +0000 (20:27 -0800)
This should handle recent symbol visibility changes happening, although
we'll likely want to tweak this in the future!

src/librustc_codegen_ssa/back/linker.rs

index 7e1ea4655fe992a8e69096b16a0f21d8e86114ea..f3cc344254feaae74ccbb4a261ddcf247f4f24ce 100644 (file)
@@ -1037,6 +1037,12 @@ fn finalize(&mut self) -> Command {
         // 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.