cleanup llvm module optimisation passes

This commit is contained in:
Luke Boswell 2024-08-04 12:13:01 +10:00
parent 2c05760aa5
commit 8090e99e75
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
7 changed files with 60 additions and 150 deletions

View file

@ -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",