From 8e9cb69da9a391783b799f479c1c89537955a380 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 18 Aug 2024 10:10:23 +0100 Subject: [PATCH 1/2] gcc11: update darwin support patch to 11.5.0 https://github.com/NixOS/nixpkgs/pull/328380 updated `gcc11` from `11.4.0` to `11.5.0` but the darwin patch was not ready then. Let's update it in hopes that it fixed `darwin` build. --- pkgs/development/compilers/gcc/patches/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/gcc/patches/default.nix b/pkgs/development/compilers/gcc/patches/default.nix index 9c756ccfa4ee1..a4aa427d73228 100644 --- a/pkgs/development/compilers/gcc/patches/default.nix +++ b/pkgs/development/compilers/gcc/patches/default.nix @@ -157,9 +157,9 @@ in }) ]; "11" = [ (fetchpatch { # There are no upstream release tags in https://github.com/iains/gcc-11-branch. - # ff4bf32 is the commit from https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-11.4.0 - url = "https://github.com/iains/gcc-11-branch/compare/ff4bf326d03e750a8d4905ea49425fe7d15a04b8..gcc-11.4-darwin-r0.diff"; - hash = "sha256-6prPgR2eGVJs7vKd6iM1eZsEPCD1ShzLns2Z+29vlt4="; + # 5cc4c42a0d4de08715c2eef8715ad5b2e92a23b6 is the commit from https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-11.5.0 + url = "https://github.com/iains/gcc-11-branch/compare/5cc4c42a0d4de08715c2eef8715ad5b2e92a23b6..gcc-11.5-darwin-r0.diff"; + hash = "sha256-7lH+GkgkrE6nOp9PMdIoqlQNWK31s6oW+lDt1LIkadE="; }) ]; "10" = [ (fetchpatch { # There are no upstream release tags in https://github.com/iains/gcc-10-branch. From 58e115dc5324ce0c9ae81ec30c5cc33e17580cd7 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 18 Aug 2024 20:23:57 +0100 Subject: [PATCH 2/2] gcc11: drop libgcc-aarch64-darwin-detection upstreamed patch Randy notes that it was already upstream in latest patches and is not needed anymore: - https://github.com/iains/gcc-11-branch/blob/8eef9a10b43856aa625531b8fad688c6c3601d12/libgcc/config.host#L229-L231 - https://github.com/iains/gcc-11-branch/blob/gcc-11-5-darwin/libgcc/config/t-darwin-rpath --- .../11/libgcc-aarch64-darwin-detection.patch | 21 ------------------- .../compilers/gcc/patches/default.nix | 3 --- 2 files changed, 24 deletions(-) delete mode 100644 pkgs/development/compilers/gcc/patches/11/libgcc-aarch64-darwin-detection.patch diff --git a/pkgs/development/compilers/gcc/patches/11/libgcc-aarch64-darwin-detection.patch b/pkgs/development/compilers/gcc/patches/11/libgcc-aarch64-darwin-detection.patch deleted file mode 100644 index 08dbfec6b249e..0000000000000 --- a/pkgs/development/compilers/gcc/patches/11/libgcc-aarch64-darwin-detection.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -u a/libgcc/config.host b/libgcc/config.host ---- a/libgcc/config.host 2023-11-05 11:01:55.778638446 -0500 -+++ b/libgcc/config.host 2023-11-05 11:07:29.405103979 -0500 -@@ -227,7 +227,7 @@ - tmake_file="$tmake_file t-slibgcc-darwin" - # newer toolsets produce warnings when building for unsupported versions. - case ${host} in -- *-*-darwin1[89]* | *-*-darwin2* ) -+ *-*-darwin1[89]* | *-*-darwin2* | aarch64*-*-darwin*) - tmake_file="t-darwin-min-8 $tmake_file" - ;; - *-*-darwin9* | *-*-darwin1[0-7]*) -diff -ur a/libgcc/config/t-darwin-rpath b/libgcc/config/t-darwin-rpath ---- a/libgcc/config/t-darwin-rpath 2023-11-05 11:34:18.691150009 -0500 -+++ b/libgcc/config/t-darwin-rpath 2023-11-05 11:50:36.968920904 -0500 -@@ -2,4 +2,4 @@ - SHLIB_RPATH = @rpath - - # Which does not work for Darwin < 9 --HOST_LIBGCC2_CFLAGS += -mmacosx-version-min=10.5 -+SHLIB_LOADER_PATH = -Wl,-rpath,@loader_path diff --git a/pkgs/development/compilers/gcc/patches/default.nix b/pkgs/development/compilers/gcc/patches/default.nix index a4aa427d73228..c25771a93723e 100644 --- a/pkgs/development/compilers/gcc/patches/default.nix +++ b/pkgs/development/compilers/gcc/patches/default.nix @@ -201,9 +201,6 @@ in ## gcc 11.0 and older ############################################################################## -# libgcc’s `configure` script misdetects aarch64-darwin, resulting in an invalid deployment target. -++ optional (is11 && stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ./11/libgcc-aarch64-darwin-detection.patch - # openjdk build fails without this on -march=opteron; is upstream in gcc12 ++ optionals (is11) [ ./11/gcc-issue-103910.patch ]