about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/glibc/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/glibc/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/default.nix26
1 files changed, 12 insertions, 14 deletions
diff --git a/nixpkgs/pkgs/development/libraries/glibc/default.nix b/nixpkgs/pkgs/development/libraries/glibc/default.nix
index 1a17595a1a32..150681ebda18 100644
--- a/nixpkgs/pkgs/development/libraries/glibc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glibc/default.nix
@@ -49,20 +49,18 @@ callPackage ./common.nix { inherit stdenv; } {
       ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "pie";
 
     NIX_CFLAGS_COMPILE = stdenv.lib.concatStringsSep " "
-      (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 (stdenv.lib.optionals withGd gdCflags)
-        else
-          (builtins.concatLists [
-            (stdenv.lib.optionals withGd gdCflags)
-            # 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")
-          ]));
+      (builtins.concatLists [
+        (stdenv.lib.optionals withGd gdCflags)
+        # 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")
+        (stdenv.lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [
+          # Ignore "error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location'"
+          # New warning as of GCC 9
+          # Same for musl: https://github.com/NixOS/nixpkgs/issues/78805
+          "-Wno-error=missing-attributes"
+        ])
+      ]);
 
     # 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