]> git.lizzy.rs Git - rust.git/commitdiff
Make rust build pass LLVM_RUSTLLVM to C++ compiler
authorCameron Hart <cameron.hart@gmail.com>
Fri, 29 Jul 2016 13:09:32 +0000 (23:09 +1000)
committerCameron Hart <cameron.hart@gmail.com>
Fri, 29 Jul 2016 13:09:32 +0000 (23:09 +1000)
src/bootstrap/compile.rs
src/librustc_llvm/build.rs

index 8ec9c7f0109f3f18c5035008d4751dd955473a6b..31915b11691989bfcc3c9aaba68e43b8bf394eed 100644 (file)
@@ -199,6 +199,10 @@ pub fn rustc<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
     if !build.unstable_features {
         cargo.env("CFG_DISABLE_UNSTABLE_FEATURES", "1");
     }
+    // Flag that rust llvm is in use
+    if build.config.target_config.get(target).is_none() {
+        cargo.env("LLVM_RUSTLLVM", "1");
+    }
     cargo.env("LLVM_CONFIG", build.llvm_config(target));
     if build.config.llvm_static_stdcpp {
         cargo.env("LLVM_STATIC_STDCPP",
index a2c808cbcb6b6dae988880d354dc5528b01ea85c..96b419d647ee32038afb34a100fb8fec264d7f79 100644 (file)
@@ -112,6 +112,10 @@ fn main() {
         cfg.flag(&flag);
     }
 
+    if env::var_os("LLVM_RUSTLLVM").is_some() {
+        cfg.flag("-DLLVM_RUSTLLVM");
+    }
+
     cfg.file("../rustllvm/ExecutionEngineWrapper.cpp")
        .file("../rustllvm/PassWrapper.cpp")
        .file("../rustllvm/RustWrapper.cpp")