diff --git a/pkgs/applications/audio/furnace/default.nix b/pkgs/applications/audio/furnace/default.nix index 3d3b87e3c5dc..f0bb039a79c4 100644 --- a/pkgs/applications/audio/furnace/default.nix +++ b/pkgs/applications/audio/furnace/default.nix @@ -63,8 +63,8 @@ stdenv.mkDerivation rec { "-DWARNINGS_ARE_ERRORS=ON" ]; - NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ - # Needed with GCC 12 but breaks on darwin (with clang) + NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ + # Needed with GCC 12 but breaks on darwin (with clang) or aarch64 (old gcc) "-Wno-error=mismatched-new-delete" "-Wno-error=use-after-free" ]; diff --git a/pkgs/servers/tvheadend/default.nix b/pkgs/servers/tvheadend/default.nix index e9db31f792ff..325632da48ce 100644 --- a/pkgs/servers/tvheadend/default.nix +++ b/pkgs/servers/tvheadend/default.nix @@ -78,7 +78,8 @@ in stdenv.mkDerivation { NIX_CFLAGS_COMPILE = [ "-Wno-error=format-truncation" "-Wno-error=stringop-truncation" - # Needed with GCC 12 + ] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ + # Needed with GCC 12 but unrecognized with GCC 9 "-Wno-error=use-after-free" ];