Skip to content

Commit 0e8c7ea

Browse files
committed
Fix linking to zlib when cross-compiling
1 parent 2bc2838 commit 0e8c7ea

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/rustc_llvm/build.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,8 @@ fn main() {
235235
// of llvm-config, not the target that we're attempting to link.
236236
let mut cmd = Command::new(&llvm_config);
237237
cmd.arg(llvm_link_arg).arg("--libs");
238-
239-
if !is_crossed {
240-
cmd.arg("--system-libs");
241-
}
238+
cmd.arg("--system-libs");
239+
cmd.args(&components);
242240

243241
if (target.starts_with("arm") && !target.contains("freebsd"))
244242
|| target.starts_with("mips-")
@@ -253,7 +251,6 @@ fn main() {
253251
} else if target.contains("netbsd") || target.contains("haiku") || target.contains("darwin") {
254252
println!("cargo:rustc-link-lib=z");
255253
}
256-
cmd.args(&components);
257254

258255
for lib in output(&mut cmd).split_whitespace() {
259256
let name = if let Some(stripped) = lib.strip_prefix("-l") {

0 commit comments

Comments
 (0)