Dont do no-trans for llvm enabled builds

This commit is contained in:
bjorn3 2017-09-02 12:27:28 +02:00
parent d44a256157
commit 2c03c57bf5
4 changed files with 11 additions and 2 deletions

View file

@ -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");
}

View file

@ -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.`

View file

@ -41,4 +41,4 @@ syntax_pos = { path = "../libsyntax_pos" }
ar = "0.3.0"
[features]
llvm = ["rustc_trans"]
llvm = ["rustc_trans", "rustc_metadata/llvm"]

View file

@ -21,3 +21,6 @@ serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" }
syntax_ext = { path = "../libsyntax_ext" }
syntax_pos = { path = "../libsyntax_pos" }
[features]
llvm = []