pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lang/gcc12: Fix patch for Darwin aarch64



Module Name:	pkgsrc-wip
Committed By:	Frédéric Fauberteau <frederic%fauberteau.org@localhost>
Pushed By:	frederic
Date:		Wed Feb 18 21:03:17 2026 +0100
Changeset:	0cc8844bf5a4baf4063b2c5359c9ebb3c8eb15e7

Modified Files:
	gcc12/Makefile.common
	gcc12/buildlink3.mk
	gcc12/distinfo
Removed Files:
	gcc12/patches/patch-fixincludes_fixincl.x
	gcc12/patches/patch-fixincludes_inclhack.def
	gcc12/patches/patch-fixincludes_tests_base_math.h
	gcc12/patches/patch-zlib_zutil.h

Log Message:
lang/gcc12: Fix patch for Darwin aarch64

The 4 previously added patches have been made on top of gcc-12.5.0.diff.
For other architectures, these patches are broken. This commit fixes
this issue by merging the 4 patches to gcc-12.5.0.diff.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=0cc8844bf5a4baf4063b2c5359c9ebb3c8eb15e7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 gcc12/Makefile.common                             |  3 +-
 gcc12/buildlink3.mk                               |  2 +-
 gcc12/distinfo                                    | 10 +--
 gcc12/patches/patch-fixincludes_fixincl.x         | 92 -----------------------
 gcc12/patches/patch-fixincludes_inclhack.def      | 36 ---------
 gcc12/patches/patch-fixincludes_tests_base_math.h | 27 -------
 gcc12/patches/patch-zlib_zutil.h                  | 52 -------------
 7 files changed, 6 insertions(+), 216 deletions(-)

diffs:
diff --git a/gcc12/Makefile.common b/gcc12/Makefile.common
index f32b61d0e5..bbbb257930 100644
--- a/gcc12/Makefile.common
+++ b/gcc12/Makefile.common
@@ -58,7 +58,8 @@ CHECK_PORTABILITY_SKIP+=	gcc/configure.orig_dist
 BUILDLINK_TRANSFORM+=	rm:-nodefaultrpaths
 CONFIGURE_ARGS+=	--disable-darwin-at-rpath
 PATCHFILES=		gcc-12.5.0.diff
-PATCH_SITES=		https://ftp.netbsd.org/pub/pkgsrc/misc/maya/
+PATCH_SITES=		https://ftp.netbsd.org/pub/pkgsrc/misc/triaxx/
+#PATCH_SITES=		https://ftp.netbsd.org/pub/pkgsrc/misc/maya/
 #PATCH_SITES=		https://raw.githubusercontent.com/Homebrew/formula-patches/ca7047dad38f16fb02eb63bd4447e17d0b68b3bb/gcc/
 PATCH_DIST_STRIP=	-p1
 .endif
diff --git a/gcc12/buildlink3.mk b/gcc12/buildlink3.mk
index 1cb8e4e418..35c3da0d36 100644
--- a/gcc12/buildlink3.mk
+++ b/gcc12/buildlink3.mk
@@ -7,7 +7,7 @@ GCC12_BUILDLINK3_MK:=
 
 BUILDLINK_API_DEPENDS.gcc12+=	gcc12>=${_GCC_REQD}
 BUILDLINK_ABI_DEPENDS.gcc12+=	gcc12>=12.1.0nb1
-BUILDLINK_PKGSRCDIR.gcc12=	../../lang/gcc12
+BUILDLINK_PKGSRCDIR.gcc12=	../../wip/gcc12
 BUILDLINK_DEPMETHOD.gcc12?=	build
 
 BUILDLINK_PASSTHRU_DIRS+=	${BUILDLINK_PREFIX.gcc12}/gcc12
diff --git a/gcc12/distinfo b/gcc12/distinfo
index 6bd5486c5b..09022abc59 100644
--- a/gcc12/distinfo
+++ b/gcc12/distinfo
@@ -1,17 +1,14 @@
 $NetBSD: distinfo,v 1.14 2025/12/15 04:39:26 maya Exp $
 
-BLAKE2s (gcc-12.5.0.diff) = 37de4c2df06457eda7e277e776fffb0f7c260c6e920fa73ede252ae70427c3cf
-SHA512 (gcc-12.5.0.diff) = 14f8e682946b37bf4a259dea79782736683bcde387e24877b364e770489bb1a7d1fbb49dc6d7c7b98dcd1aca16c1f98a8b924cfde2fec1a111913d4f13d9ce6c
-Size (gcc-12.5.0.diff) = 664993 bytes
+BLAKE2s (gcc-12.5.0.diff) = 2e5b0c6e8cececdddf451c07f55a47e693410cb4c50aedb8534ec345810d05c6
+SHA512 (gcc-12.5.0.diff) = 6137995194e2c5b1bbedef6efd1083018ee03cadbb29c2e1a8bda7ef49a76b13c307749f5a1ee4284d399d200a5a46aa888feacc2bfaf743de25f16b00640c76
+Size (gcc-12.5.0.diff) = 650426 bytes
 BLAKE2s (gcc-12.5.0.tar.xz) = 403e8a3b4dc15a2e49f6ebf206d8b4b5d7f3b69d2ebcf6d901addf58ac259991
 SHA512 (gcc-12.5.0.tar.xz) = c76020e4c844b53485502cb8a4e295221c9d37487d66c9f4559031fb14c85de20602e6387310005386cb0ef25e55067d2cfef141423bb445f3b77e7456a23533
 Size (gcc-12.5.0.tar.xz) = 85897368 bytes
 BLAKE2s (isl-0.16.1.tar.bz2) = 01c3fc657326e81414986eb7ede6f73e540b97009745ced125cdf7f4a8d80f61
 SHA512 (isl-0.16.1.tar.bz2) = c188667a84dc5bdddb4ab7c35f89c91bf15a8171f4fcaf41301cf285fb7328846d9a367c096012fec4cc69d244f0bc9e95d84c09ec097394cd4093076f2a041b
 Size (isl-0.16.1.tar.bz2) = 1626446 bytes
-SHA1 (patch-fixincludes_fixincl.x) = b233e8ae9589ee7e40523e7af1d195afc142742b
-SHA1 (patch-fixincludes_inclhack.def) = 6c1a88850153b9de44c62607adeb638cbb9dcbca
-SHA1 (patch-fixincludes_tests_base_math.h) = 2897678edae52784b19398d368f6634189fc8cd0
 SHA1 (patch-gcc_Makefile.in) = a31ddc27f1092cfdf5ac896ca79c8590b5aceb47
 SHA1 (patch-gcc_config.gcc) = 260f187048260e539e928bb04594b6394bb03912
 SHA1 (patch-gcc_config.host) = bf95dd21bfdf79d173e745fbd35c9bb99fdf4087
@@ -33,4 +30,3 @@ SHA1 (patch-libgfortran_io_io.h) = d44676239a7f45e42054d24bd5224f43c20055c0
 SHA1 (patch-libquadmath_printf_quadmath-printf.c) = 78e09f1e6d61ee57cee83275093cf46b2335d204
 SHA1 (patch-libquadmath_strtod_strtod__l.c) = 6142c10d34174174cce7f06c37eab04dc431b2dc
 SHA1 (patch-libstdc++-v3_libsupc++_new__opa.cc) = c8169d28f25c57ba89ffe8c9f897313bb8644382
-SHA1 (patch-zlib_zutil.h) = 10ee1a925a6d4c54e92f81402192cb6a21a82c27
diff --git a/gcc12/patches/patch-fixincludes_fixincl.x b/gcc12/patches/patch-fixincludes_fixincl.x
deleted file mode 100644
index 458c8bd816..0000000000
--- a/gcc12/patches/patch-fixincludes_fixincl.x
+++ /dev/null
@@ -1,92 +0,0 @@
-$NetBSD$
-
-Fix build on Darwin for macOS 26.2.
-
-Patch from https://github.com/markmentovai/gcc/commit/8708938
-fixincludes, Darwin: Handle macOS 15 SDK
-The macOS 15 SDK has declarations that use the _Float16 type in its
-<math.h>, but GCC 12 doesn't support that type in C++ code, support
-having been introduced in b042088 (in GCC 13). Add a fixincludes
-hack to hide these declarations inside #ifndef __cplusplus guards.
-
---- fixincludes/fixincl.x.orig	2026-02-18 05:39:44.820015042 +0000
-+++ fixincludes/fixincl.x
-@@ -2796,6 +2796,46 @@ extern \"C\" {\n\
- #endif\n",
-     (char*)NULL };
- 
-+
-+/* * * * * * * * * * * * * * * * * * * * * * * * * *
-+ *
-+ *  Description of Darwin_Float16 fix
-+ */
-+tSCC zDarwin_Float16Name[] =
-+     "darwin_float16";
-+
-+/*
-+ *  File name selection pattern
-+ */
-+tSCC zDarwin_Float16List[] =
-+  "math.h\0";
-+/*
-+ *  Machine/OS name selection pattern
-+ */
-+tSCC* apzDarwin_Float16Machs[] = {
-+        "*-*-darwin*",
-+        (const char*)NULL };
-+
-+/*
-+ *  content selection pattern - do fix if pattern found
-+ */
-+tSCC zDarwin_Float16Select0[] =
-+       "^.*(^|[ \t])_Float16[ \t]+__[0-9A-Za-z_]+f16[ \t]*\\([ \t]*_Float16[,) \t].*$";
-+
-+#define    DARWIN_FLOAT16_TEST_CT  1
-+static tTestDesc aDarwin_Float16Tests[] = {
-+  { TT_EGREP,    zDarwin_Float16Select0, (regex_t*)NULL }, };
-+
-+/*
-+ *  Fix Command Arguments for Darwin_Float16
-+ */
-+static const char* apzDarwin_Float16Patch[] = {
-+    "format",
-+    "#ifndef __cplusplus\n\
-+%0\n\
-+#endif",
-+    (char*)NULL };
-+
- /* * * * * * * * * * * * * * * * * * * * * * * * * *
-  *
-  *  Description of Darwin_Gcc4_Breakage fix
-@@ -10864,9 +10904,9 @@ static const char* apzX11_SprintfPatch[]
-  *
-  *  List of all fixes
-  */
--#define REGEX_COUNT          304
-+#define REGEX_COUNT          305
- #define MACH_LIST_SIZE_LIMIT 187
--#define FIX_COUNT            267
-+#define FIX_COUNT            268
- 
- /*
-  *  Enumerate the fixes
-@@ -10938,6 +10978,7 @@ typedef enum {
-     CXX_UNREADY_FIXIDX,
-     DARWIN_9_LONG_DOUBLE_FUNCS_2_FIXIDX,
-     DARWIN_EXTERNC_FIXIDX,
-+    DARWIN_FLOAT16_FIXIDX,
-     DARWIN_GCC4_BREAKAGE_FIXIDX,
-     DARWIN_LL_FUNCS_AVAIL_FIXIDX,
-     DARWIN_LONGJMP_NORETURN_FIXIDX,
-@@ -11472,6 +11513,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
-      DARWIN_EXTERNC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
-      aDarwin_ExterncTests,   apzDarwin_ExterncPatch, 0 },
- 
-+  {  zDarwin_Float16Name,    zDarwin_Float16List,
-+     apzDarwin_Float16Machs,
-+     DARWIN_FLOAT16_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
-+     aDarwin_Float16Tests,   apzDarwin_Float16Patch, 0 },
-+
-   {  zDarwin_Gcc4_BreakageName,    zDarwin_Gcc4_BreakageList,
-      apzDarwin_Gcc4_BreakageMachs,
-      DARWIN_GCC4_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/gcc12/patches/patch-fixincludes_inclhack.def b/gcc12/patches/patch-fixincludes_inclhack.def
deleted file mode 100644
index 0f7592c550..0000000000
--- a/gcc12/patches/patch-fixincludes_inclhack.def
+++ /dev/null
@@ -1,36 +0,0 @@
-$NetBSD$
-
-Fix build on Darwin for macOS 26.2.
-
-Patch from https://github.com/markmentovai/gcc/commit/8708938
-fixincludes, Darwin: Handle macOS 15 SDK
-The macOS 15 SDK has declarations that use the _Float16 type in its
-<math.h>, but GCC 12 doesn't support that type in C++ code, support
-having been introduced in b042088 (in GCC 13). Add a fixincludes
-hack to hide these declarations inside #ifndef __cplusplus guards.
-
---- fixincludes/inclhack.def.orig	2026-02-17 21:17:12.726549576 +0000
-+++ fixincludes/inclhack.def
-@@ -483,6 +483,22 @@ fix = {
- };
- 
- /*
-+ * The macOS 15 SDK's <math.h> uses _Float16, which is avialable in gcc 12 for
-+ * C, but not C++.
-+ */
-+fix = {
-+  hackname  = darwin_float16;
-+  mach      = "*-*-darwin*";
-+  files     = math.h;
-+  select    = "^.*(^|[ \t])_Float16[ \t]+__[0-9A-Za-z_]+f16[ \t]*\\([ \t]*_Float16[,) \t].*$";
-+  c_fix     = format;
-+  c_fix_arg = "#ifndef __cplusplus\n"
-+              "%0\n"
-+              "#endif";
-+  test_text = "extern _Float16 __fabsf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));";
-+};
-+
-+/*
-  * complex.h on AIX 5 and AIX 6 define _Complex_I and I in terms of __I,
-  * which only is provided by AIX xlc C99.
-  */
diff --git a/gcc12/patches/patch-fixincludes_tests_base_math.h b/gcc12/patches/patch-fixincludes_tests_base_math.h
deleted file mode 100644
index 478d5044bc..0000000000
--- a/gcc12/patches/patch-fixincludes_tests_base_math.h
+++ /dev/null
@@ -1,27 +0,0 @@
-$NetBSD$
-
-Fix build on Darwin for macOS 26.2.
-
-Patch from https://github.com/markmentovai/gcc/commit/8708938
-fixincludes, Darwin: Handle macOS 15 SDK
-The macOS 15 SDK has declarations that use the _Float16 type in its
-<math.h>, but GCC 12 doesn't support that type in C++ code, support
-having been introduced in b042088 (in GCC 13). Add a fixincludes
-hack to hide these declarations inside #ifndef __cplusplus guards.
-
---- fixincludes/tests/base/math.h.orig	2026-02-17 21:20:00.303296688 +0000
-+++ fixincludes/tests/base/math.h
-@@ -30,6 +30,13 @@
- #endif  /* DARWIN_9_LONG_DOUBLE_FUNCS_2_CHECK */
- 
- 
-+#if defined( DARWIN_FLOAT16_CHECK )
-+#ifndef __cplusplus
-+extern _Float16 __fabsf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
-+#endif
-+#endif  /* DARWIN_FLOAT16_CHECK */
-+
-+
- #if defined( DARWIN_FLT_EVAL_METHOD_CHECK )
- #if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 16
- #if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1 || __FLT_EVAL_METHOD__ == 16
diff --git a/gcc12/patches/patch-zlib_zutil.h b/gcc12/patches/patch-zlib_zutil.h
deleted file mode 100644
index f6a4ebf031..0000000000
--- a/gcc12/patches/patch-zlib_zutil.h
+++ /dev/null
@@ -1,52 +0,0 @@
-$NetBSD$
-
-Fix build on Darwin for macOS 26.2.
-
-Patch from https://github.com/madler/zlib/commit/4bd9a71
-Remove fdopen #defines in zutil.h.
-fdopen() is not used by zlib anymore. The #defines are vestigial.
-
---- zlib/zutil.h.orig	2026-02-17 18:13:27.663096470 +0000
-+++ zlib/zutil.h
-@@ -130,17 +130,8 @@ extern z_const char * const z_errmsg[10]
- #  endif
- #endif
- 
--#if defined(MACOS) || defined(TARGET_OS_MAC)
-+#if defined(MACOS)
- #  define OS_CODE  7
--#  ifndef Z_SOLO
--#    if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
--#      include <unix.h> /* for fdopen */
--#    else
--#      ifndef fdopen
--#        define fdopen(fd,mode) NULL /* No fdopen() */
--#      endif
--#    endif
--#  endif
- #endif
- 
- #ifdef __acorn
-@@ -163,22 +154,6 @@ extern z_const char * const z_errmsg[10]
- #  define OS_CODE 19
- #endif
- 
--#if defined(_BEOS_) || defined(RISCOS)
--#  define fdopen(fd,mode) NULL /* No fdopen() */
--#endif
--
--#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
--#  if defined(_WIN32_WCE)
--#    define fdopen(fd,mode) NULL /* No fdopen() */
--#    ifndef _PTRDIFF_T_DEFINED
--       typedef int ptrdiff_t;
--#      define _PTRDIFF_T_DEFINED
--#    endif
--#  else
--#    define fdopen(fd,type)  _fdopen(fd,type)
--#  endif
--#endif
--
- #if defined(__BORLANDC__) && !defined(MSDOS)
-   #pragma warn -8004
-   #pragma warn -8008


Home | Main Index | Thread Index | Old Index