From 151776fbfc90e1e474a1d10af9823f5c1bd7ebdd Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 22 Jul 2024 13:10:42 -0400 Subject: [PATCH 1/2] gcc10: enable build on aarch64-darwin --- pkgs/development/compilers/gcc/default.nix | 2 +- pkgs/development/compilers/gcc/patches/default.nix | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/gcc/default.nix b/pkgs/development/compilers/gcc/default.nix index 5eb92fd701da..9746825b2321 100644 --- a/pkgs/development/compilers/gcc/default.nix +++ b/pkgs/development/compilers/gcc/default.nix @@ -451,7 +451,7 @@ pipe ((callFile ./common/builder.nix {}) ({ if (is8 && targetPlatform.isAvr) then [] else if !(is48 || is49) then [ "aarch64-darwin" ] else platforms.darwin; - } // optionalAttrs is11 { + } // optionalAttrs is10 { badPlatforms = if targetPlatform != hostPlatform then [ "aarch64-darwin" ] else [ ]; }; } // optionalAttrs (!atLeast10 && stdenv.targetPlatform.isDarwin) { diff --git a/pkgs/development/compilers/gcc/patches/default.nix b/pkgs/development/compilers/gcc/patches/default.nix index b7da7eb925ee..f49f560b31ab 100644 --- a/pkgs/development/compilers/gcc/patches/default.nix +++ b/pkgs/development/compilers/gcc/patches/default.nix @@ -165,6 +165,12 @@ in url = "https://github.com/iains/gcc-11-branch/compare/ff4bf326d03e750a8d4905ea49425fe7d15a04b8..gcc-11.4-darwin-r0.diff"; hash = "sha256-6prPgR2eGVJs7vKd6iM1eZsEPCD1ShzLns2Z+29vlt4="; }) ]; + "10" = [ (fetchpatch { + # There are no upstream release tags in https://github.com/iains/gcc-10-branch. + # ff4bf32 is the commit from https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-10.5.0 + url = "https://github.com/iains/gcc-10-branch/compare/d04fe5541c53cb16d1ca5c80da044b4c7633dbc6...a61e86820ed213edffa3bb246e9d263e3c7828d5.diff"; + hash = "sha256-kVUHZKtYqkWIcqxHG7yAOR2B60w4KWLoxzaiFD/FWYk="; + }) ]; }.${majorVersion} or []) From a3341d6946cc2c1fe033a22f5b06d70e37aaaebe Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sun, 21 Jul 2024 23:19:09 -0400 Subject: [PATCH 2/2] gcc12: update aarch64-darwin patch for GCC 12.4 --- pkgs/development/compilers/gcc/patches/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/development/compilers/gcc/patches/default.nix b/pkgs/development/compilers/gcc/patches/default.nix index f49f560b31ab..2a9d987e1c3b 100644 --- a/pkgs/development/compilers/gcc/patches/default.nix +++ b/pkgs/development/compilers/gcc/patches/default.nix @@ -156,8 +156,8 @@ in }) ]; "12" = [ (fetchurl { name = "gcc-12-darwin-aarch64-support.patch"; - url = "https://raw.githubusercontent.com/Homebrew/formula-patches/f1188b90d610e2ed170b22512ff7435ba5c891e2/gcc/gcc-12.3.0.diff"; - sha256 = "sha256-naL5ZNiurqfDBiPSU8PTbTmLqj25B+vjjiqc4fAFgYs="; + url = "https://raw.githubusercontent.com/Homebrew/formula-patches/1ed9eaea059f1677d27382c62f21462b476b37fe/gcc/gcc-12.4.0.diff"; + sha256 = "sha256-wOjpT79lps4TKG5/E761odhLGCphBIkCbOPiQg/D1Fw="; }) ]; "11" = [ (fetchpatch { # There are no upstream release tags in https://github.com/iains/gcc-11-branch. @@ -166,11 +166,11 @@ in hash = "sha256-6prPgR2eGVJs7vKd6iM1eZsEPCD1ShzLns2Z+29vlt4="; }) ]; "10" = [ (fetchpatch { - # There are no upstream release tags in https://github.com/iains/gcc-10-branch. - # ff4bf32 is the commit from https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-10.5.0 - url = "https://github.com/iains/gcc-10-branch/compare/d04fe5541c53cb16d1ca5c80da044b4c7633dbc6...a61e86820ed213edffa3bb246e9d263e3c7828d5.diff"; - hash = "sha256-kVUHZKtYqkWIcqxHG7yAOR2B60w4KWLoxzaiFD/FWYk="; - }) ]; + # There are no upstream release tags in https://github.com/iains/gcc-10-branch. + # d04fe55 is the commit from https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-10.5.0 + url = "https://github.com/iains/gcc-10-branch/compare/d04fe5541c53cb16d1ca5c80da044b4c7633dbc6...gcc-10-5Dr0-pre-0.diff"; + hash = "sha256-kVUHZKtYqkWIcqxHG7yAOR2B60w4KWLoxzaiFD/FWYk="; + }) ]; }.${majorVersion} or [])