Skip to content

Commit 81f61ac

Browse files
committed
rustc_llvm: add Windows system libs only when cross-compiling from Windows
This obviously doesn't work when cross-compiling from Linux. Split out from: #140772
1 parent e0d014a commit 81f61ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_llvm/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ fn main() {
228228
let mut cmd = Command::new(&llvm_config);
229229
cmd.arg(llvm_link_arg).arg("--libs");
230230

231-
// Don't link system libs if cross-compiling unless targeting Windows.
231+
// Don't link system libs if cross-compiling unless targeting Windows from Windows host.
232232
// On Windows system DLLs aren't linked directly, instead import libraries are used.
233233
// These import libraries are independent of the host.
234-
if !is_crossed || target.contains("windows") {
234+
if !is_crossed || target.contains("windows") && host.contains("windows") {
235235
cmd.arg("--system-libs");
236236
}
237237

0 commit comments

Comments
 (0)