summaryrefslogblamecommitdiff
path: root/bootstrap/rust-1.68/0002-Fix-linking-to-zlib-when-cross-compiling.patch
blob: a293b3ee842989b3edb22d54bedd42d6acf0d0a7 (plain) (tree)

































                                                                                                   
From 0e8c7ea4fb9fa362dd7d67e68d8d2cec9d448975 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Wed, 10 Jan 2018 13:36:41 -0600
Subject: [PATCH 02/13] Fix linking to zlib when cross-compiling

---
 compiler/rustc_llvm/build.rs | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
index 0b3c057345a67..4b3367bcfd75a 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
@@ -235,10 +235,8 @@ fn main() {
     // of llvm-config, not the target that we're attempting to link.
     let mut cmd = Command::new(&llvm_config);
     cmd.arg(llvm_link_arg).arg("--libs");
-
-    if !is_crossed {
-        cmd.arg("--system-libs");
-    }
+    cmd.arg("--system-libs");
+    cmd.args(&components);
 
     if (target.starts_with("arm") && !target.contains("freebsd"))
         || target.starts_with("mips-")
@@ -253,7 +251,6 @@ fn main() {
     } else if target.contains("netbsd") || target.contains("haiku") || target.contains("darwin") {
         println!("cargo:rustc-link-lib=z");
     }
-    cmd.args(&components);
 
     for lib in output(&mut cmd).split_whitespace() {
         let name = if let Some(stripped) = lib.strip_prefix("-l") {