about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2018-06-30 10:45:14 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2018-07-07 10:56:07 +0200
commitff12beb8756f028d44f898a91960ed70102a4792 (patch)
treeb1a12ec881a468e12040479d16923c0ae6aba52a /src/bootstrap
parent163cb572a491cb3eb7f2c792415c93840cb7e9c0 (diff)
downloadrust-ff12beb8756f028d44f898a91960ed70102a4792.tar.gz
rust-ff12beb8756f028d44f898a91960ed70102a4792.zip
Revert changes to bootstrap, rustc_driver and fix {core,std}simd
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bin/rustc.rs5
-rw-r--r--src/bootstrap/builder.rs6
-rw-r--r--src/bootstrap/compile.rs27
-rw-r--r--src/bootstrap/config.rs4
-rw-r--r--src/bootstrap/test.rs4
-rw-r--r--src/bootstrap/tool.rs2
6 files changed, 21 insertions, 27 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index 04882426fd8..4607ca5cf9f 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -107,11 +107,6 @@ fn main() {
              env::join_paths(&dylib_path).unwrap());
     let mut maybe_crate = None;
 
-    // Don't use metadata only backend for snapshot compiler, because it may be broken
-    if env::var("RUSTC_SHOULD_USE_METADATA_ONLY_BACKEND").is_err() {
-        cmd.arg("--cfg").arg("codegen_backend=\"llvm\"");
-    }
-
     // Print backtrace in case of ICE
     if env::var("RUSTC_BACKTRACE_ON_ICE").is_ok() && env::var("RUST_BACKTRACE").is_err() {
         cmd.env("RUST_BACKTRACE", "1");
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 7e4a12f7310..fad0a553802 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -747,10 +747,6 @@ impl<'a> Builder<'a> {
             stage = compiler.stage;
         }
 
-        if self.config.rust_codegen_backends.is_empty() {
-            cargo.env("RUSTC_SHOULD_USE_METADATA_ONLY_BACKEND", "1");
-        }
-
         let mut extra_args = env::var(&format!("RUSTFLAGS_STAGE_{}", stage)).unwrap_or_default();
         if stage != 0 {
             let s = env::var("RUSTFLAGS_STAGE_NOT_0").unwrap_or_default();
@@ -897,7 +893,7 @@ impl<'a> Builder<'a> {
         //
         // 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.rust_codegen_backends.is_empty() {
+        if mode == Mode::Std || !self.config.llvm_enabled {
             cargo
                 .env("RUSTC_SNAPSHOT", &self.initial_rustc)
                 .env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_snapshot_libdir());
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 524df9587da..298bd58c6cd 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -182,13 +182,11 @@ pub fn std_cargo(builder: &Builder,
             // missing
             // We also only build the runtimes when --enable-sanitizers (or its
             // config.toml equivalent) is used
-            if !builder.config.rust_codegen_backends.is_empty() {
-                let llvm_config = builder.ensure(native::Llvm {
-                    target: builder.config.build,
-                    emscripten: false,
-                });
-                cargo.env("LLVM_CONFIG", llvm_config);
-            }
+            let llvm_config = builder.ensure(native::Llvm {
+                target: builder.config.build,
+                emscripten: false,
+            });
+            cargo.env("LLVM_CONFIG", llvm_config);
         }
 
         cargo.arg("--features").arg(features)
@@ -645,13 +643,14 @@ impl Step for CodegenBackend {
 
     fn make_run(run: RunConfig) {
         let backend = run.builder.config.rust_codegen_backends.get(0);
-        if let Some(backend) = backend.cloned() {
-            run.builder.ensure(CodegenBackend {
-                compiler: run.builder.compiler(run.builder.top_stage, run.host),
-                target: run.target,
-                backend,
-            });
-        }
+        let backend = backend.cloned().unwrap_or_else(|| {
+            INTERNER.intern_str("llvm")
+        });
+        run.builder.ensure(CodegenBackend {
+            compiler: run.builder.compiler(run.builder.top_stage, run.host),
+            target: run.target,
+            backend,
+        });
     }
 
     fn run(self, builder: &Builder) {
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index 2e629456b7e..b3ed10257bd 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -74,6 +74,7 @@ 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_release_debuginfo: bool,
@@ -238,6 +239,7 @@ 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>,
@@ -339,6 +341,7 @@ 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.use_jemalloc = true;
@@ -493,6 +496,7 @@ 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_release_debuginfo, llvm.release_debuginfo);
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 917b85690de..6254f981656 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -1096,7 +1096,7 @@ impl Step for Compiletest {
             cmd.arg("--quiet");
         }
 
-        if !builder.config.rust_codegen_backends.is_empty() {
+        if builder.config.llvm_enabled {
             let llvm_config = builder.ensure(native::Llvm {
                 target: builder.config.build,
                 emscripten: false,
@@ -1129,7 +1129,7 @@ impl Step for Compiletest {
                 }
             }
         }
-        if suite == "run-make-fulldeps" && builder.config.rust_codegen_backends.is_empty() {
+        if suite == "run-make-fulldeps" && !builder.config.llvm_enabled {
             builder.info(&format!(
                 "Ignoring run-make test suite as they generally don't work without LLVM"
             ));
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index 640dd9ecdd9..b3d7b9a91ec 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -672,7 +672,7 @@ impl<'a> Builder<'a> {
     }
 
     fn llvm_bin_path(&self) -> Option<PathBuf> {
-        if !self.config.rust_codegen_backends.is_empty() && !self.config.dry_run {
+        if self.config.llvm_enabled && !self.config.dry_run {
             let llvm_config = self.ensure(native::Llvm {
                 target: self.config.build,
                 emscripten: false,