Skip to content

Commit 2c03c57

Browse files
committed
Dont do no-trans for llvm enabled builds
1 parent d44a256 commit 2c03c57

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ fn main() {
159159
cmd.arg("-C").arg("panic=abort");
160160
}
161161

162-
if cfg!(not(feature="llvm")) && stage != "0" {
162+
if env::var("RUSTC_LLVM_ENABLED") == Ok("0".to_string()) && stage != "0" {
163163
cmd.arg("-Zno-trans");
164164
}
165165

src/bootstrap/builder.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,12 @@ impl<'a> Builder<'a> {
539539
.env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_libdir(compiler));
540540
}
541541

542+
if self.build.config.llvm_enabled {
543+
cargo.env("RUSTC_LLVM_ENABLED", "1");
544+
} else {
545+
cargo.env("RUSTC_LLVM_ENABLED", "0");
546+
}
547+
542548
// Ignore incremental modes except for stage0, since we're
543549
// not guaranteeing correctness across builds if the compiler
544550
// is changing under your feet.`

src/librustc_driver/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ syntax_pos = { path = "../libsyntax_pos" }
4141
ar = "0.3.0"
4242

4343
[features]
44-
llvm = ["rustc_trans"]
44+
llvm = ["rustc_trans", "rustc_metadata/llvm"]

src/librustc_metadata/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ serialize = { path = "../libserialize" }
2121
syntax = { path = "../libsyntax" }
2222
syntax_ext = { path = "../libsyntax_ext" }
2323
syntax_pos = { path = "../libsyntax_pos" }
24+
25+
[features]
26+
llvm = []

0 commit comments

Comments
 (0)