Skip to content

Commit

Permalink
gcc: gcc_13 → gcc_14 (#340612)
Browse files Browse the repository at this point in the history
@emilazy is co-responsible for choosing the merge this.
  • Loading branch information
philiptaron authored Sep 12, 2024
2 parents 05e5a56 + 1bd5351 commit 572baa7
Show file tree
Hide file tree
Showing 45 changed files with 212 additions and 15 deletions.
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Users on old macOS versions should consider upgrading to a supported version (potentially using [OpenCore Legacy Patcher](https://dortania.github.io/OpenCore-Legacy-Patcher/) for old hardware) or installing NixOS.
If neither of those options are viable and you require new versions of software, [MacPorts](https://www.macports.org/) supports back to Mac OS X Snow Leopard 10.6.

- GCC now defaults to major version 14 from previous 13. ([GCC Porting Guide](https://gcc.gnu.org/gcc-14/porting_to.html))

- Convenience options for `amdgpu`, open source driver for Radeon cards, is now available under `hardware.amdgpu`.

- [AMDVLK](https://github.com/GPUOpen-Drivers/AMDVLK), AMD's open source Vulkan driver, is now available to be configured as `hardware.amdgpu.amdvlk` option.
Expand Down
5 changes: 4 additions & 1 deletion pkgs/applications/audio/mbrola/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ let
# required for cross compilation
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};

installPhase = ''
runHook preInstall
install -D Bin/mbrola $out/bin/mbrola
Expand All @@ -49,4 +53,3 @@ in
ln -s '${mbrola-voices}/data' "$out/share/mbrola/voices"
ln -s '${bin}/bin' "$out/"
''

6 changes: 5 additions & 1 deletion pkgs/applications/graphics/gimp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ in stdenv.mkDerivation (finalAttrs: {
doCheck = true;

env = {
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DGDK_OSX_BIG_SUR=16";
NIX_CFLAGS_COMPILE = toString (
[ ]
++ lib.optionals stdenv.cc.isGNU [ "-Wno-error=incompatible-pointer-types" ]
++ lib.optionals stdenv.isDarwin [ "-DGDK_OSX_BIG_SUR=16" ]
);

# Check if librsvg was built with --disable-pixbuf-loader.
PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}";
Expand Down
4 changes: 4 additions & 0 deletions pkgs/applications/networking/browsers/lynx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ stdenv.mkDerivation rec {
nuke-refs cfg_defs.h
'';

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};

meta = with lib; {
description = "Text-mode web browser";
homepage = "https://lynx.invisible-island.net/";
Expand Down
1 change: 1 addition & 0 deletions pkgs/applications/video/obs-studio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ stdenv.mkDerivation (finalAttrs: {

env.NIX_CFLAGS_COMPILE = toString [
"-Wno-error=sign-compare" # https://github.com/obsproject/obs-studio/issues/10200
"-Wno-error=stringop-overflow="
];

dontWrapGApps = true;
Expand Down
4 changes: 4 additions & 0 deletions pkgs/by-name/gn/gnome-font-viewer/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ stdenv.mkDerivation rec {
# Do not run meson-postinstall.sh
preConfigure = "sed -i '2,$ d' meson-postinstall.sh";

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};

passthru = {
updateScript = gnome.updateScript {
packageName = "gnome-font-viewer";
Expand Down
4 changes: 4 additions & 0 deletions pkgs/by-name/sd/SDL_image/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ stdenv.mkDerivation (finalAttrs: {
libwebp
];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};

outputs = [
"out"
"dev"
Expand Down
8 changes: 8 additions & 0 deletions pkgs/by-name/se/seahorse/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ stdenv.mkDerivation rec {
patchShebangs build-aux/gpg_check_version.py
'';

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = toString [
"-Wno-error=implicit-function-declaration"
"-Wno-error=int-conversion"
"-Wno-error=return-mismatch"
];
};

preCheck = ''
# Add “org.gnome.crypto.pgp” GSettings schema to path
# to make it available for “gpgme-backend” test.
Expand Down
2 changes: 2 additions & 0 deletions pkgs/by-name/vl/vlc/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ stdenv.mkDerivation (finalAttrs: {
# set the path to the compiler
BUILDCC = "${pkgsBuildBuild.stdenv.cc}/bin/gcc";
PKG_CONFIG_WAYLAND_SCANNER_WAYLAND_SCANNER = "wayland-scanner";
} // lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
} // lib.optionalAttrs (!stdenv.hostPlatform.isAarch) {
LIVE555_PREFIX = live555;
};
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/compilers/colm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ makeWrapper asciidoc autoreconfHook ];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=int-conversion";
};

doCheck = true;

postInstall = ''
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/compilers/mcpp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ stdenv.mkDerivation (finalAttrs: {
hash= "sha256-T4feegblOeG+NU+c+PAobf8HT8KDSfcINkRAa1hNpkY=";
};

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};

patches = [
./readlink.patch
];
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/aalib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ stdenv.mkDerivation rec {

configureFlags = [ "--without-x" "--with-ncurses=${ncurses.dev}" ];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};

postInstall = ''
mkdir -p $dev/bin
mv $bin/bin/aalib-config $dev/bin/aalib-config
Expand Down
8 changes: 8 additions & 0 deletions pkgs/development/libraries/accountsservice/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ stdenv.mkDerivation rec {
libxcrypt
];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = toString [
"-Wno-error=deprecated-declarations"
"-Wno-error=implicit-function-declaration"
"-Wno-error=return-mismatch"
];
};

mesonFlags = [
"-Dadmin_group=wheel"
"-Dlocalstatedir=/var"
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/chmlib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ autoreconfHook ];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};

meta = with lib; {
homepage = "http://www.jedrea.com/chmlib";
license = licenses.lgpl2;
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/cyrus-sasl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ stdenv.mkDerivation rec {
"CFLAGS=-DTIME_WITH_SYS_TIME"
];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};

installFlags = lib.optionals stdenv.isDarwin [ "framedir=$(out)/Library/Frameworks/SASL2.framework" ];

passthru.tests = {
Expand Down
6 changes: 5 additions & 1 deletion pkgs/development/libraries/directfb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ stdenv.mkDerivation rec {
libXrender
]);

NIX_LDFLAGS = "-lgcc_s";
env = {
NIX_LDFLAGS = "-lgcc_s";
} // lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-fpermissive";
};

configureFlags = [
"--enable-sdl"
Expand Down
7 changes: 7 additions & 0 deletions pkgs/development/libraries/ffmpeg/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,13 @@ stdenv.mkDerivation (finalAttrs: {
buildFlags = [ "all" ]
++ optional buildQtFaststart "tools/qt-faststart"; # Build qt-faststart executable

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = toString [
"-Wno-error=incompatible-pointer-types"
"-Wno-error=int-conversion"
];
};

doCheck = stdenv.hostPlatform == stdenv.buildPlatform;

# Fails with SIGABRT otherwise FIXME: Why?
Expand Down
7 changes: 7 additions & 0 deletions pkgs/development/libraries/gtk/2.x.nix
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ stdenv.mkDerivation (finalAttrs: {
"ac_cv_path_GDK_PIXBUF_CSOURCE=${buildPackages.gdk-pixbuf.dev}/bin/gdk-pixbuf-csource"
];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = toString [
"-Wno-error=implicit-int"
"-Wno-error=incompatible-pointer-types"
];
};

enableParallelBuilding = true;

installFlags = [
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/gtksourceview/3.x.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ stdenv.mkDerivation (finalAttrs: {

patches = [ ./3.x-nix_share_path.patch ];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};

enableParallelBuilding = true;

doCheck = stdenv.isLinux;
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/lcms/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ stdenv.mkDerivation rec {

patches = [ ./cve-2013-4276.patch ];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};

outputs = [ "bin" "dev" "out" "man" ];

doCheck = false; # fails with "Error in Linear interpolation (2p): Must be i=8000, But is n=8001"
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/libcddb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ stdenv.mkDerivation rec {
"ac_cv_func_realloc_0_nonnull=yes"
];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};

doCheck = false; # fails 3 of 5 tests with locale errors

meta = with lib; {
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/libcdio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};

doCheck = !stdenv.isDarwin;

meta = with lib; {
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/libraries/libgee/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ stdenv.mkDerivation (finalAttrs: {
env = {
PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "dev"}/share/gir-1.0";
PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "${placeholder "out"}/lib/girepository-1.0";
} // lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};

passthru = {
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/libgphoto2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ stdenv.mkDerivation rec {
# These are mentioned in the Requires line of libgphoto's pkg-config file.
propagatedBuildInputs = [ libexif ];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};

hardeningDisable = [ "format" ];

postInstall =
Expand Down
7 changes: 7 additions & 0 deletions pkgs/development/libraries/libgpod/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ stdenv.mkDerivation rec {
libimobiledevice
];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = toString [
"-Wno-error=implicit-int"
"-Wno-error=incompatible-pointer-types"
];
};

meta = with lib; {
homepage = "https://sourceforge.net/projects/gtkpod/";
description = "Library used by gtkpod to access the contents of an ipod";
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/libx86/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ stdenv.mkDerivation rec {
sed -e s@/usr@@ -i Makefile
'';

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};

meta = with lib; {
description = "Real-mode x86 code emulator";
maintainers = with maintainers; [ raskin ];
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/mbedtls/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ stdenv.mkDerivation rec {
"-DGEN_FILES=off"
];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=calloc-transposed-args";
};

doCheck = true;

# Parallel checking causes test failures
Expand Down
19 changes: 11 additions & 8 deletions pkgs/development/libraries/polkit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ stdenv.mkDerivation rec {
env = {
PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system";
PKG_CONFIG_SYSTEMD_SYSUSERS_DIR = "${placeholder "out"}/lib/sysusers.d";

# HACK: We want to install policy files files to $out/share but polkit
# should read them from /run/current-system/sw/share on a NixOS system.
# Similarly for config files in /etc.
# With autotools, it was possible to override Make variables
# at install time but Meson does not support this
# so we need to convince it to install all files to a temporary
# location using DESTDIR and then move it to proper one in postInstall.
DESTDIR = "dest";
} // lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};

mesonFlags = [
Expand All @@ -131,14 +142,6 @@ stdenv.mkDerivation rec {
"-Dsession_tracking=${if useSystemd then "libsystemd-login" else "libelogind"}"
];

# HACK: We want to install policy files files to $out/share but polkit
# should read them from /run/current-system/sw/share on a NixOS system.
# Similarly for config files in /etc.
# With autotools, it was possible to override Make variables
# at install time but Meson does not support this
# so we need to convince it to install all files to a temporary
# location using DESTDIR and then move it to proper one in postInstall.
env.DESTDIR = "dest";

inherit doCheck;

Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/range-v3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ stdenv.mkDerivation rec {
doCheck = !stdenv.isAarch64;
checkTarget = "test";

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-std=c++17";
};

meta = with lib; {
description = "Experimental range library for C++11/14/17";
homepage = "https://github.com/ericniebler/range-v3";
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/unixODBCDrivers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@

buildFlags = if stdenv.isDarwin then [ "maodbc" ] else null;

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};

installTargets = if stdenv.isDarwin then [ "install/fast" ] else null;

# see the top of the file for an explanation
Expand Down
7 changes: 7 additions & 0 deletions pkgs/development/libraries/volume-key/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ stdenv.mkDerivation rec {
"pythondir=$(py)/${python3.sitePackages}"
];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = toString [
"-Wno-error=implicit-function-declaration"
"-Wno-error=int-conversion"
];
};

doCheck = false; # fails 1 out of 1 tests, needs `certutil`

meta = with lib; {
Expand Down
7 changes: 5 additions & 2 deletions pkgs/development/libraries/vulkan-headers/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{ lib, stdenv, fetchFromGitHub, cmake }:
{ lib, stdenv, fetchFromGitHub, cmake, ninja }:
stdenv.mkDerivation rec {
pname = "vulkan-headers";
version = "1.3.290.0";

nativeBuildInputs = [ cmake ];
# Adding `ninja` here to enable Ninja backend. Otherwise on gcc-14 or
# later the build fails as:
# modules are not supported by this generator: Unix Makefiles
nativeBuildInputs = [ cmake ninja ];

# TODO: investigate why <algorithm> isn't found
cmakeFlags = lib.optionals stdenv.isDarwin [ "-DVULKAN_HEADERS_ENABLE_MODULE=OFF" ];
Expand Down
Loading

0 comments on commit 572baa7

Please sign in to comment.