about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2022-01-24 14:16:36 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2022-02-23 18:53:05 +0100
commit512cc355b3f841bcf87418841e1a015d22b63e80 (patch)
tree27c69ce576204d2aa31c3d57786176a228355cdb
parentc651ba8a542c7d89b271efbf024a31091c824f4b (diff)
downloadrust-512cc355b3f841bcf87418841e1a015d22b63e80.tar.gz
rust-512cc355b3f841bcf87418841e1a015d22b63e80.zip
Always check cg_llvm with ./x.py check
Previously it would be skipped if codegen-backends doesn't contain llvm.
-rw-r--r--src/bootstrap/compile.rs2
-rw-r--r--src/bootstrap/lib.rs5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 53226977fd8..b2805d93b70 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -648,7 +648,7 @@ impl Step for Rustc {
 pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelection) {
     cargo
         .arg("--features")
-        .arg(builder.rustc_features())
+        .arg(builder.rustc_features(builder.kind))
         .arg("--manifest-path")
         .arg(builder.src.join("compiler/rustc/Cargo.toml"));
     rustc_cargo_env(builder, cargo, target);
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 6f010cc9f8c..86339c8d7f8 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -119,6 +119,7 @@ use std::os::windows::fs::symlink_file;
 use build_helper::{mtime, output, run, run_suppressed, t, try_run, try_run_suppressed};
 use filetime::FileTime;
 
+use crate::builder::Kind;
 use crate::config::{LlvmLibunwind, TargetSelection};
 use crate::util::{exe, libdir, CiEnv};
 
@@ -669,12 +670,12 @@ impl Build {
     }
 
     /// Gets the space-separated set of activated features for the compiler.
-    fn rustc_features(&self) -> String {
+    fn rustc_features(&self, kind: Kind) -> String {
         let mut features = String::new();
         if self.config.jemalloc {
             features.push_str("jemalloc");
         }
-        if self.config.llvm_enabled() {
+        if self.config.llvm_enabled() || kind == Kind::Check {
             features.push_str(" llvm");
         }