diff --git a/crates/builtins/build.rs b/crates/builtins/build.rs index e16d4eb6..dabea2e9 100644 --- a/crates/builtins/build.rs +++ b/crates/builtins/build.rs @@ -13,9 +13,12 @@ fn main() { .read_to_string(&mut llvm_lib_dir) .expect("llvm-config output should be utf8"); - let lib_path = std::path::PathBuf::from(llvm_lib_dir.trim()) + let mut lib_path = std::path::PathBuf::from(llvm_lib_dir.trim()) .join("linux") .join(lib); + if !lib_path.exists() { + lib_path = std::path::PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()).join(lib); + } let archive = fs::read(lib_path).expect("clang builtins for riscv32 not found"); let out_dir = env::var_os("OUT_DIR").expect("has OUT_DIR"); diff --git a/crates/builtins/libclang_rt.builtins-riscv32.a b/crates/builtins/libclang_rt.builtins-riscv32.a new file mode 100644 index 00000000..e9ee15d4 Binary files /dev/null and b/crates/builtins/libclang_rt.builtins-riscv32.a differ