about summary refs log tree commit diff
path: root/compiler/rustc_llvm/build.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-06 08:39:09 +0000
committerbors <bors@rust-lang.org>2024-04-06 08:39:09 +0000
commit3f10032eb04a58d6d54caef0318f705042ca0ba1 (patch)
treebb38c2a55c6cfbb911da2bfd82eb45c81749db86 /compiler/rustc_llvm/build.rs
parent8d490e33ad7bbcdeab7975be787653b1e46e48e4 (diff)
parent58ac1b4244848103f3ef05360073d7b5c65f6fb9 (diff)
downloadrust-3f10032eb04a58d6d54caef0318f705042ca0ba1.tar.gz
rust-3f10032eb04a58d6d54caef0318f705042ca0ba1.zip
Auto merge of #123540 - matthiaskrgr:rollup-8ewq0zt, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #123294 (Require LLVM_CONFIG to be set in rustc_llvm/build.rs)
 - #123467 (MSVC targets should use COFF as their archive format)
 - #123498 (explaining `DefKind::Field`)
 - #123519 (Improve cfg and check-cfg configuration)
 - #123525 (CFI: Don't rewrite ty::Dynamic directly)
 - #123526 (Do not ICE when calling incorrectly defined `transmute` intrinsic)
 - #123528 (Hide async_gen_internals from standard library documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_llvm/build.rs')
-rw-r--r--compiler/rustc_llvm/build.rs22
1 files changed, 2 insertions, 20 deletions
diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
index e2c0ec90c7c..66ca94d1d9c 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
@@ -112,28 +112,10 @@ fn main() {
 
     restore_library_path();
 
-    let target = env::var("TARGET").expect("TARGET was not set");
     let llvm_config =
-        tracked_env_var_os("LLVM_CONFIG").map(|x| Some(PathBuf::from(x))).unwrap_or_else(|| {
-            if let Some(dir) = tracked_env_var_os("CARGO_TARGET_DIR").map(PathBuf::from) {
-                let to_test = dir
-                    .parent()
-                    .unwrap()
-                    .parent()
-                    .unwrap()
-                    .join(&target)
-                    .join("llvm/bin/llvm-config");
-                if Command::new(&to_test).output().is_ok() {
-                    return Some(to_test);
-                }
-            }
-            None
-        });
+        PathBuf::from(tracked_env_var_os("LLVM_CONFIG").expect("LLVM_CONFIG was not set"));
 
-    if let Some(llvm_config) = &llvm_config {
-        println!("cargo:rerun-if-changed={}", llvm_config.display());
-    }
-    let llvm_config = llvm_config.unwrap_or_else(|| PathBuf::from("llvm-config"));
+    println!("cargo:rerun-if-changed={}", llvm_config.display());
 
     // Test whether we're cross-compiling LLVM. This is a pretty rare case
     // currently where we're producing an LLVM for a different platform than