mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
cleanup llvm module optimisation passes
This commit is contained in:
parent
2c05760aa5
commit
8090e99e75
7 changed files with 60 additions and 150 deletions
|
@ -103,21 +103,6 @@ pub fn get_relative_path(sub_path: &Path) -> Option<PathBuf> {
|
|||
None
|
||||
}
|
||||
|
||||
fn find_zig_glue_path() -> PathBuf {
|
||||
// First try using the repo path relative to the executable location.
|
||||
let path = get_relative_path(Path::new("crates/compiler/builtins/bitcode/src/glue.zig"));
|
||||
if let Some(path) = path {
|
||||
return path;
|
||||
}
|
||||
// Fallback on a lib path relative to the executable location.
|
||||
let path = get_relative_path(Path::new("lib/glue.zig"));
|
||||
if let Some(path) = path {
|
||||
return path;
|
||||
}
|
||||
|
||||
internal_error!("cannot find `glue.zig`. Check the source code in find_zig_glue_path() to show all the paths I tried.")
|
||||
}
|
||||
|
||||
fn find_wasi_libc_path() -> PathBuf {
|
||||
// This path is available when built and run from source
|
||||
// Environment variable defined in wasi-libc-sys/build.rs
|
||||
|
@ -282,10 +267,6 @@ pub fn build_zig_host_wasm32(
|
|||
"build-obj",
|
||||
zig_host_src,
|
||||
emit_bin,
|
||||
"--mod",
|
||||
&format!("glue::{}", find_zig_glue_path().to_str().unwrap()),
|
||||
"--deps",
|
||||
"glue",
|
||||
// include the zig runtime
|
||||
// "-fcompiler-rt",
|
||||
// include libc
|
||||
|
@ -1220,10 +1201,6 @@ fn link_wasm32(
|
|||
&format!("-femit-bin={}", output_path.to_str().unwrap()),
|
||||
"-target",
|
||||
"wasm32-wasi-musl",
|
||||
"--mod",
|
||||
&format!("glue::{}", find_zig_glue_path().to_str().unwrap()),
|
||||
"--deps",
|
||||
"glue",
|
||||
"-fstrip",
|
||||
"-O",
|
||||
"ReleaseSmall",
|
||||
|
@ -1251,10 +1228,6 @@ fn link_windows(
|
|||
&format!("-femit-bin={}", output_path.to_str().unwrap()),
|
||||
"-target",
|
||||
"native",
|
||||
"--mod",
|
||||
&format!("glue::{}", find_zig_glue_path().to_str().unwrap()),
|
||||
"--deps",
|
||||
"glue",
|
||||
"-O",
|
||||
"Debug",
|
||||
"-dynamic",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue