Skip to content

Commit 04a1804

Browse files
authored
Rollup merge of rust-lang#114349 - inferiorhumanorgans:dragonfly-link-libz, r=cuviper
rustc_llvm: Link to `zlib` on dragonfly and solaris On native builds `llvm-config` picks up `zlib` and this gets pased into the rust build tools, but on cross builds `llvm-config` is explicitly ignored as it contains information for the host system and cannot be trusted to be accurate for the target system. Both DragonFly and Solaris contain `zlib` in the base system, so this is both a safe assumption and required for a successful cross build unless `zlib` support is disabled in LLVM. This is more or less in the same vein as rust-lang#75713 and rust-lang#75655.
2 parents 35e4163 + 6ef7813 commit 04a1804

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
@@ -252,7 +252,10 @@ fn main() {
252252
} else if target.contains("windows-gnu") {
253253
println!("cargo:rustc-link-lib=shell32");
254254
println!("cargo:rustc-link-lib=uuid");
255-
} else if target.contains("haiku") || target.contains("darwin") {
255+
} else if target.contains("haiku")
256+
|| target.contains("darwin")
257+
|| (is_crossed && (target.contains("dragonfly") || target.contains("solaris")))
258+
{
256259
println!("cargo:rustc-link-lib=z");
257260
} else if target.contains("netbsd") {
258261
println!("cargo:rustc-link-lib=z");

0 commit comments

Comments
 (0)