From 05045da9fdab511f39e88335b1bc7f92ea7973ba Mon Sep 17 00:00:00 2001 From: Cameron Hart Date: Sat, 6 Aug 2016 15:54:28 +1000 Subject: Improved checking of target's llvm_config Point llvm @bitshifter branch until PR accepted Use today's date for LLVM auto clean trigger Update LLVM submodule to point at rust-lang fork. Handle case when target is set --- src/bootstrap/compile.rs | 2 +- src/bootstrap/lib.rs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 9e1ee7ccd1e..155848901cd 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -199,7 +199,7 @@ pub fn rustc<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) { cargo.env("CFG_DISABLE_UNSTABLE_FEATURES", "1"); } // Flag that rust llvm is in use - if build.config.target_config.get(target).is_none() { + if build.is_rust_llvm(target) { cargo.env("LLVM_RUSTLLVM", "1"); } cargo.env("LLVM_CONFIG", build.llvm_config(target)); diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index acb7e0fadd9..5d61abe5e08 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -727,6 +727,16 @@ impl Build { self.out.join(target).join("llvm") } + /// Returns true if no custom `llvm-config` is set for the specified target. + /// + /// If no custom `llvm-config` was specified then Rust's llvm will be used. + fn is_rust_llvm(&self, target: &str) -> bool { + match self.config.target_config.get(target) { + Some(ref c) => c.llvm_config.is_none(), + None => true + } + } + /// Returns the path to `llvm-config` for the specified target. /// /// If a custom `llvm-config` was specified for target then that's returned -- cgit 1.4.1-3-g733a5