···10 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.
11 If neither of those options are viable and you require new versions of software, [MacPorts](https://www.macports.org/) supports versions back to Mac OS X Snow Leopard 10.6.
1200013<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
1415## New Modules {#sec-release-25.05-new-modules}
···10 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.
11 If neither of those options are viable and you require new versions of software, [MacPorts](https://www.macports.org/) supports versions back to Mac OS X Snow Leopard 10.6.
1213+- GCC has been updated from GCC 13 to GCC 14.
14+ This introduces some backwards‐incompatible changes; see the [upstream porting guide](https://gcc.gnu.org/gcc-14/porting_to.html) for details.
15+16<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
1718## New Modules {#sec-release-25.05-new-modules}
+30-1
pkgs/development/compilers/gcc/default.nix
···184 inherit version;
185186 src = fetchurl {
187- url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz";
000000188 ${if is10 || is11 || is13 then "hash" else "sha256"} =
189 gccVersions.srcHashForVersion version;
190 };
···205 for configureScript in $configureScripts; do
206 patchShebangs $configureScript
207 done
00000000000000000000000208 ''
209 # This should kill all the stdinc frameworks that gcc and friends like to
210 # insert into default search paths.
···184 inherit version;
185186 src = fetchurl {
187+ url = "mirror://gcc/${
188+ # TODO: Remove this before 25.05.
189+ if version == "14-20241116" then
190+ "snapshots/"
191+ else
192+ "releases/gcc-"
193+ }${version}/gcc-${version}.tar.xz";
194 ${if is10 || is11 || is13 then "hash" else "sha256"} =
195 gccVersions.srcHashForVersion version;
196 };
···211 for configureScript in $configureScripts; do
212 patchShebangs $configureScript
213 done
214+ ''
215+ # Copy the precompiled `gcc/gengtype-lex.cc` from the 14.2.0 tarball.
216+ # Since the `gcc/gengtype-lex.l` file didn’t change between 14.2.0
217+ # and 14-2024116, this is safe. If it changes and we update the
218+ # snapshot, we might need to vendor the compiled output in Nixpkgs.
219+ #
220+ # TODO: Remove this before 25.05.
221+ + optionalString (version == "14-20241116") ''
222+ cksum -c <<EOF
223+ SHA256 (gcc/gengtype-lex.l) = 05acceeda02e673eaef47d187d3a68a1632508112fbe31b5dc2b0a898998d7ec
224+ EOF
225+226+ (XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < ${fetchurl {
227+ url = "mirror://gcc/releases/gcc-14.2.0/gcc-14.2.0.tar.xz";
228+ hash = "sha256-p7Obxpy/niWCbFpgqyZHcAH3wI2FzsBLwOKcq+1vPMk=";
229+ }}; true) | tar xf - \
230+ --mode=+w \
231+ --warning=no-timestamp \
232+ --strip-components=1 \
233+ gcc-14.2.0/gcc/gengtype-lex.cc
234+235+ # Make sure Make knows it’s up‐to‐date.
236+ touch gcc/gengtype-lex.cc
237 ''
238 # This should kill all the stdinc frameworks that gcc and friends like to
239 # insert into default search paths.
···138# We only apply this patch when building a native toolchain for aarch64-darwin, as it breaks building
139# a foreign one: https://github.com/iains/gcc-12-branch/issues/18
140++ optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 && buildPlatform == hostPlatform && hostPlatform == targetPlatform) ({
141- "14" = [ (fetchpatch {
142- # There are no upstream release tags in https://github.com/iains/gcc-14-branch.
143- # 04696df09633baf97cdbbdd6e9929b9d472161d3 is the commit from https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-14.2.0
144- name = "gcc-14-darwin-aarch64-support.patch";
145- url = "https://github.com/iains/gcc-14-branch/compare/04696df09633baf97cdbbdd6e9929b9d472161d3..gcc-14.2-darwin-r0.diff";
146- hash = "sha256-GEUz7KdGzd2WJ0gjX3Uddq2y9bWKdZpT3E9uZ09qLs4=";
147- }) ];
0000000000148 "13" = [ (fetchpatch {
149 name = "gcc-13-darwin-aarch64-support.patch";
150 url = "https://raw.githubusercontent.com/Homebrew/formula-patches/bda0faddfbfb392e7b9c9101056b2c5ab2500508/gcc/gcc-13.3.0.diff";
···138# We only apply this patch when building a native toolchain for aarch64-darwin, as it breaks building
139# a foreign one: https://github.com/iains/gcc-12-branch/issues/18
140++ optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 && buildPlatform == hostPlatform && hostPlatform == targetPlatform) ({
141+ "14" = [
142+ (fetchpatch {
143+ name = "gcc-14-darwin-aarch64-support.patch";
144+ url = "https://raw.githubusercontent.com/Homebrew/formula-patches/41fdb9d5ec21fc8165cd4bee89bd23d0c90572ee/gcc/gcc-14.2.0-r2.diff";
145+ # The patch is based on 14.2.0, but we use a GCC snapshot. We
146+ # exclude the files with conflicts and apply our own merged patch
147+ # to avoid vendoring the entire huge patch in‐tree.
148+ excludes = [
149+ "gcc/config/aarch64/aarch64-tune.md"
150+ "gcc/config/darwin.h"
151+ "libgcc/config.host"
152+ "libgcc/config/t-darwin-min-11"
153+ ];
154+ hash = "sha256-E4zEKm4tMhovOJKc1/FXZCLQvA+Jt5SC0O2C6SEvZjI=";
155+ })
156+ ./14/fixup-gcc-14-darwin-aarch64-support.patch
157+ ];
158 "13" = [ (fetchpatch {
159 name = "gcc-13-darwin-aarch64-support.patch";
160 url = "https://raw.githubusercontent.com/Homebrew/formula-patches/bda0faddfbfb392e7b9c9101056b2c5ab2500508/gcc/gcc-13.3.0.diff";