about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-11-09 13:51:00 -0800
committerAlex Crichton <alex@alexcrichton.com>2018-11-25 20:27:18 -0800
commitc86b1529a5d2141bd61586f9464bcec665830231 (patch)
treebf09bbd5412870ec4f1c04bfd8d6284a163dad52
parentbf01bcb451d20d770091acb5cde4a024d91a0740 (diff)
downloadrust-c86b1529a5d2141bd61586f9464bcec665830231.tar.gz
rust-c86b1529a5d2141bd61586f9464bcec665830231.zip
wasm: Pass `--no-demangle` to LLD
Our mangling scheme is not C++'s, so tell LLD to not demangle anything
so we can handle Rust-specific demangling ourselves.
-rw-r--r--src/librustc_codegen_ssa/back/linker.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs
index ec5ca580104..7e1ea4655fe 100644
--- a/src/librustc_codegen_ssa/back/linker.rs
+++ b/src/librustc_codegen_ssa/back/linker.rs
@@ -1037,6 +1037,11 @@ impl<'a> Linker for WasmLd<'a> {
         // indicative of bugs, let's prevent them.
         self.cmd.arg("--fatal-warnings");
 
+        // 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.
+        self.cmd.arg("--no-demangle");
+
         ::std::mem::replace(&mut self.cmd, Command::new(""))
     }