diff --git a/pkgs/development/compilers/gcc/patches/15/libgcc-darwin-detection.patch b/pkgs/development/compilers/gcc/patches/15/libgcc-darwin-detection.patch index 810d8e6f69a1..41e1c4c89869 100644 --- a/pkgs/development/compilers/gcc/patches/15/libgcc-darwin-detection.patch +++ b/pkgs/development/compilers/gcc/patches/15/libgcc-darwin-detection.patch @@ -1,11 +1,12 @@ --- a/libgcc/config.host +++ b/libgcc/config.host -@@ -239,7 +239,7 @@ case ${host} in +@@ -239,8 +239,8 @@ case ${host} in x86_64-*-darwin2[0-2]*) tmake_file="t-darwin-min-11 t-darwin-libgccs1 $tmake_file" ;; - *-*-darwin2*) +- tmake_file="t-darwin-min-11 $tmake_file" + *-*-darwin2* | *-*-darwin) - tmake_file="t-darwin-min-11 $tmake_file" ++ tmake_file="t-darwin-min-11 t-darwin-libgccs1 $tmake_file" ;; *-*-darwin1[89]*) diff --git a/pkgs/development/compilers/gcc/patches/15/libgcc-darwin-fix-reexport.patch b/pkgs/development/compilers/gcc/patches/15/libgcc-darwin-fix-reexport.patch new file mode 100644 index 000000000000..dbb790e1eec3 --- /dev/null +++ b/pkgs/development/compilers/gcc/patches/15/libgcc-darwin-fix-reexport.patch @@ -0,0 +1,11 @@ +--- a/libgcc/config/t-slibgcc-darwin ++++ b/libgcc/config/t-slibgcc-darwin +@@ -139,8 +139,7 @@ libgcc_s.1.dylib: all-multi libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT) + $(CC) -arch $${arch} -nodefaultlibs -dynamiclib -nodefaultrpaths \ + -o libgcc_s.1$(SHLIB_EXT)_T_$${mlib} \ + -Wl,-reexport_library,libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T_$${mlib} \ + -lSystem \ +- -Wl,-reexported_symbols_list,$(srcdir)/config/darwin-unwind.ver \ + -install_name $(SHLIB_RPATH)/libgcc_s.1.dylib \ + -compatibility_version 1 -current_version 1.1 ; \ + done diff --git a/pkgs/development/compilers/gcc/patches/default.nix b/pkgs/development/compilers/gcc/patches/default.nix index bfe11cb0b835..81b022a62ce4 100644 --- a/pkgs/development/compilers/gcc/patches/default.nix +++ b/pkgs/development/compilers/gcc/patches/default.nix @@ -160,13 +160,14 @@ optionals noSysDirs ( ## Darwin -# Fixes detection of Darwin on x86_64-darwin. Otherwise, GCC uses a deployment target of 10.5, which crashes ld64. +# Fixes detection of Darwin on x86_64-darwin and aarch64-darwin. Otherwise, GCC uses a deployment target of 10.5, which crashes ld64. +++ optional (is14 && stdenv.hostPlatform.isDarwin) ../patches/14/libgcc-darwin-detection.patch +++ optional (atLeast15 && stdenv.hostPlatform.isDarwin) ../patches/15/libgcc-darwin-detection.patch + +# Fix libgcc_s.1.dylib build on Darwin 11+ by not reexporting unwind symbols that don't exist ++ optional ( - is14 && stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 -) ../patches/14/libgcc-darwin-detection.patch -++ optional ( - atLeast15 && stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 -) ../patches/15/libgcc-darwin-detection.patch + atLeast15 && stdenv.hostPlatform.isDarwin +) ../patches/15/libgcc-darwin-fix-reexport.patch # Fix detection of bootstrap compiler Ada support (cctools as) on Nix Darwin ++ optional (stdenv.hostPlatform.isDarwin && langAda) ./ada-cctools-as-detection-configure.patch