[bootstrap] Remove llvm.enabled config

This commit is contained in:
bjorn3 2019-03-02 11:43:17 +01:00
parent ca2ff089f3
commit 1c7d368ebe
5 changed files with 9 additions and 21 deletions

View File

@ -14,10 +14,6 @@
# =============================================================================
[llvm]
# Indicates whether rustc will support compilation with LLVM
# note: rustc does not compile without LLVM at the moment
#enabled = true
# Indicates whether the LLVM build is a Release or Debug build
#optimize = true

View File

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

View File

@ -64,7 +64,6 @@ pub struct Config {
pub backtrace_on_ice: bool,
// llvm codegen options
pub llvm_enabled: bool,
pub llvm_assertions: bool,
pub llvm_optimize: bool,
pub llvm_thin_lto: bool,
@ -244,7 +243,6 @@ struct Install {
#[derive(Deserialize, Default)]
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
struct Llvm {
enabled: Option<bool>,
ccache: Option<StringOrBool>,
ninja: Option<bool>,
assertions: Option<bool>,
@ -360,7 +358,6 @@ impl Config {
pub fn default_opts() -> Config {
let mut config = Config::default();
config.llvm_enabled = true;
config.llvm_optimize = true;
config.llvm_version_check = true;
config.backtrace = true;
@ -512,7 +509,6 @@ impl Config {
Some(StringOrBool::Bool(false)) | None => {}
}
set(&mut config.ninja, llvm.ninja);
set(&mut config.llvm_enabled, llvm.enabled);
llvm_assertions = llvm.assertions;
set(&mut config.llvm_optimize, llvm.optimize);
set(&mut config.llvm_thin_lto, llvm.thin_lto);
@ -671,6 +667,11 @@ impl Config {
pub fn very_verbose(&self) -> bool {
self.verbose > 1
}
pub fn llvm_enabled(&self) -> bool {
self.rust_codegen_backends.contains(&INTERNER.intern_str("llvm"))
|| self.rust_codegen_backends.contains(&INTERNER.intern_str("emscripten"))
}
}
fn set<T>(field: &mut T, val: Option<T>) {

View File

@ -1194,7 +1194,7 @@ impl Step for Compiletest {
cmd.arg("--quiet");
}
if builder.config.llvm_enabled {
if builder.config.llvm_enabled() {
let llvm_config = builder.ensure(native::Llvm {
target: builder.config.build,
emscripten: false,
@ -1227,12 +1227,6 @@ impl Step for Compiletest {
}
}
}
if suite == "run-make-fulldeps" && !builder.config.llvm_enabled {
builder.info(
"Ignoring run-make test suite as they generally don't work without LLVM"
);
return;
}
if suite != "run-make-fulldeps" {
cmd.arg("--cc")

View File

@ -699,8 +699,8 @@ impl<'a> Builder<'a> {
add_lib_path(lib_paths, cmd);
}
fn llvm_bin_path(&self) -> Option<PathBuf> {
if self.config.llvm_enabled {
fn llvm_bin_path(&self) -> Option<PathBuf> {
if self.config.llvm_enabled() {
let llvm_config = self.ensure(native::Llvm {
target: self.config.build,
emscripten: false,