Skip to content

Commit 1c7d368

Browse files
committed
[bootstrap] Remove llvm.enabled config
1 parent ca2ff08 commit 1c7d368

File tree

5 files changed

+9
-21
lines changed

5 files changed

+9
-21
lines changed

config.toml.example

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
# =============================================================================
1515
[llvm]
1616

17-
# Indicates whether rustc will support compilation with LLVM
18-
# note: rustc does not compile without LLVM at the moment
19-
#enabled = true
20-
2117
# Indicates whether the LLVM build is a Release or Debug build
2218
#optimize = true
2319

src/bootstrap/builder.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -996,10 +996,7 @@ impl<'a> Builder<'a> {
996996
// For other crates, however, we know that we've already got a standard
997997
// library up and running, so we can use the normal compiler to compile
998998
// build scripts in that situation.
999-
//
1000-
// If LLVM support is disabled we need to use the snapshot compiler to compile
1001-
// build scripts, as the new compiler doesn't support executables.
1002-
if mode == Mode::Std || !self.config.llvm_enabled {
999+
if mode == Mode::Std {
10031000
cargo
10041001
.env("RUSTC_SNAPSHOT", &self.initial_rustc)
10051002
.env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_snapshot_libdir());

src/bootstrap/config.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ pub struct Config {
6464
pub backtrace_on_ice: bool,
6565

6666
// llvm codegen options
67-
pub llvm_enabled: bool,
6867
pub llvm_assertions: bool,
6968
pub llvm_optimize: bool,
7069
pub llvm_thin_lto: bool,
@@ -244,7 +243,6 @@ struct Install {
244243
#[derive(Deserialize, Default)]
245244
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
246245
struct Llvm {
247-
enabled: Option<bool>,
248246
ccache: Option<StringOrBool>,
249247
ninja: Option<bool>,
250248
assertions: Option<bool>,
@@ -360,7 +358,6 @@ impl Config {
360358

361359
pub fn default_opts() -> Config {
362360
let mut config = Config::default();
363-
config.llvm_enabled = true;
364361
config.llvm_optimize = true;
365362
config.llvm_version_check = true;
366363
config.backtrace = true;
@@ -512,7 +509,6 @@ impl Config {
512509
Some(StringOrBool::Bool(false)) | None => {}
513510
}
514511
set(&mut config.ninja, llvm.ninja);
515-
set(&mut config.llvm_enabled, llvm.enabled);
516512
llvm_assertions = llvm.assertions;
517513
set(&mut config.llvm_optimize, llvm.optimize);
518514
set(&mut config.llvm_thin_lto, llvm.thin_lto);
@@ -671,6 +667,11 @@ impl Config {
671667
pub fn very_verbose(&self) -> bool {
672668
self.verbose > 1
673669
}
670+
671+
pub fn llvm_enabled(&self) -> bool {
672+
self.rust_codegen_backends.contains(&INTERNER.intern_str("llvm"))
673+
|| self.rust_codegen_backends.contains(&INTERNER.intern_str("emscripten"))
674+
}
674675
}
675676

676677
fn set<T>(field: &mut T, val: Option<T>) {

src/bootstrap/test.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ impl Step for Compiletest {
11941194
cmd.arg("--quiet");
11951195
}
11961196

1197-
if builder.config.llvm_enabled {
1197+
if builder.config.llvm_enabled() {
11981198
let llvm_config = builder.ensure(native::Llvm {
11991199
target: builder.config.build,
12001200
emscripten: false,
@@ -1227,12 +1227,6 @@ impl Step for Compiletest {
12271227
}
12281228
}
12291229
}
1230-
if suite == "run-make-fulldeps" && !builder.config.llvm_enabled {
1231-
builder.info(
1232-
"Ignoring run-make test suite as they generally don't work without LLVM"
1233-
);
1234-
return;
1235-
}
12361230

12371231
if suite != "run-make-fulldeps" {
12381232
cmd.arg("--cc")

src/bootstrap/tool.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,8 @@ impl<'a> Builder<'a> {
699699
add_lib_path(lib_paths, cmd);
700700
}
701701

702-
fn llvm_bin_path(&self) -> Option<PathBuf> {
703-
if self.config.llvm_enabled {
702+
fn llvm_bin_path(&self) -> Option<PathBuf> {
703+
if self.config.llvm_enabled() {
704704
let llvm_config = self.ensure(native::Llvm {
705705
target: self.config.build,
706706
emscripten: false,

0 commit comments

Comments
 (0)