From 53d58dbf5f8a65189e5f97ef46da6593484a9e79 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Fri, 10 Apr 2020 22:42:19 +0200 Subject: [PATCH] Require compiler-rt root at ../src/llvm-project/compiler-rt --- src/bootstrap/compile.rs | 2 ++ src/libprofiler_builtins/build.rs | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 32ce170a5a1..f44096af6dd 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -186,6 +186,8 @@ pub fn std_cargo(builder: &Builder<'_>, target: Interned, cargo: &mut Ca // `compiler-rt` is located. let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt"); 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); " compiler-builtins-c".to_string() } else { diff --git a/src/libprofiler_builtins/build.rs b/src/libprofiler_builtins/build.rs index c990b289335..e23e2f2c130 100644 --- a/src/libprofiler_builtins/build.rs +++ b/src/libprofiler_builtins/build.rs @@ -63,8 +63,9 @@ fn main() { cfg.define("COMPILER_RT_HAS_ATOMICS", Some("1")); } - let root = env::var_os("RUST_COMPILER_RT_ROOT").unwrap(); - let root = Path::new(&root); + // Note that this should exist if we're going to run (otherwise we just + // don't build profiler builtins at all). + let root = Path::new("../llvm-project/compiler-rt"); let src_root = root.join("lib").join("profile"); for src in profile_sources { -- 2.44.0