mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
emit .bc to the right place in wasm + debug mode
This commit is contained in:
parent
e609da8c6c
commit
541c56adb7
1 changed files with 46 additions and 28 deletions
|
@ -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
|
// assemble the .ll into a .bc
|
||||||
let _ = Command::new("llvm-as")
|
let _ = Command::new("llvm-as")
|
||||||
.args(&[
|
.args(&[
|
||||||
|
@ -249,6 +252,21 @@ pub fn gen_from_mono_module(
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
panic!("We couldn't find llc-{} on your machine!", LLVM_VERSION);
|
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 {
|
} else {
|
||||||
// Emit the .o file
|
// Emit the .o file
|
||||||
use target_lexicon::Architecture;
|
use target_lexicon::Architecture;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue