Skip to content

Commit 6ef7813

Browse files
author
Alex Zepeda
committed
rustc_llvm: Link zlib on cross Solaris builds
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.
1 parent 14dd4e9 commit 6ef7813

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_llvm/build.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ fn main() {
251251
} else if target.contains("windows-gnu") {
252252
println!("cargo:rustc-link-lib=shell32");
253253
println!("cargo:rustc-link-lib=uuid");
254-
} else if target.contains("haiku") || target.contains("darwin") || target.contains("dragonfly")
254+
} else if target.contains("haiku")
255+
|| target.contains("darwin")
256+
|| (is_crossed && (target.contains("dragonfly") || target.contains("solaris")))
255257
{
256258
println!("cargo:rustc-link-lib=z");
257259
} else if target.contains("netbsd") {

0 commit comments

Comments
 (0)