about summary refs log tree commit diff
path: root/compiler/rustc_llvm/build.rs
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2024-09-15 11:02:41 +0000
committerChris Denton <chris@chrisdenton.dev>2024-09-15 12:38:55 +0000
commit7223fd80859fd7987e5b41c1c3fba20d09cfab48 (patch)
tree78ac3f3ada11b408b4ec653f46db35dd64b78360 /compiler/rustc_llvm/build.rs
parent1ae268816ca3f5f314ccbfd04affd61cb081e13f (diff)
downloadrust-7223fd80859fd7987e5b41c1c3fba20d09cfab48.tar.gz
rust-7223fd80859fd7987e5b41c1c3fba20d09cfab48.zip
Add system libs when cross compiling for Windows
Diffstat (limited to 'compiler/rustc_llvm/build.rs')
-rw-r--r--compiler/rustc_llvm/build.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
index b2ff9efb41c..f092110a324 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
@@ -220,7 +220,10 @@ fn main() {
     let mut cmd = Command::new(&llvm_config);
     cmd.arg(llvm_link_arg).arg("--libs");
 
-    if !is_crossed {
+    // Don't link system libs if cross-compiling unless targetting Windows.
+    // On Windows system DLLs aren't linked directly, instead import libraries are used.
+    // These import libraries are independent of the host.
+    if !is_crossed || target.contains("windows") {
         cmd.arg("--system-libs");
     }