Require compiler-rt root at ../src/llvm-project/compiler-rt

This commit is contained in:
Luca Barbieri 2020-04-10 22:42:19 +02:00 committed by Mark Rousskov
parent ac2b84f962
commit 53d58dbf5f
2 changed files with 5 additions and 2 deletions

View File

@ -186,6 +186,8 @@ pub fn std_cargo(builder: &Builder<'_>, target: Interned<String>, cargo: &mut Ca
// `compiler-rt` is located. // `compiler-rt` is located.
let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt"); let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt");
let compiler_builtins_c_feature = if compiler_builtins_root.exists() { let compiler_builtins_c_feature = if compiler_builtins_root.exists() {
// Note that `libprofiler_builtins/build.rs` also computes this so if
// you're changing something here please also change that.
cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root); cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root);
" compiler-builtins-c".to_string() " compiler-builtins-c".to_string()
} else { } else {

View File

@ -63,8 +63,9 @@ fn main() {
cfg.define("COMPILER_RT_HAS_ATOMICS", Some("1")); cfg.define("COMPILER_RT_HAS_ATOMICS", Some("1"));
} }
let root = env::var_os("RUST_COMPILER_RT_ROOT").unwrap(); // Note that this should exist if we're going to run (otherwise we just
let root = Path::new(&root); // don't build profiler builtins at all).
let root = Path::new("../llvm-project/compiler-rt");
let src_root = root.join("lib").join("profile"); let src_root = root.join("lib").join("profile");
for src in profile_sources { for src in profile_sources {