Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zlib: link with --undefined-version on lld #307540

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions pkgs/development/libraries/zlib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,16 @@ stdenv.mkDerivation (finalAttrs: {
ln -s zlib1.dll $out/bin/libz.dll
'';

# As zlib takes part in the stdenv building, we don't want references
# to the bootstrap-tools libgcc (as uses to happen on arm/mips)
env.NIX_CFLAGS_COMPILE = lib.optionalString (!stdenv.hostPlatform.isDarwin) "-static-libgcc";
env = lib.optionalAttrs (!stdenv.hostPlatform.isDarwin) {
# As zlib takes part in the stdenv building, we don't want references
# to the bootstrap-tools libgcc (as uses to happen on arm/mips)
NIX_CFLAGS_COMPILE = "-static-libgcc";
} // lib.optionalAttrs (stdenv.hostPlatform.linker == "lld") {
# lld 16 enables --no-undefined-version by defualt
# This makes configure think it can't build dynamic libraries
# this may be removed when a version is packaged with https://github.com/madler/zlib/issues/960 fixed
NIX_LDFLAGS = "--undefined-version";
rhelmot marked this conversation as resolved.
Show resolved Hide resolved
};

# We don't strip on static cross-compilation because of reports that native
# stripping corrupted the target library; see commit 12e960f5 for the report.
Expand Down