···1010 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.
1111 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.
12121313+- GCC has been updated from GCC 13 to GCC 14.
1414+ This introduces some backwards‐incompatible changes; see the [upstream porting guide](https://gcc.gnu.org/gcc-14/porting_to.html) for details.
1515+1316<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
14171518## New Modules {#sec-release-25.05-new-modules}
+30-1
pkgs/development/compilers/gcc/default.nix
···184184 inherit version;
185185186186 src = fetchurl {
187187- url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz";
187187+ url = "mirror://gcc/${
188188+ # TODO: Remove this before 25.05.
189189+ if version == "14-20241116" then
190190+ "snapshots/"
191191+ else
192192+ "releases/gcc-"
193193+ }${version}/gcc-${version}.tar.xz";
188194 ${if is10 || is11 || is13 then "hash" else "sha256"} =
189195 gccVersions.srcHashForVersion version;
190196 };
···205211 for configureScript in $configureScripts; do
206212 patchShebangs $configureScript
207213 done
214214+ ''
215215+ # Copy the precompiled `gcc/gengtype-lex.cc` from the 14.2.0 tarball.
216216+ # Since the `gcc/gengtype-lex.l` file didn’t change between 14.2.0
217217+ # and 14-2024116, this is safe. If it changes and we update the
218218+ # snapshot, we might need to vendor the compiled output in Nixpkgs.
219219+ #
220220+ # TODO: Remove this before 25.05.
221221+ + optionalString (version == "14-20241116") ''
222222+ cksum -c <<EOF
223223+ SHA256 (gcc/gengtype-lex.l) = 05acceeda02e673eaef47d187d3a68a1632508112fbe31b5dc2b0a898998d7ec
224224+ EOF
225225+226226+ (XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < ${fetchurl {
227227+ url = "mirror://gcc/releases/gcc-14.2.0/gcc-14.2.0.tar.xz";
228228+ hash = "sha256-p7Obxpy/niWCbFpgqyZHcAH3wI2FzsBLwOKcq+1vPMk=";
229229+ }}; true) | tar xf - \
230230+ --mode=+w \
231231+ --warning=no-timestamp \
232232+ --strip-components=1 \
233233+ gcc-14.2.0/gcc/gengtype-lex.cc
234234+235235+ # Make sure Make knows it’s up‐to‐date.
236236+ touch gcc/gengtype-lex.cc
208237 ''
209238 # This should kill all the stdinc frameworks that gcc and friends like to
210239 # insert into default search paths.
···138138# We only apply this patch when building a native toolchain for aarch64-darwin, as it breaks building
139139# a foreign one: https://github.com/iains/gcc-12-branch/issues/18
140140++ optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 && buildPlatform == hostPlatform && hostPlatform == targetPlatform) ({
141141- "14" = [ (fetchpatch {
142142- # There are no upstream release tags in https://github.com/iains/gcc-14-branch.
143143- # 04696df09633baf97cdbbdd6e9929b9d472161d3 is the commit from https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-14.2.0
144144- name = "gcc-14-darwin-aarch64-support.patch";
145145- url = "https://github.com/iains/gcc-14-branch/compare/04696df09633baf97cdbbdd6e9929b9d472161d3..gcc-14.2-darwin-r0.diff";
146146- hash = "sha256-GEUz7KdGzd2WJ0gjX3Uddq2y9bWKdZpT3E9uZ09qLs4=";
147147- }) ];
141141+ "14" = [
142142+ (fetchpatch {
143143+ name = "gcc-14-darwin-aarch64-support.patch";
144144+ url = "https://raw.githubusercontent.com/Homebrew/formula-patches/41fdb9d5ec21fc8165cd4bee89bd23d0c90572ee/gcc/gcc-14.2.0-r2.diff";
145145+ # The patch is based on 14.2.0, but we use a GCC snapshot. We
146146+ # exclude the files with conflicts and apply our own merged patch
147147+ # to avoid vendoring the entire huge patch in‐tree.
148148+ excludes = [
149149+ "gcc/config/aarch64/aarch64-tune.md"
150150+ "gcc/config/darwin.h"
151151+ "libgcc/config.host"
152152+ "libgcc/config/t-darwin-min-11"
153153+ ];
154154+ hash = "sha256-E4zEKm4tMhovOJKc1/FXZCLQvA+Jt5SC0O2C6SEvZjI=";
155155+ })
156156+ ./14/fixup-gcc-14-darwin-aarch64-support.patch
157157+ ];
148158 "13" = [ (fetchpatch {
149159 name = "gcc-13-darwin-aarch64-support.patch";
150160 url = "https://raw.githubusercontent.com/Homebrew/formula-patches/bda0faddfbfb392e7b9c9101056b2c5ab2500508/gcc/gcc-13.3.0.diff";