Skip to content

Commit

Permalink
Haiku: always link to the system libz.so.
Browse files Browse the repository at this point in the history
When rustc and cargo are built for Haiku, they are cross-compiled from Linux.
The current logic of the build script decides to build from source when
cross-compiling. On Haiku, this is unnecessary. We can safely assume that
libz.so is on the target system. Therefore, like with Android, we can always
link to it.
  • Loading branch information
nielx authored and joshtriplett committed Apr 25, 2021
1 parent 6e34ca2 commit 888fbb6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ fn main() {
}

// All android compilers should come with libz by default, so let's just use
// the one already there.
if target.contains("android") {
// the one already there. Likewise, Haiku always ships with libz, so we can
// link to it even when cross-compiling.
if target.contains("android") || target.contains("haiku") {
println!("cargo:rustc-link-lib=z");
return;
}
Expand Down

0 comments on commit 888fbb6

Please sign in to comment.