On Wed, Oct 14, 2026 at 07:44:50PM -0400, Brad Smith wrote:
Fix various GCC ports on powerpc64 by either renaming the existing
patch since GCC has moved from C to C++ for newer versions or add
the missing patch. For the x86_64-elf port it only builds on amd64
so remove the ununused bits from the Makefile.
Here is rev 2 of this patch.
I have removed the separate vecstep patches and instead integrated
the upstream workaround into system.h. Dropping the separate patches
also removes a fragile piece of the build infrastructure.
Index: devel/arm-none-eabi/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/arm-none-eabi/gcc/Makefile,v
retrieving revision 1.9
diff -u -p -u -p -r1.9 Makefile
--- devel/arm-none-eabi/gcc/Makefile 12 Mar 2026 15:29:28 -0000 1.9
+++ devel/arm-none-eabi/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -1,5 +1,3 @@
-BROKEN-powerpc64 = fails to apply patches/vecstep-*
-
COMMENT= gcc for ${CONFIG} cross-development
VERSION= 12.2.0
@@ -28,10 +26,6 @@ DIST_SUBDIR= gcc
COMPILER = base-clang ports-gcc base-gcc
SITES= ${SITE_GCC:=releases/gcc-$(VERSION)/}
-
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
BUILD_DEPENDS+= devel/bison \
${RUN_DEPENDS}
Index: devel/arm-none-eabi/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: /cvs/ports/devel/arm-none-eabi/gcc/patches/patch-gcc_system_h,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-gcc_system_h
--- devel/arm-none-eabi/gcc/patches/patch-gcc_system_h 3 Jul 2025 20:31:41
-0000 1.1
+++ devel/arm-none-eabi/gcc/patches/patch-gcc_system_h 26 Oct 2026 12:21:13
-0000
@@ -1,6 +1,9 @@
Fix build with libc++19
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -46,12 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
-@@ -243,6 +227,19 @@ extern int errno;
- # include <new>
- # include <utility>
+@@ -245,6 +229,19 @@ extern int errno;
# include <type_traits>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -63,6 +64,21 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
++#endif
++
+ /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1298,6 +1295,12 @@ void gcc_stablesort_r (void *, size_t, size_t, sort_r_
+ #ifdef __cplusplus
+ #undef NULL
+ #define NULL nullptr
++#endif
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
#endif
- /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ /* Return true if STR string starts with PREFIX. */
Index: devel/arm-none-eabi/gcc/patches/vecstep-gcc_tree-vect-loop_c
===================================================================
RCS file: devel/arm-none-eabi/gcc/patches/vecstep-gcc_tree-vect-loop_c
diff -N devel/arm-none-eabi/gcc/patches/vecstep-gcc_tree-vect-loop_c
--- devel/arm-none-eabi/gcc/patches/vecstep-gcc_tree-vect-loop_c 22 Apr
2023 16:23:25 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-clang on powerpc64 defines vec_step already which collides with the
-symbol in gcc, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239266#c23
-renaming suggested at https://gcc.gnu.org/legacy-ml/gcc/2019-07/msg00131.html
-
-Index: gcc/tree-vect-loop.c
---- gcc/tree-vect-loop.c.orig
-+++ gcc/tree-vect-loop.c
-@@ -55,6 +55,8 @@ along with GCC; see the file COPYING3. If not see
- #include "vec-perm-indices.h"
- #include "tree-eh.h"
-
-+#define vec_step vec_step_
-+
- /* Loop Vectorization Pass.
-
- This pass tries to vectorize loops.
Index: devel/avr/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/avr/gcc/Makefile,v
retrieving revision 1.45
diff -u -p -u -p -r1.45 Makefile
--- devel/avr/gcc/Makefile 22 Sep 2026 19:35:51 -0000 1.45
+++ devel/avr/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -18,10 +18,6 @@ SITES= ${SITE_GCC:=releases/gcc-$(V)/}
EXTRACT_SUFX= .tar.xz
DIST_SUBDIR= gcc
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
BUILD_DEPENDS+= devel/bison \
${RUN_DEPENDS}
RUN_DEPENDS= devel/avr/binutils>=2.30
Index: devel/avr/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: devel/avr/gcc/patches/patch-gcc_system_h
diff -N devel/avr/gcc/patches/patch-gcc_system_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/avr/gcc/patches/patch-gcc_system_h 26 Oct 2026 12:21:13 -0000
@@ -0,0 +1,17 @@
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
+Index: gcc/system.h
+--- gcc/system.h.orig
++++ gcc/system.h
+@@ -1209,4 +1209,10 @@ helper_const_non_const_cast (const char *p)
+ void qsort_chk (void *, size_t, size_t, int (*)(const void *, const void *));
+ #endif
+
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
++#endif
++
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/avr/gcc/patches/vecstep-gcc_tree-vect-loop_c
===================================================================
RCS file: devel/avr/gcc/patches/vecstep-gcc_tree-vect-loop_c
diff -N devel/avr/gcc/patches/vecstep-gcc_tree-vect-loop_c
--- devel/avr/gcc/patches/vecstep-gcc_tree-vect-loop_c 11 Mar 2022 18:49:43
-0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-clang on powerpc64 defines vec_step already which collides with the
-symbol in gcc, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239266#c23
-renaming suggested at https://gcc.gnu.org/legacy-ml/gcc/2019-07/msg00131.html
-
-Index: gcc/tree-vect-loop.c
---- gcc/tree-vect-loop.c.orig
-+++ gcc/tree-vect-loop.c
-@@ -55,6 +55,8 @@ along with GCC; see the file COPYING3. If not see
- #include "vec-perm-indices.h"
- #include "tree-eh.h"
-
-+#define vec_step vec_step_
-+
- /* Loop Vectorization Pass.
-
- This pass tries to vectorize loops.
Index: devel/avr32/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/avr32/gcc/Makefile,v
retrieving revision 1.11
diff -u -p -u -p -r1.11 Makefile
--- devel/avr32/gcc/Makefile 3 Feb 2024 12:15:05 -0000 1.11
+++ devel/avr32/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -35,10 +35,6 @@ CFLAGS += -fgnu89-inline
SEPARATE_BUILD = Yes
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
# This file confuses 'make update-patches'
post-extract:
rm ${WRKSRC}/gcc/config/avr32/avr32.c.orig
Index: devel/avr32/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: devel/avr32/gcc/patches/patch-gcc_system_h
diff -N devel/avr32/gcc/patches/patch-gcc_system_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/avr32/gcc/patches/patch-gcc_system_h 26 Oct 2026 12:21:13 -0000
@@ -0,0 +1,17 @@
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
+Index: gcc/system.h
+--- gcc/system.h.orig
++++ gcc/system.h
+@@ -834,4 +834,10 @@ extern void fancy_abort (const char *, int, const char
+ #define VALGRIND_FREELIKE_BLOCK(x,y)
+ #endif
+
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
++#endif
++
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/avr32/gcc/patches/vecstep-gcc_tree-vect-transform_c
===================================================================
RCS file: devel/avr32/gcc/patches/vecstep-gcc_tree-vect-transform_c
diff -N devel/avr32/gcc/patches/vecstep-gcc_tree-vect-transform_c
--- devel/avr32/gcc/patches/vecstep-gcc_tree-vect-transform_c 11 Mar 2022
18:49:43 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-clang on powerpc64 defines vec_step already which collides with the
-symbol in gcc, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239266#c23
-renaming suggested at https://gcc.gnu.org/legacy-ml/gcc/2019-07/msg00131.html
-
-Index: gcc/tree-vect-transform.c
---- gcc/tree-vect-transform.c.orig
-+++ gcc/tree-vect-transform.c
-@@ -46,6 +46,8 @@ along with GCC; see the file COPYING3. If not see
- #include "toplev.h"
- #include "real.h"
-
-+#define vec_step vec_step_
-+
- /* Utility functions for the code transformation. */
- static bool vect_transform_stmt (gimple, gimple_stmt_iterator *, bool *,
- slp_tree, slp_instance);
Index: devel/avr32/gcc-bootstrap/Makefile
===================================================================
RCS file: /cvs/ports/devel/avr32/gcc-bootstrap/Makefile,v
retrieving revision 1.12
diff -u -p -u -p -r1.12 Makefile
--- devel/avr32/gcc-bootstrap/Makefile 3 Feb 2024 12:15:05 -0000 1.12
+++ devel/avr32/gcc-bootstrap/Makefile 26 Oct 2026 12:21:13 -0000
@@ -33,10 +33,6 @@ CFLAGS += -fgnu89-inline
SEPARATE_BUILD = Yes
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
# This file confuses 'make update-patches'
post-extract:
rm ${WRKSRC}/gcc/config/avr32/avr32.c.orig
Index: devel/avr32/gcc-bootstrap/patches/patch-gcc_system_h
===================================================================
RCS file: devel/avr32/gcc-bootstrap/patches/patch-gcc_system_h
diff -N devel/avr32/gcc-bootstrap/patches/patch-gcc_system_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/avr32/gcc-bootstrap/patches/patch-gcc_system_h 26 Oct 2026
12:21:13 -0000
@@ -0,0 +1,17 @@
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
+Index: gcc/system.h
+--- gcc/system.h.orig
++++ gcc/system.h
+@@ -834,4 +834,10 @@ extern void fancy_abort (const char *, int, const char
+ #define VALGRIND_FREELIKE_BLOCK(x,y)
+ #endif
+
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
++#endif
++
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/avr32/gcc-bootstrap/patches/vecstep-gcc_tree-vect-transform_c
===================================================================
RCS file: devel/avr32/gcc-bootstrap/patches/vecstep-gcc_tree-vect-transform_c
diff -N devel/avr32/gcc-bootstrap/patches/vecstep-gcc_tree-vect-transform_c
--- devel/avr32/gcc-bootstrap/patches/vecstep-gcc_tree-vect-transform_c 11 Mar
2022 18:49:44 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-clang on powerpc64 defines vec_step already which collides with the
-symbol in gcc, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239266#c23
-renaming suggested at https://gcc.gnu.org/legacy-ml/gcc/2019-07/msg00131.html
-
-Index: gcc/tree-vect-transform.c
---- gcc/tree-vect-transform.c.orig
-+++ gcc/tree-vect-transform.c
-@@ -46,6 +46,8 @@ along with GCC; see the file COPYING3. If not see
- #include "toplev.h"
- #include "real.h"
-
-+#define vec_step vec_step_
-+
- /* Utility functions for the code transformation. */
- static bool vect_transform_stmt (gimple, gimple_stmt_iterator *, bool *,
- slp_tree, slp_instance);
Index: devel/msp430/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/msp430/gcc/Makefile,v
retrieving revision 1.33
diff -u -p -u -p -r1.33 Makefile
--- devel/msp430/gcc/Makefile 7 Nov 2023 14:19:25 -0000 1.33
+++ devel/msp430/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -13,10 +13,6 @@ DISTFILES= gcc-core-${TOOL_V}${EXTRACT_
LTS_PATCHES= msp430-gcc-4.6.3-20120406-sf3540953.patch \
msp430-gcc-4.6.3-20120406-sf3559978.patch
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
WANTLIB += c gmp mpc mpfr
BUILD_DEPENDS= ${RUN_DEPENDS}
Index: devel/msp430/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: devel/msp430/gcc/patches/patch-gcc_system_h
diff -N devel/msp430/gcc/patches/patch-gcc_system_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/msp430/gcc/patches/patch-gcc_system_h 26 Oct 2026 12:21:13 -0000
@@ -0,0 +1,17 @@
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
+Index: gcc/system.h
+--- gcc/system.h.orig
++++ gcc/system.h
+@@ -969,4 +969,10 @@ helper_const_non_const_cast (const char *p)
+ #define DEBUG_VARIABLE
+ #endif
+
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
++#endif
++
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/msp430/gcc/patches/vecstep-gcc_tree-vect-loop_c
===================================================================
RCS file: devel/msp430/gcc/patches/vecstep-gcc_tree-vect-loop_c
diff -N devel/msp430/gcc/patches/vecstep-gcc_tree-vect-loop_c
--- devel/msp430/gcc/patches/vecstep-gcc_tree-vect-loop_c 11 Mar 2022
18:50:50 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-clang on powerpc64 defines vec_step already which collides with the
-symbol in gcc, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239266#c23
-renaming suggested at https://gcc.gnu.org/legacy-ml/gcc/2019-07/msg00131.html
-
-Index: gcc/tree-vect-loop.c
---- gcc/tree-vect-loop.c.orig
-+++ gcc/tree-vect-loop.c
-@@ -55,6 +55,8 @@ along with GCC; see the file COPYING3. If not see
- #include "vec-perm-indices.h"
- #include "tree-eh.h"
-
-+#define vec_step vec_step_
-+
- /* Loop Vectorization Pass.
-
- This pass tries to vectorize loops.
Index: devel/or1k-elf/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/or1k-elf/gcc/Makefile,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 Makefile
--- devel/or1k-elf/gcc/Makefile 3 Jul 2025 20:33:09 -0000 1.4
+++ devel/or1k-elf/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -16,10 +16,6 @@ COMPILER = base-clang ports-gcc base-gcc
SITES= ${SITE_GCC:=releases/gcc-$(VERSION)/}
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
BUILD_DEPENDS= devel/bison \
${RUN_DEPENDS}
RUN_DEPENDS= devel/or1k-elf/binutils
Index: devel/or1k-elf/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: /cvs/ports/devel/or1k-elf/gcc/patches/patch-gcc_system_h,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-gcc_system_h
--- devel/or1k-elf/gcc/patches/patch-gcc_system_h 3 Jul 2025 20:33:09
-0000 1.1
+++ devel/or1k-elf/gcc/patches/patch-gcc_system_h 26 Oct 2026 12:21:13
-0000
@@ -1,6 +1,9 @@
Fix build with libc++19
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -46,12 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
-@@ -243,6 +227,19 @@ extern int errno;
- # include <new>
- # include <utility>
+@@ -245,6 +229,19 @@ extern int errno;
# include <type_traits>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -63,6 +64,21 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
++#endif
++
+ /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1298,6 +1295,12 @@ void gcc_stablesort_r (void *, size_t, size_t, sort_r_
+ #ifdef __cplusplus
+ #undef NULL
+ #define NULL nullptr
++#endif
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
#endif
- /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ /* Return true if STR string starts with PREFIX. */
Index: devel/or1k-elf/gcc/patches/vecstep-gcc_tree-vect-loop_cc
===================================================================
RCS file: devel/or1k-elf/gcc/patches/vecstep-gcc_tree-vect-loop_cc
diff -N devel/or1k-elf/gcc/patches/vecstep-gcc_tree-vect-loop_cc
--- devel/or1k-elf/gcc/patches/vecstep-gcc_tree-vect-loop_cc 19 Feb 2024
20:22:47 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-clang on powerpc64 defines vec_step already which collides with the
-symbol in gcc, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239266#c23
-renaming suggested at https://gcc.gnu.org/legacy-ml/gcc/2019-07/msg00131.html
-
-Index: gcc/tree-vect-loop.cc
---- gcc/tree-vect-loop.cc.orig
-+++ gcc/tree-vect-loop.cc
-@@ -56,6 +56,8 @@ along with GCC; see the file COPYING3. If not see
- #include "tree-eh.h"
- #include "case-cfn-macros.h"
-
-+#define vec_step vec_step_
-+
- /* Loop Vectorization Pass.
-
- This pass tries to vectorize loops.
Index: devel/riscv-elf/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/riscv-elf/gcc/Makefile,v
retrieving revision 1.15
diff -u -p -u -p -r1.15 Makefile
--- devel/riscv-elf/gcc/Makefile 3 Jul 2025 20:34:45 -0000 1.15
+++ devel/riscv-elf/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -1,4 +1,3 @@
-BROKEN-powerpc64 = fails to apply patches/vecstep-*
BROKEN-arm = spins CPU more than 12h building gcc-12.2.0/libgcc/libgcc2.c
COMMENT= gcc for riscv-elf cross-development
Index: devel/riscv-elf/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: /cvs/ports/devel/riscv-elf/gcc/patches/patch-gcc_system_h,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-gcc_system_h
--- devel/riscv-elf/gcc/patches/patch-gcc_system_h 3 Jul 2025 20:34:45
-0000 1.1
+++ devel/riscv-elf/gcc/patches/patch-gcc_system_h 26 Oct 2026 12:21:13
-0000
@@ -1,6 +1,9 @@
Fix build with libc++19
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -46,12 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
-@@ -243,6 +227,19 @@ extern int errno;
- # include <new>
- # include <utility>
+@@ -245,6 +229,19 @@ extern int errno;
# include <type_traits>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -63,6 +64,21 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
++#endif
++
+ /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1298,6 +1295,12 @@ void gcc_stablesort_r (void *, size_t, size_t, sort_r_
+ #ifdef __cplusplus
+ #undef NULL
+ #define NULL nullptr
++#endif
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
#endif
- /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ /* Return true if STR string starts with PREFIX. */
Index: devel/riscv-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c
===================================================================
RCS file: devel/riscv-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c
diff -N devel/riscv-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c
--- devel/riscv-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c 11 Mar 2022
18:53:10 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-clang on powerpc64 defines vec_step already which collides with the
-symbol in gcc, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239266#c23
-renaming suggested at https://gcc.gnu.org/legacy-ml/gcc/2019-07/msg00131.html
-
-Index: gcc/tree-vect-loop.c
---- gcc/tree-vect-loop.c.orig
-+++ gcc/tree-vect-loop.c
-@@ -55,6 +55,8 @@ along with GCC; see the file COPYING3. If not see
- #include "vec-perm-indices.h"
- #include "tree-eh.h"
-
-+#define vec_step vec_step_
-+
- /* Loop Vectorization Pass.
-
- This pass tries to vectorize loops.
Index: devel/riscv32-esp-elf/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/riscv32-esp-elf/gcc/Makefile,v
retrieving revision 1.9
diff -u -p -u -p -r1.9 Makefile
--- devel/riscv32-esp-elf/gcc/Makefile 2 Jun 2026 12:44:38 -0000 1.9
+++ devel/riscv32-esp-elf/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -21,10 +21,6 @@ LIBELF = libelf-0.8.13
SITES.elf =
https://github.com/earlephilhower/esp-quick-toolchain/raw/master/blobs/
DISTFILES.elf = ${LIBELF}${EXTRACT_SUFX}
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
MODULES = lang/python
BUILD_DEPENDS += devel/${CONFIG}/binutils \
Index: devel/riscv32-esp-elf/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: /cvs/ports/devel/riscv32-esp-elf/gcc/patches/patch-gcc_system_h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-gcc_system_h
--- devel/riscv32-esp-elf/gcc/patches/patch-gcc_system_h 13 Jul 2025
11:27:48 -0000 1.2
+++ devel/riscv32-esp-elf/gcc/patches/patch-gcc_system_h 26 Oct 2026
12:21:13 -0000
@@ -1,6 +1,9 @@
Fix build with libc++19, backport of
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -36,7 +39,7 @@ Index: gcc/system.h
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
# include <algorithm>
#endif
-@@ -229,12 +210,28 @@ extern int errno;
+@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
@@ -46,11 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
- # include <cstring>
- # include <new>
+@@ -237,6 +221,19 @@ extern int errno;
# include <utility>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -62,6 +64,21 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
++#endif
++
+ /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1207,6 +1204,12 @@ helper_const_non_const_cast (const char *p)
+ #undef qsort
+ #define qsort(...) PP_5th (__VA_ARGS__, qsort_chk, 3, 2, qsort, 0)
(__VA_ARGS__)
+ void qsort_chk (void *, size_t, size_t, int (*)(const void *, const void *));
++#endif
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
#endif
- /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/riscv32-esp-elf/gcc-bootstrap/Makefile
===================================================================
RCS file: /cvs/ports/devel/riscv32-esp-elf/gcc-bootstrap/Makefile,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 Makefile
--- devel/riscv32-esp-elf/gcc-bootstrap/Makefile 2 Jun 2026 12:44:38
-0000 1.4
+++ devel/riscv32-esp-elf/gcc-bootstrap/Makefile 26 Oct 2026 12:21:13
-0000
@@ -1,5 +1,3 @@
-BROKEN-powerpc64 = fails to apply patches/vecstep-*
-
COMMENT = bootstrap compiler for ${CONFIG} cross-development
V = 8.4.0
@@ -14,10 +12,6 @@ GH_TAGNAME = esp-2021r2
WANTLIB = ${COMPILER_LIBCXX} c gmp isl m mpc mpfr z
SUBST_VARS += V
-
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
BUILD_DEPENDS += devel/${CONFIG}/binutils
LIB_DEPENDS = devel/gmp \
Index: devel/riscv32-esp-elf/gcc-bootstrap/patches/patch-gcc_system_h
===================================================================
RCS file:
/cvs/ports/devel/riscv32-esp-elf/gcc-bootstrap/patches/patch-gcc_system_h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-gcc_system_h
--- devel/riscv32-esp-elf/gcc-bootstrap/patches/patch-gcc_system_h 13 Jul
2025 11:27:48 -0000 1.2
+++ devel/riscv32-esp-elf/gcc-bootstrap/patches/patch-gcc_system_h 26 Oct
2026 12:21:13 -0000
@@ -1,6 +1,9 @@
Fix build with libc++19, backport of
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -36,7 +39,7 @@ Index: gcc/system.h
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
# include <algorithm>
#endif
-@@ -229,12 +210,28 @@ extern int errno;
+@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
@@ -46,11 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
- # include <cstring>
- # include <new>
+@@ -237,6 +221,19 @@ extern int errno;
# include <utility>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -62,6 +64,21 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
++#endif
++
+ /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1207,6 +1204,12 @@ helper_const_non_const_cast (const char *p)
+ #undef qsort
+ #define qsort(...) PP_5th (__VA_ARGS__, qsort_chk, 3, 2, qsort, 0)
(__VA_ARGS__)
+ void qsort_chk (void *, size_t, size_t, int (*)(const void *, const void *));
++#endif
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
#endif
- /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/ti-msp430gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/ti-msp430gcc/Makefile,v
retrieving revision 1.23
diff -u -p -u -p -r1.23 Makefile
--- devel/ti-msp430gcc/Makefile 4 Jun 2026 10:54:15 -0000 1.23
+++ devel/ti-msp430gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -20,10 +20,6 @@ DIST_SUBDIR = ti-msp430gcc-$V
DISTFILES = msp430-gcc-source.tar.bz2 \
msp430-gcc-support-files.zip
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
WANTLIB += c gmp m mpc mpfr ${COMPILER_LIBCXX} z
BUILD_DEPENDS = archivers/bzip2 \
Index: devel/ti-msp430gcc/patches/patch-sources_tools_gcc_system_h
===================================================================
RCS file:
/cvs/ports/devel/ti-msp430gcc/patches/patch-sources_tools_gcc_system_h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-sources_tools_gcc_system_h
--- devel/ti-msp430gcc/patches/patch-sources_tools_gcc_system_h 11 Mar 2022
18:53:32 -0000 1.2
+++ devel/ti-msp430gcc/patches/patch-sources_tools_gcc_system_h 26 Oct 2026
12:21:13 -0000
@@ -2,6 +2,9 @@ Fix build with clang as system compiler.
/usr/include/c++/v1/exception:267:5: error: no member named 'fancy_abort' in namespace 'std::__1'; did you mean simply 'fancy_abort'?
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: sources/tools/gcc/system.h
--- sources/tools/gcc/system.h.orig
+++ sources/tools/gcc/system.h
@@ -13,3 +16,15 @@ Index: sources/tools/gcc/system.h
#endif
/* Some of glibc's string inlines cause warnings. Plus we'd rather
+@@ -1062,5 +1063,11 @@ helper_const_non_const_cast (const char *p)
+
+ /* Get definitions of HOST_WIDE_INT and HOST_WIDEST_INT. */
+ #include "hwint.h"
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
++#endif
+
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/ti-msp430gcc/patches/vecstep-sources_tools_gcc_tree-vect-loop_c
===================================================================
RCS file: devel/ti-msp430gcc/patches/vecstep-sources_tools_gcc_tree-vect-loop_c
diff -N devel/ti-msp430gcc/patches/vecstep-sources_tools_gcc_tree-vect-loop_c
--- devel/ti-msp430gcc/patches/vecstep-sources_tools_gcc_tree-vect-loop_c
11 Mar 2022 18:53:32 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-clang on powerpc64 defines vec_step already which collides with the
-symbol in gcc, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239266#c23
-renaming suggested at https://gcc.gnu.org/legacy-ml/gcc/2019-07/msg00131.html
-
-Index: sources/tools/gcc/tree-vect-loop.c
---- sources/tools/gcc/tree-vect-loop.c.orig
-+++ sources/tools/gcc/tree-vect-loop.c
-@@ -56,6 +56,8 @@ along with GCC; see the file COPYING3. If not see
- #include "tree-vectorizer.h"
- #include "target.h"
-
-+#define vec_step vec_step_
-+
- /* Loop Vectorization Pass.
-
- This pass tries to vectorize loops.
Index: devel/xtensa-elf/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/xtensa-elf/gcc/Makefile,v
retrieving revision 1.12
diff -u -p -u -p -r1.12 Makefile
--- devel/xtensa-elf/gcc/Makefile 22 Sep 2026 15:04:20 -0000 1.12
+++ devel/xtensa-elf/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -16,10 +16,6 @@ SITES= ${SITE_GCC:=releases/gcc-$(VERS
COMPILER = base-clang ports-gcc base-gcc
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
BUILD_DEPENDS+= devel/bison \
devel/xtensa-elf/binutils
Index: devel/xtensa-elf/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: devel/xtensa-elf/gcc/patches/patch-gcc_system_h
diff -N devel/xtensa-elf/gcc/patches/patch-gcc_system_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/xtensa-elf/gcc/patches/patch-gcc_system_h 26 Oct 2026 12:21:13
-0000
@@ -0,0 +1,17 @@
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
+Index: gcc/system.h
+--- gcc/system.h.orig
++++ gcc/system.h
+@@ -1131,4 +1131,10 @@ helper_const_non_const_cast (const char *p)
+ /* Get definitions of HOST_WIDE_INT. */
+ #include "hwint.h"
+
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
++#endif
++
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/xtensa-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c
===================================================================
RCS file: devel/xtensa-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c
diff -N devel/xtensa-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c
--- devel/xtensa-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c 11 Mar 2022
18:53:36 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-clang on powerpc64 defines vec_step already which collides with the
-symbol in gcc, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239266#c23
-renaming suggested at https://gcc.gnu.org/legacy-ml/gcc/2019-07/msg00131.html
-
-Index: gcc/tree-vect-loop.c
---- gcc/tree-vect-loop.c.orig
-+++ gcc/tree-vect-loop.c
-@@ -55,6 +55,8 @@ along with GCC; see the file COPYING3. If not see
- #include "vec-perm-indices.h"
- #include "tree-eh.h"
-
-+#define vec_step vec_step_
-+
- /* Loop Vectorization Pass.
-
- This pass tries to vectorize loops.
Index: devel/xtensa-esp32-elf/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/xtensa-esp32-elf/gcc/Makefile,v
retrieving revision 1.16
diff -u -p -u -p -r1.16 Makefile
--- devel/xtensa-esp32-elf/gcc/Makefile 2 Jun 2026 12:44:38 -0000 1.16
+++ devel/xtensa-esp32-elf/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -21,10 +21,6 @@ LIBELF = libelf-0.8.13
SITES.elf =
https://github.com/earlephilhower/esp-quick-toolchain/raw/master/blobs/
DISTFILES.elf = ${LIBELF}${EXTRACT_SUFX}
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
MODULES = lang/python
BUILD_DEPENDS += devel/${CONFIG}/binutils \
Index: devel/xtensa-esp32-elf/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: /cvs/ports/devel/xtensa-esp32-elf/gcc/patches/patch-gcc_system_h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-gcc_system_h
--- devel/xtensa-esp32-elf/gcc/patches/patch-gcc_system_h 13 Jul 2025
11:27:48 -0000 1.2
+++ devel/xtensa-esp32-elf/gcc/patches/patch-gcc_system_h 26 Oct 2026
12:21:13 -0000
@@ -1,6 +1,9 @@
Fix build with libc++19, backport of
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -36,7 +39,7 @@ Index: gcc/system.h
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
# include <algorithm>
#endif
-@@ -229,12 +210,28 @@ extern int errno;
+@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
@@ -46,11 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
- # include <cstring>
- # include <new>
+@@ -237,6 +221,19 @@ extern int errno;
# include <utility>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -62,6 +64,21 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
++#endif
++
+ /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1207,6 +1204,12 @@ helper_const_non_const_cast (const char *p)
+ #undef qsort
+ #define qsort(...) PP_5th (__VA_ARGS__, qsort_chk, 3, 2, qsort, 0)
(__VA_ARGS__)
+ void qsort_chk (void *, size_t, size_t, int (*)(const void *, const void *));
++#endif
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
#endif
- /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/xtensa-esp32-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c
===================================================================
RCS file: devel/xtensa-esp32-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c
diff -N devel/xtensa-esp32-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c
--- devel/xtensa-esp32-elf/gcc/patches/vecstep-gcc_tree-vect-loop_c 11 Mar
2022 18:53:37 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-clang on powerpc64 defines vec_step already which collides with the
-symbol in gcc, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239266#c23
-renaming suggested at https://gcc.gnu.org/legacy-ml/gcc/2019-07/msg00131.html
-
-Index: gcc/tree-vect-loop.c
---- gcc/tree-vect-loop.c.orig
-+++ gcc/tree-vect-loop.c
-@@ -55,6 +55,8 @@ along with GCC; see the file COPYING3. If not see
- #include "vec-perm-indices.h"
- #include "tree-eh.h"
-
-+#define vec_step vec_step_
-+
- /* Loop Vectorization Pass.
-
- This pass tries to vectorize loops.
Index: devel/xtensa-esp32-elf/gcc-bootstrap/Makefile
===================================================================
RCS file: /cvs/ports/devel/xtensa-esp32-elf/gcc-bootstrap/Makefile,v
retrieving revision 1.12
diff -u -p -u -p -r1.12 Makefile
--- devel/xtensa-esp32-elf/gcc-bootstrap/Makefile 2 Jun 2026 12:44:38
-0000 1.12
+++ devel/xtensa-esp32-elf/gcc-bootstrap/Makefile 26 Oct 2026 12:21:13
-0000
@@ -13,10 +13,6 @@ WANTLIB += ${COMPILER_LIBCXX} c gmp isl
SUBST_VARS += V
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
BUILD_DEPENDS += devel/${CONFIG}/binutils
LIB_DEPENDS = devel/gmp \
devel/mpfr \
Index: devel/xtensa-esp32-elf/gcc-bootstrap/patches/patch-gcc_system_h
===================================================================
RCS file:
/cvs/ports/devel/xtensa-esp32-elf/gcc-bootstrap/patches/patch-gcc_system_h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-gcc_system_h
--- devel/xtensa-esp32-elf/gcc-bootstrap/patches/patch-gcc_system_h 13 Jul
2025 11:27:48 -0000 1.2
+++ devel/xtensa-esp32-elf/gcc-bootstrap/patches/patch-gcc_system_h 26 Oct
2026 12:21:13 -0000
@@ -1,6 +1,9 @@
Fix build with libc++19, backport of
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -36,7 +39,7 @@ Index: gcc/system.h
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
# include <algorithm>
#endif
-@@ -229,12 +210,28 @@ extern int errno;
+@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
@@ -46,11 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
- # include <cstring>
- # include <new>
+@@ -237,6 +221,19 @@ extern int errno;
# include <utility>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -62,6 +64,21 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
++#endif
++
+ /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1207,6 +1204,12 @@ helper_const_non_const_cast (const char *p)
+ #undef qsort
+ #define qsort(...) PP_5th (__VA_ARGS__, qsort_chk, 3, 2, qsort, 0)
(__VA_ARGS__)
+ void qsort_chk (void *, size_t, size_t, int (*)(const void *, const void *));
++#endif
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
#endif
- /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/xtensa-esp32-elf/gcc-bootstrap/patches/vecstep-gcc_tree-vect-loop_c
===================================================================
RCS file:
devel/xtensa-esp32-elf/gcc-bootstrap/patches/vecstep-gcc_tree-vect-loop_c
diff -N
devel/xtensa-esp32-elf/gcc-bootstrap/patches/vecstep-gcc_tree-vect-loop_c
--- devel/xtensa-esp32-elf/gcc-bootstrap/patches/vecstep-gcc_tree-vect-loop_c
11 Mar 2022 18:53:37 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-clang on powerpc64 defines vec_step already which collides with the
-symbol in gcc, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239266#c23
-renaming suggested at https://gcc.gnu.org/legacy-ml/gcc/2019-07/msg00131.html
-
-Index: gcc/tree-vect-loop.c
---- gcc/tree-vect-loop.c.orig
-+++ gcc/tree-vect-loop.c
-@@ -55,6 +55,8 @@ along with GCC; see the file COPYING3. If not see
- #include "vec-perm-indices.h"
- #include "tree-eh.h"
-
-+#define vec_step vec_step_
-+
- /* Loop Vectorization Pass.
-
- This pass tries to vectorize loops.
Index: devel/xtensa-esp32s2-elf/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/xtensa-esp32s2-elf/gcc/Makefile,v
retrieving revision 1.10
diff -u -p -u -p -r1.10 Makefile
--- devel/xtensa-esp32s2-elf/gcc/Makefile 2 Jun 2026 12:44:38 -0000
1.10
+++ devel/xtensa-esp32s2-elf/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -21,10 +21,6 @@ LIBELF = libelf-0.8.13
SITES.elf =
https://github.com/earlephilhower/esp-quick-toolchain/raw/master/blobs/
DISTFILES.elf = ${LIBELF}${EXTRACT_SUFX}
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
MODULES = lang/python
BUILD_DEPENDS += devel/${CONFIG}/binutils \
Index: devel/xtensa-esp32s2-elf/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: /cvs/ports/devel/xtensa-esp32s2-elf/gcc/patches/patch-gcc_system_h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-gcc_system_h
--- devel/xtensa-esp32s2-elf/gcc/patches/patch-gcc_system_h 13 Jul 2025
11:27:48 -0000 1.2
+++ devel/xtensa-esp32s2-elf/gcc/patches/patch-gcc_system_h 26 Oct 2026
12:21:13 -0000
@@ -1,6 +1,9 @@
Fix build with libc++19, backport of
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -36,7 +39,7 @@ Index: gcc/system.h
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
# include <algorithm>
#endif
-@@ -229,12 +210,28 @@ extern int errno;
+@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
@@ -46,11 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
- # include <cstring>
- # include <new>
+@@ -237,6 +221,19 @@ extern int errno;
# include <utility>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -62,6 +64,21 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
++#endif
++
+ /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1207,6 +1204,12 @@ helper_const_non_const_cast (const char *p)
+ #undef qsort
+ #define qsort(...) PP_5th (__VA_ARGS__, qsort_chk, 3, 2, qsort, 0)
(__VA_ARGS__)
+ void qsort_chk (void *, size_t, size_t, int (*)(const void *, const void *));
++#endif
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
#endif
- /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/xtensa-esp32s2-elf/gcc-bootstrap/Makefile
===================================================================
RCS file: /cvs/ports/devel/xtensa-esp32s2-elf/gcc-bootstrap/Makefile,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 Makefile
--- devel/xtensa-esp32s2-elf/gcc-bootstrap/Makefile 2 Jun 2026 12:44:38
-0000 1.5
+++ devel/xtensa-esp32s2-elf/gcc-bootstrap/Makefile 26 Oct 2026 12:21:13
-0000
@@ -1,5 +1,3 @@
-BROKEN-powerpc64 = fails to apply patches/vecstep-*
-
COMMENT = bootstrap compiler for ${CONFIG} cross-development
V = 8.4.0
@@ -14,10 +12,6 @@ GH_TAGNAME = esp-2021r2
WANTLIB = ${COMPILER_LIBCXX} c gmp isl m mpc mpfr z
SUBST_VARS += V
-
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
BUILD_DEPENDS += devel/${CONFIG}/binutils
LIB_DEPENDS = devel/gmp \
Index: devel/xtensa-esp32s2-elf/gcc-bootstrap/patches/patch-gcc_system_h
===================================================================
RCS file:
/cvs/ports/devel/xtensa-esp32s2-elf/gcc-bootstrap/patches/patch-gcc_system_h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-gcc_system_h
--- devel/xtensa-esp32s2-elf/gcc-bootstrap/patches/patch-gcc_system_h 13 Jul
2025 11:27:48 -0000 1.2
+++ devel/xtensa-esp32s2-elf/gcc-bootstrap/patches/patch-gcc_system_h 26 Oct
2026 12:21:13 -0000
@@ -1,6 +1,9 @@
Fix build with libc++19, backport of
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -36,7 +39,7 @@ Index: gcc/system.h
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
# include <algorithm>
#endif
-@@ -229,12 +210,28 @@ extern int errno;
+@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
@@ -46,11 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
- # include <cstring>
- # include <new>
+@@ -237,6 +221,19 @@ extern int errno;
# include <utility>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -62,6 +64,21 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
++#endif
++
+ /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1207,6 +1204,12 @@ helper_const_non_const_cast (const char *p)
+ #undef qsort
+ #define qsort(...) PP_5th (__VA_ARGS__, qsort_chk, 3, 2, qsort, 0)
(__VA_ARGS__)
+ void qsort_chk (void *, size_t, size_t, int (*)(const void *, const void *));
++#endif
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
#endif
- /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/xtensa-esp32s3-elf/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/xtensa-esp32s3-elf/gcc/Makefile,v
retrieving revision 1.10
diff -u -p -u -p -r1.10 Makefile
--- devel/xtensa-esp32s3-elf/gcc/Makefile 2 Jun 2026 12:44:38 -0000
1.10
+++ devel/xtensa-esp32s3-elf/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -21,10 +21,6 @@ LIBELF = libelf-0.8.13
SITES.elf =
https://github.com/earlephilhower/esp-quick-toolchain/raw/master/blobs/
DISTFILES.elf = ${LIBELF}${EXTRACT_SUFX}
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
MODULES = lang/python
BUILD_DEPENDS += devel/${CONFIG}/binutils \
Index: devel/xtensa-esp32s3-elf/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: /cvs/ports/devel/xtensa-esp32s3-elf/gcc/patches/patch-gcc_system_h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-gcc_system_h
--- devel/xtensa-esp32s3-elf/gcc/patches/patch-gcc_system_h 13 Jul 2025
11:27:48 -0000 1.2
+++ devel/xtensa-esp32s3-elf/gcc/patches/patch-gcc_system_h 26 Oct 2026
12:21:13 -0000
@@ -1,6 +1,9 @@
Fix build with libc++19, backport of
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -36,7 +39,7 @@ Index: gcc/system.h
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
# include <algorithm>
#endif
-@@ -229,12 +210,28 @@ extern int errno;
+@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
@@ -46,11 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
- # include <cstring>
- # include <new>
+@@ -237,6 +221,19 @@ extern int errno;
# include <utility>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -62,6 +64,21 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
++#endif
++
+ /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1207,6 +1204,12 @@ helper_const_non_const_cast (const char *p)
+ #undef qsort
+ #define qsort(...) PP_5th (__VA_ARGS__, qsort_chk, 3, 2, qsort, 0)
(__VA_ARGS__)
+ void qsort_chk (void *, size_t, size_t, int (*)(const void *, const void *));
++#endif
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
#endif
- /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/xtensa-esp32s3-elf/gcc-bootstrap/Makefile
===================================================================
RCS file: /cvs/ports/devel/xtensa-esp32s3-elf/gcc-bootstrap/Makefile,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 Makefile
--- devel/xtensa-esp32s3-elf/gcc-bootstrap/Makefile 2 Jun 2026 12:44:38
-0000 1.5
+++ devel/xtensa-esp32s3-elf/gcc-bootstrap/Makefile 26 Oct 2026 12:21:13
-0000
@@ -1,5 +1,3 @@
-BROKEN-powerpc64 = fails to apply patches/vecstep-*
-
COMMENT = bootstrap compiler for ${CONFIG} cross-development
V = 8.4.0
@@ -14,10 +12,6 @@ GH_TAGNAME = esp-2021r2
WANTLIB = ${COMPILER_LIBCXX} c gmp isl m mpc mpfr z
SUBST_VARS += V
-
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
BUILD_DEPENDS += devel/${CONFIG}/binutils
LIB_DEPENDS = devel/gmp \
Index: devel/xtensa-esp32s3-elf/gcc-bootstrap/patches/patch-gcc_system_h
===================================================================
RCS file:
/cvs/ports/devel/xtensa-esp32s3-elf/gcc-bootstrap/patches/patch-gcc_system_h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-gcc_system_h
--- devel/xtensa-esp32s3-elf/gcc-bootstrap/patches/patch-gcc_system_h 13 Jul
2025 11:27:48 -0000 1.2
+++ devel/xtensa-esp32s3-elf/gcc-bootstrap/patches/patch-gcc_system_h 26 Oct
2026 12:21:13 -0000
@@ -1,6 +1,9 @@
Fix build with libc++19, backport of
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -36,7 +39,7 @@ Index: gcc/system.h
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
# include <algorithm>
#endif
-@@ -229,12 +210,28 @@ extern int errno;
+@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
@@ -46,11 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
- # include <cstring>
- # include <new>
+@@ -237,6 +221,19 @@ extern int errno;
# include <utility>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -62,6 +64,21 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
++#endif
++
+ /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1207,6 +1204,12 @@ helper_const_non_const_cast (const char *p)
+ #undef qsort
+ #define qsort(...) PP_5th (__VA_ARGS__, qsort_chk, 3, 2, qsort, 0)
(__VA_ARGS__)
+ void qsort_chk (void *, size_t, size_t, int (*)(const void *, const void *));
++#endif
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
#endif
- /* Some of glibc's string inlines cause warnings. Plus we'd rather
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/xtensa-lx106-elf/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/xtensa-lx106-elf/gcc/Makefile,v
retrieving revision 1.22
diff -u -p -u -p -r1.22 Makefile
--- devel/xtensa-lx106-elf/gcc/Makefile 2 Jun 2026 12:44:38 -0000 1.22
+++ devel/xtensa-lx106-elf/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -35,10 +35,6 @@ LIBELF = libelf-0.8.13
SITES.elf =
https://github.com/earlephilhower/esp-quick-toolchain/raw/master/blobs/
DISTFILES.elf = ${LIBELF}${EXTRACT_SUFX}
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
MODULES = lang/python
BUILD_DEPENDS += devel/${CONFIG}/binutils \
Index: devel/xtensa-lx106-elf/gcc/patches/patch-gcc_system_h
===================================================================
RCS file: /cvs/ports/devel/xtensa-lx106-elf/gcc/patches/patch-gcc_system_h,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-gcc_system_h
--- devel/xtensa-lx106-elf/gcc/patches/patch-gcc_system_h 3 Jul 2025
20:44:33 -0000 1.1
+++ devel/xtensa-lx106-elf/gcc/patches/patch-gcc_system_h 26 Oct 2026
12:21:13 -0000
@@ -1,6 +1,9 @@
Fix build with libc++19, backport of
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -36,7 +39,7 @@ Index: gcc/system.h
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
# include <algorithm>
#endif
-@@ -229,12 +210,28 @@ extern int errno;
+@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
@@ -46,11 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
- # include <cstring>
- # include <new>
+@@ -237,6 +221,19 @@ extern int errno;
# include <utility>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -62,6 +64,20 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
- #endif
-
++#endif
++
/* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1243,5 +1240,11 @@ void gcc_stablesort (void *, size_t, size_t,
+ /* Format string particle for printing a SIZE_AMOUNT with N being the width
+ of the number. */
+ #define PRsa(n) "%" #n PRIu64 "%c"
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
++#endif
+
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/xtensa-lx106-elf/gcc-bootstrap/Makefile
===================================================================
RCS file: /cvs/ports/devel/xtensa-lx106-elf/gcc-bootstrap/Makefile,v
retrieving revision 1.13
diff -u -p -u -p -r1.13 Makefile
--- devel/xtensa-lx106-elf/gcc-bootstrap/Makefile 2 Jun 2026 12:44:38
-0000 1.13
+++ devel/xtensa-lx106-elf/gcc-bootstrap/Makefile 26 Oct 2026 12:21:13
-0000
@@ -1,5 +1,3 @@
-BROKEN-powerpc64 = fails to apply patches/vecstep-*
-
COMMENT = bootstrap compiler for ${CONFIG} cross-development
VERSION = 10.2.0
@@ -28,10 +26,6 @@ PATCHFILES.p = gcc-ctype-inline-pgmread
gcc-xtensa-implement-bswapsi2-bswapdi2-and-helpers.patch \
gcc-xtensa-rearrange-DI-mode-constant-loading.patch
PATCH_DIST_STRIP = -p1
-
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
BUILD_DEPENDS += devel/${CONFIG}/binutils
LIB_DEPENDS = devel/gmp \
Index: devel/xtensa-lx106-elf/gcc-bootstrap/patches/patch-gcc_system_h
===================================================================
RCS file:
/cvs/ports/devel/xtensa-lx106-elf/gcc-bootstrap/patches/patch-gcc_system_h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-gcc_system_h
--- devel/xtensa-lx106-elf/gcc-bootstrap/patches/patch-gcc_system_h 13 Jul
2025 11:27:48 -0000 1.2
+++ devel/xtensa-lx106-elf/gcc-bootstrap/patches/patch-gcc_system_h 26 Oct
2026 12:21:13 -0000
@@ -1,6 +1,9 @@
Fix build with libc++19, backport of
https://gcc.gnu.org/cgit/gcc/patch/?id=a995fded34fe488153b06bb41e026277f01efded
+- system.h: rename vec_step to workaround powerpc/clang bug
+ 8046a7e2aeeae80c15d99d55ae04755aedf46a2f
+
Index: gcc/system.h
--- gcc/system.h.orig
+++ gcc/system.h
@@ -36,7 +39,7 @@ Index: gcc/system.h
#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
# include <algorithm>
#endif
-@@ -229,12 +210,28 @@ extern int errno;
+@@ -229,6 +210,9 @@ extern int errno;
#ifdef INCLUDE_SET
# include <set>
#endif
@@ -46,11 +49,10 @@ Index: gcc/system.h
#ifdef INCLUDE_VECTOR
# include <vector>
#endif
- # include <cstring>
- # include <new>
+@@ -237,6 +221,19 @@ extern int errno;
# include <utility>
-+#endif
-+
+ #endif
+
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. */
@@ -62,6 +64,20 @@ Index: gcc/system.h
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
- #endif
-
++#endif
++
/* Some of glibc's string inlines cause warnings. Plus we'd rather
+ rely on (and therefore test) GCC's string builtins. */
+ #define __NO_STRING_INLINES
+@@ -1243,5 +1240,11 @@ void gcc_stablesort (void *, size_t, size_t,
+ /* Format string particle for printing a SIZE_AMOUNT with N being the width
+ of the number. */
+ #define PRsa(n) "%" #n PRIu64 "%c"
++
++/* Workaround clang on PowerPC which has vec_step as reserved keyword
++ rather than function-like macro defined in <altivec.h>. See PR114369. */
++#if defined(__clang__) && defined(__powerpc__)
++#define vec_step vec_step_
++#endif
+
+ #endif /* ! GCC_SYSTEM_H */
Index: devel/x86_64-elf/gcc/Makefile
===================================================================
RCS file: /cvs/ports/devel/x86_64-elf/gcc/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 Makefile
--- devel/x86_64-elf/gcc/Makefile 25 Jan 2026 18:43:28 -0000 1.1.1.1
+++ devel/x86_64-elf/gcc/Makefile 26 Oct 2026 12:21:13 -0000
@@ -14,10 +14,6 @@ COMPILER = base-clang ports-gcc base-gcc
SITES= ${SITE_GCC:=releases/gcc-$(VERSION)/}
-.if ${MACHINE_ARCH} == "powerpc64"
-PATCH_LIST = patch-* vecstep-*
-.endif
-
BUILD_DEPENDS+= devel/bison \
${RUN_DEPENDS}
LIB_DEPENDS= devel/mpfr devel/libmpc