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: https://github.com/rust-lang/rust/pull/140772
This commit is contained in:
parent
e0d014a3df
commit
81f61acf77
1 changed files with 2 additions and 2 deletions
|
|
@ -228,10 +228,10 @@ fn main() {
|
|||
let mut cmd = Command::new(&llvm_config);
|
||||
cmd.arg(llvm_link_arg).arg("--libs");
|
||||
|
||||
// Don't link system libs if cross-compiling unless targeting Windows.
|
||||
// Don't link system libs if cross-compiling unless targeting Windows from Windows host.
|
||||
// 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") {
|
||||
if !is_crossed || target.contains("windows") && host.contains("windows") {
|
||||
cmd.arg("--system-libs");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue