Skip to content

Commit 7caf6aa

Browse files
committed
Add system libs when cross compiling for Windows
1 parent e528d5d commit 7caf6aa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_llvm/build.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ fn main() {
220220
let mut cmd = Command::new(&llvm_config);
221221
cmd.arg(llvm_link_arg).arg("--libs");
222222

223-
if !is_crossed {
223+
// Don't link system libs if cross-compiling unless on Windows.
224+
// On Windows system DLLs aren't linked directly, instead import libraries are used.
225+
// These import libraries are independent of the host.
226+
if !is_crossed || target.contains("windows") {
224227
cmd.arg("--system-libs");
225228
}
226229

0 commit comments

Comments
 (0)