about summary refs log tree commit diff
path: root/src/bootstrap/lib.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-09-01 21:37:09 +0200
committerGitHub <noreply@github.com>2022-09-01 21:37:09 +0200
commit1c0561aca6a044dc56038d171ce8610ceec6ccb2 (patch)
tree0d68df0068f975672b482f5561e7084a370076b1 /src/bootstrap/lib.rs
parentb05f97d5941bed7d564933716a4f4af8db1c901c (diff)
parent73958fdf14d965eac2148991af99f0e0ad0c97ad (diff)
downloadrust-1c0561aca6a044dc56038d171ce8610ceec6ccb2.tar.gz
rust-1c0561aca6a044dc56038d171ce8610ceec6ccb2.zip
Rollup merge of #101072 - tmandry:llvm-is-vanilla, r=Mark-Simulacrum
bootstrap: Add llvm-has-rust-patches target option

This is so you can check out an upstream commit in src/llvm-project and
have everything just work.

This simplifies the logic in `is_rust_llvm` a bit; it doesn't need to
check for download-ci-llvm because we would have already errored if both
that and llvm-config were specified on the host platform.
Diffstat (limited to 'src/bootstrap/lib.rs')
-rw-r--r--src/bootstrap/lib.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index a2ca6e5ce7c..9336f958cf2 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -112,6 +112,7 @@ use std::path::{Path, PathBuf};
 use std::process::Command;
 use std::str;
 
+use config::Target;
 use filetime::FileTime;
 use once_cell::sync::OnceCell;
 
@@ -839,12 +840,13 @@ impl Build {
     ///
     /// If no custom `llvm-config` was specified then Rust's llvm will be used.
     fn is_rust_llvm(&self, target: TargetSelection) -> bool {
-        if self.config.llvm_from_ci && target == self.config.build {
-            return true;
-        }
-
         match self.config.target_config.get(&target) {
-            Some(ref c) => c.llvm_config.is_none(),
+            Some(Target { llvm_has_rust_patches: Some(patched), .. }) => *patched,
+            Some(Target { llvm_config, .. }) => {
+                // If the user set llvm-config we assume Rust is not patched,
+                // but first check to see if it was configured by llvm-from-ci.
+                (self.config.llvm_from_ci && target == self.config.build) || llvm_config.is_none()
+            }
             None => true,
         }
     }