emit .bc to the right place in wasm + debug mode

This commit is contained in:
Folkert 2021-08-27 12:24:08 +02:00
parent e609da8c6c
commit 541c56adb7

View file

@ -219,6 +219,9 @@ pub fn gen_from_mono_module(
}
}
use target_lexicon::Architecture;
match target.architecture {
Architecture::X86_64 | Architecture::Aarch64(_) => {
// assemble the .ll into a .bc
let _ = Command::new("llvm-as")
.args(&[
@ -249,6 +252,21 @@ pub fn gen_from_mono_module(
.map_err(|_| {
panic!("We couldn't find llc-{} on your machine!", LLVM_VERSION);
});
}
Architecture::Wasm32 => {
// assemble the .ll into a .bc
let _ = Command::new("llvm-as")
.args(&[
app_ll_dbg_file.to_str().unwrap(),
"-o",
app_o_file.to_str().unwrap(),
])
.output()
.unwrap();
}
_ => unreachable!(),
}
} else {
// Emit the .o file
use target_lexicon::Architecture;