Skip to content

Commit 0b55b50

Browse files
authored
Unrolled build for #141817
Rollup merge of #141817 - mati865:fix-system-libs-when-cross-compiling, r=cuviper rustc_llvm: add Windows system libs only when cross-compiling from Wi… …ndows This obviously doesn't work when cross-compiling from Linux. Split out from: #140772 Fixes the issue described at [#general > Problems while trying to cross compile rustc for windows](https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/Problems.20while.20trying.20to.20cross.20compile.20rustc.20for.20windows/with/520508561)
2 parents c68032f + 81f61ac commit 0b55b50

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)