From 281c0c16c9c6e2e44e78334f55bbd43dc51c0d70 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 26 Apr 2025 06:18:42 +0100 Subject: [PATCH] gcc15, gccgo15, gfortran15, gnat15: init at 15.1.0 Changes: https://gcc.gnu.org/gcc-15/changes.html Porting guide: https://gcc.gnu.org/gcc-15/porting_to.html --- pkgs/by-name/gf/gfortran15/package.nix | 10 +++++ pkgs/development/compilers/gcc/versions.nix | 2 + pkgs/top-level/all-packages.nix | 48 ++++++++++++++++++++- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/gf/gfortran15/package.nix diff --git a/pkgs/by-name/gf/gfortran15/package.nix b/pkgs/by-name/gf/gfortran15/package.nix new file mode 100644 index 000000000000..45b1581e0f9a --- /dev/null +++ b/pkgs/by-name/gf/gfortran15/package.nix @@ -0,0 +1,10 @@ +{ wrapCC, gcc15 }: +wrapCC ( + gcc15.cc.override { + name = "gfortran"; + langFortran = true; + langCC = false; + langC = false; + profiledCompiler = false; + } +) diff --git a/pkgs/development/compilers/gcc/versions.nix b/pkgs/development/compilers/gcc/versions.nix index aff229a2df7f..3f9debb2d742 100644 --- a/pkgs/development/compilers/gcc/versions.nix +++ b/pkgs/development/compilers/gcc/versions.nix @@ -1,5 +1,6 @@ let majorMinorToVersionMap = { + "15" = "15.1.0"; "14" = "14.2.1.20250322"; "13" = "13.3.0"; "12" = "12.4.0"; @@ -16,6 +17,7 @@ let { # 3 digits: releases (14.2.0) # 4 digits: snapshots (14.2.1.20250322) + "15.1.0" = "sha256-4rCewhZg8B/s/7cV4BICZSFpQ/A40OSKmGhxPlTwbOo="; "14.2.1.20250322" = "sha256-I3ROhiU4jYaB2aci2Z3B/mvLLTjBBoCF1CL7uiHTmUM="; "13.3.0" = "sha256-CEXpYhyVQ6E/SE6UWEpJ/8ASmXDpkUYkI1/B0GGgwIM="; "12.4.0" = "sha256-cE9lJgTMvMsUvavzR4yVEciXiLEss7v/3tNzQZFqkXU="; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4dab2faedb7d..372b4e573d7a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5967,6 +5967,7 @@ with pkgs; gcc12Stdenv = overrideCC gccStdenv buildPackages.gcc12; gcc13Stdenv = overrideCC gccStdenv buildPackages.gcc13; gcc14Stdenv = overrideCC gccStdenv buildPackages.gcc14; + gcc15Stdenv = overrideCC gccStdenv buildPackages.gcc15; # This is not intended for use in nixpkgs but for providing a faster-running # compiler to nixpkgs users by building gcc with reproducibility-breaking @@ -6071,9 +6072,10 @@ with pkgs; gcc12 gcc13 gcc14 + gcc15 ; - gcc_latest = gcc14; + gcc_latest = gcc15; libgccjit = gcc.cc.override { name = "libgccjit"; @@ -6199,6 +6201,34 @@ with pkgs; } ); + gnat15 = wrapCC ( + gcc15.cc.override { + name = "gnat"; + langC = true; + langCC = false; + langAda = true; + profiledCompiler = false; + # As per upstream instructions building a cross compiler + # should be done with a (native) compiler of the same version. + # If we are cross-compiling GNAT, we may as well do the same. + gnat-bootstrap = + if stdenv.hostPlatform == stdenv.targetPlatform && stdenv.buildPlatform == stdenv.hostPlatform then + buildPackages.gnat-bootstrap14 + else + buildPackages.gnat15; + stdenv = + if + stdenv.hostPlatform == stdenv.targetPlatform + && stdenv.buildPlatform == stdenv.hostPlatform + && stdenv.buildPlatform.isDarwin + && stdenv.buildPlatform.isx86_64 + then + overrideCC stdenv gnat-bootstrap14 + else + stdenv; + } + ); + gnat-bootstrap = gnat-bootstrap12; gnat-bootstrap11 = wrapCC ( callPackage ../development/compilers/gnat-bootstrap { majorVersion = "11"; } @@ -6231,6 +6261,7 @@ with pkgs; gnat12Packages = recurseIntoAttrs (callPackage ./ada-packages.nix { gnat = buildPackages.gnat12; }); gnat13Packages = recurseIntoAttrs (callPackage ./ada-packages.nix { gnat = buildPackages.gnat13; }); gnat14Packages = recurseIntoAttrs (callPackage ./ada-packages.nix { gnat = buildPackages.gnat14; }); + gnat15Packages = recurseIntoAttrs (callPackage ./ada-packages.nix { gnat = buildPackages.gnat15; }); gnatPackages = gnat13Packages; inherit (gnatPackages) @@ -6298,6 +6329,21 @@ with pkgs; } ); + gccgo15 = wrapCC ( + gcc15.cc.override { + name = "gccgo"; + langCC = true; # required for go. + langC = true; + langGo = true; + langJit = true; + profiledCompiler = false; + } + // { + # not supported on darwin: https://github.com/golang/go/issues/463 + meta.broken = stdenv.hostPlatform.isDarwin; + } + ); + ghdl-mcode = callPackage ../by-name/gh/ghdl/package.nix { backend = "mcode"; }; ghdl-gcc = callPackage ../by-name/gh/ghdl/package.nix { backend = "gcc"; };