about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2017-09-02 12:27:28 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2017-09-23 12:55:34 +0200
commit2c03c57bf5ac9e106440ea474827be16092f1807 (patch)
treeebfd7aa3ed52a3ab71a7f0b45de5ccb829a0e745
parentd44a256157f1773f146465107de1f211401ebf93 (diff)
downloadrust-2c03c57bf5ac9e106440ea474827be16092f1807.tar.gz
rust-2c03c57bf5ac9e106440ea474827be16092f1807.zip
Dont do no-trans for llvm enabled builds
-rw-r--r--src/bootstrap/bin/rustc.rs2
-rw-r--r--src/bootstrap/builder.rs6
-rw-r--r--src/librustc_driver/Cargo.toml2
-rw-r--r--src/librustc_metadata/Cargo.toml3
4 files changed, 11 insertions, 2 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index df9c55ce0be..2768d9c7f04 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -159,7 +159,7 @@ fn main() {
             cmd.arg("-C").arg("panic=abort");
         }
 
-        if cfg!(not(feature="llvm")) && stage != "0" {
+        if env::var("RUSTC_LLVM_ENABLED") == Ok("0".to_string()) && stage != "0" {
             cmd.arg("-Zno-trans");
         }
 
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index de6dd10938e..99712d9fcab 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -539,6 +539,12 @@ impl<'a> Builder<'a> {
                  .env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_libdir(compiler));
         }
 
+        if self.build.config.llvm_enabled {
+            cargo.env("RUSTC_LLVM_ENABLED", "1");
+        } else {
+            cargo.env("RUSTC_LLVM_ENABLED", "0");
+        }
+
         // Ignore incremental modes except for stage0, since we're
         // not guaranteeing correctness across builds if the compiler
         // is changing under your feet.`
diff --git a/src/librustc_driver/Cargo.toml b/src/librustc_driver/Cargo.toml
index d6155f53485..dabe15b6a6e 100644
--- a/src/librustc_driver/Cargo.toml
+++ b/src/librustc_driver/Cargo.toml
@@ -41,4 +41,4 @@ syntax_pos = { path = "../libsyntax_pos" }
 ar = "0.3.0"
 
 [features]
-llvm = ["rustc_trans"]
+llvm = ["rustc_trans", "rustc_metadata/llvm"]
diff --git a/src/librustc_metadata/Cargo.toml b/src/librustc_metadata/Cargo.toml
index 40b75be36fe..2c17797ed5d 100644
--- a/src/librustc_metadata/Cargo.toml
+++ b/src/librustc_metadata/Cargo.toml
@@ -21,3 +21,6 @@ serialize = { path = "../libserialize" }
 syntax = { path = "../libsyntax" }
 syntax_ext = { path = "../libsyntax_ext" }
 syntax_pos = { path = "../libsyntax_pos" }
+
+[features]
+llvm = []