Skip to content

Commit

Permalink
Dont do no-trans for llvm enabled builds
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Sep 23, 2017
1 parent d44a256 commit 2c03c57
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/bin/rustc.rs
Expand Up @@ -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");
}

Expand Down
6 changes: 6 additions & 0 deletions src/bootstrap/builder.rs
Expand Up @@ -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.`
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_driver/Cargo.toml
Expand Up @@ -41,4 +41,4 @@ syntax_pos = { path = "../libsyntax_pos" }
ar = "0.3.0"

[features]
llvm = ["rustc_trans"]
llvm = ["rustc_trans", "rustc_metadata/llvm"]
3 changes: 3 additions & 0 deletions src/librustc_metadata/Cargo.toml
Expand Up @@ -21,3 +21,6 @@ serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" }
syntax_ext = { path = "../libsyntax_ext" }
syntax_pos = { path = "../libsyntax_pos" }

[features]
llvm = []

0 comments on commit 2c03c57

Please sign in to comment.