Fix emscripten linker invocation
This commit is contained in:
parent
606848a61e
commit
5cc3593c17
3 changed files with 8 additions and 13 deletions
|
@ -3686,6 +3686,7 @@ dependencies = [
|
||||||
"rustc_span",
|
"rustc_span",
|
||||||
"rustc_symbol_mangling",
|
"rustc_symbol_mangling",
|
||||||
"rustc_target",
|
"rustc_target",
|
||||||
|
"serde_json",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"snap",
|
"snap",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
|
|
|
@ -16,6 +16,7 @@ jobserver = "0.1.22"
|
||||||
tempfile = "3.2"
|
tempfile = "3.2"
|
||||||
thorin-dwp = "0.2"
|
thorin-dwp = "0.2"
|
||||||
pathdiff = "0.2.0"
|
pathdiff = "0.2.0"
|
||||||
|
serde_json = "1.0.59"
|
||||||
snap = "1"
|
snap = "1"
|
||||||
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
|
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
|
||||||
regex = "1.4"
|
regex = "1.4"
|
||||||
|
|
|
@ -1146,24 +1146,17 @@ impl<'a> Linker for EmLinker<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn export_symbols(&mut self, _tmpdir: &Path, _crate_type: CrateType, symbols: &[String]) {
|
fn export_symbols(&mut self, _tmpdir: &Path, _crate_type: CrateType, symbols: &[String]) {
|
||||||
use std::fmt::Write;
|
|
||||||
|
|
||||||
debug!("EXPORTED SYMBOLS:");
|
debug!("EXPORTED SYMBOLS:");
|
||||||
|
|
||||||
let mut encoded = "[".to_string();
|
|
||||||
let mut symbols = symbols.iter();
|
|
||||||
if let Some(first_symbol) = symbols.next() {
|
|
||||||
write!(encoded, "{:?}", first_symbol).unwrap();
|
|
||||||
}
|
|
||||||
for symbol in symbols {
|
|
||||||
write!(encoded, ",{:?}", symbol).unwrap();
|
|
||||||
}
|
|
||||||
encoded.push(']');
|
|
||||||
debug!("{}", encoded);
|
|
||||||
|
|
||||||
self.cmd.arg("-s");
|
self.cmd.arg("-s");
|
||||||
|
|
||||||
let mut arg = OsString::from("EXPORTED_FUNCTIONS=");
|
let mut arg = OsString::from("EXPORTED_FUNCTIONS=");
|
||||||
|
let encoded = serde_json::to_string(
|
||||||
|
&symbols.iter().map(|sym| "_".to_owned() + sym).collect::<Vec<_>>(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
debug!("{}", encoded);
|
||||||
|
|
||||||
arg.push(encoded);
|
arg.push(encoded);
|
||||||
|
|
||||||
self.cmd.arg(arg);
|
self.cmd.arg(arg);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue