Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pkgs/development/libraries/glibc/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ stdenv.mkDerivation ({
++ lib.optional stdenv.buildPlatform.isDarwin ./darwin-cross-build.patch

# Remove after upgrading to glibc 2.28+
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) (fetchpatch {
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform || stdenv.hostPlatform.isMusl) (fetchpatch {
url = "https://sourceware.org/git/?p=glibc.git;a=patch;h=780684eb04298977bc411ebca1eadeeba4877833";
name = "correct-pwent-parsing-issue-and-resulting-build.patch";
sha256 = "08fja894vzaj8phwfhsfik6jj2pbji7kypy3q8pgxvsd508zdv1q";
Expand Down
16 changes: 15 additions & 1 deletion pkgs/development/libraries/glibc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,21 @@ callPackage ./common.nix { inherit stdenv; } {
# limit rebuilds by only disabling pie w/musl
++ stdenv.lib.optional stdenv.hostPlatform.isMusl "pie";

NIX_CFLAGS_COMPILE = if withGd then "-Wno-error=stringop-truncation" else null;
NIX_CFLAGS_COMPILE =
if !stdenv.hostPlatform.isMusl
# TODO: This (returning a string or `null`, instead of a list) is to
# not trigger a mass rebuild due to the introduction of the
# musl-specific flags below.
# At next change to non-musl glibc builds, remove this `then`
# and the above condition, instead keeping only the `else` below.
then (if withGd then "-Wno-error=stringop-truncation" else null)
else
builtins.concatLists [
(stdenv.lib.optional withGd "-Wno-error=stringop-truncation")
# Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
# https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
(stdenv.lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
];

# When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
# any program we run, because the gcc will have been placed at a new
Expand Down