From 7e7c8837a3ec8da93ee21483f1607487e764ab18 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Tue, 10 Jun 2025 21:43:07 +0200 Subject: [PATCH] gcc: update to 14.3 Update to 14.3 which is the new default, otherwise GCC fails building on buildbots. Signed-off-by: Robert Marko --- devel/gcc/Makefile | 4 +- .../gcc/patches-14.x/010-documentation.patch | 2 +- .../patches-14.x/110-Fix-MIPS-PR-84790.patch | 20 -------- devel/gcc/patches-14.x/230-musl_libssp.patch | 2 +- .../300-mips_Os_cpu_rtx_cost_model.patch | 2 +- devel/gcc/patches-14.x/820-libgcc_pic.patch | 2 +- .../patches-14.x/830-aarch64-libatomic.patch | 32 +++++++++++++ .../920-specs_nonfatal_getenv.patch | 2 +- .../980-fix-build-error-with-Xcode-16.3.patch | 47 +++++++++++++++++++ 9 files changed, 86 insertions(+), 27 deletions(-) delete mode 100644 devel/gcc/patches-14.x/110-Fix-MIPS-PR-84790.patch create mode 100644 devel/gcc/patches-14.x/830-aarch64-libatomic.patch create mode 100644 devel/gcc/patches-14.x/980-fix-build-error-with-Xcode-16.3.patch diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index 2e8bbaa5ff..abed05da44 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -55,8 +55,8 @@ ifeq ($(PKG_VERSION),13.3.0) PKG_HASH:=0845e9621c9543a13f484e94584a49ffc0129970e9914624235fc1d061a0c083 endif -ifeq ($(PKG_VERSION),14.2.0) - PKG_HASH:=a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9 +ifeq ($(PKG_VERSION),14.3.0) + PKG_HASH:=e0dc77297625631ac8e50fa92fffefe899a4eb702592da5c32ef04e2293aca3a endif PATCH_DIR:=patches-$(GCC_MAJOR_VERSION).x diff --git a/devel/gcc/patches-14.x/010-documentation.patch b/devel/gcc/patches-14.x/010-documentation.patch index 7cf59d3a99..df9dff9a4f 100644 --- a/devel/gcc/patches-14.x/010-documentation.patch +++ b/devel/gcc/patches-14.x/010-documentation.patch @@ -12,7 +12,7 @@ Date: Tue Feb 26 16:16:33 2013 +0000 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in -@@ -3549,18 +3549,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) +@@ -3550,18 +3550,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) doc/gccint.info: $(TEXI_GCCINT_FILES) doc/cppinternals.info: $(TEXI_CPPINT_FILES) diff --git a/devel/gcc/patches-14.x/110-Fix-MIPS-PR-84790.patch b/devel/gcc/patches-14.x/110-Fix-MIPS-PR-84790.patch deleted file mode 100644 index bd5d1f344b..0000000000 --- a/devel/gcc/patches-14.x/110-Fix-MIPS-PR-84790.patch +++ /dev/null @@ -1,20 +0,0 @@ -Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790. -MIPS16 functions have a static assembler prologue which clobbers -registers v0 and v1. Add these register clobbers to function call -instructions. - ---- a/gcc/config/mips/mips.cc -+++ b/gcc/config/mips/mips.cc -@@ -3227,6 +3227,12 @@ mips_emit_call_insn (rtx pattern, rtx or - emit_insn (gen_update_got_version ()); - } - -+ if (TARGET_MIPS16 && TARGET_USE_GOT) -+ { -+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS16_PIC_TEMP); -+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS_PROLOGUE_TEMP (word_mode)); -+ } -+ - if (TARGET_MIPS16 - && TARGET_EXPLICIT_RELOCS - && TARGET_CALL_CLOBBERED_GP) diff --git a/devel/gcc/patches-14.x/230-musl_libssp.patch b/devel/gcc/patches-14.x/230-musl_libssp.patch index 3ce5e49587..f8dc9448a0 100644 --- a/devel/gcc/patches-14.x/230-musl_libssp.patch +++ b/devel/gcc/patches-14.x/230-musl_libssp.patch @@ -1,6 +1,6 @@ --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -985,7 +985,9 @@ proper position among the other output f +@@ -989,7 +989,9 @@ proper position among the other output f #endif #ifndef LINK_SSP_SPEC diff --git a/devel/gcc/patches-14.x/300-mips_Os_cpu_rtx_cost_model.patch b/devel/gcc/patches-14.x/300-mips_Os_cpu_rtx_cost_model.patch index 2cbffe4517..11940960ab 100644 --- a/devel/gcc/patches-14.x/300-mips_Os_cpu_rtx_cost_model.patch +++ b/devel/gcc/patches-14.x/300-mips_Os_cpu_rtx_cost_model.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/gcc/config/mips/mips.cc +++ b/gcc/config/mips/mips.cc -@@ -20453,7 +20453,7 @@ mips_option_override (void) +@@ -20447,7 +20447,7 @@ mips_option_override (void) flag_pcc_struct_return = 0; /* Decide which rtx_costs structure to use. */ diff --git a/devel/gcc/patches-14.x/820-libgcc_pic.patch b/devel/gcc/patches-14.x/820-libgcc_pic.patch index 3ab73f4857..85b148bfa3 100644 --- a/devel/gcc/patches-14.x/820-libgcc_pic.patch +++ b/devel/gcc/patches-14.x/820-libgcc_pic.patch @@ -31,7 +31,7 @@ Date: Mon Oct 19 23:26:09 2009 +0000 ifneq ($(LIBUNWIND),) all: libunwind$(SHLIB_EXT) libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1174,6 +1175,10 @@ install-shared: +@@ -1177,6 +1178,10 @@ install-shared: chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a diff --git a/devel/gcc/patches-14.x/830-aarch64-libatomic.patch b/devel/gcc/patches-14.x/830-aarch64-libatomic.patch new file mode 100644 index 0000000000..80d9b5438c --- /dev/null +++ b/devel/gcc/patches-14.x/830-aarch64-libatomic.patch @@ -0,0 +1,32 @@ +libatomic: Do not enforce march on aarch64 + +Inspired by The Yocto Project [1]. + +[1] https://github.com/yoctoproject/poky/blob/51192a79f1717786dda42776f916c3d97ada7971/meta/recipes-devtools/gcc/gcc/0022-libatomic-Do-not-enforce-march-on-aarch64.patch + +Signed-off-by: Konstantin Demin + + libatomic/Makefile.am | 1 - + libatomic/Makefile.in | 1 - + 2 files changed, 2 deletions(-) + +--- a/libatomic/Makefile.am ++++ b/libatomic/Makefile.am +@@ -130,7 +130,6 @@ libatomic_la_LIBADD = $(foreach s,$(SIZE + ## On a target-specific basis, include alternates to be selected by IFUNC. + if HAVE_IFUNC + if ARCH_AARCH64_LINUX +-IFUNC_OPTIONS = -march=armv8-a+lse + libatomic_la_LIBADD += $(foreach s,$(SIZES),$(addsuffix _$(s)_1_.lo,$(SIZEOBJS))) + + endif +--- a/libatomic/Makefile.in ++++ b/libatomic/Makefile.in +@@ -452,7 +452,6 @@ M_SRC = $(firstword $(filter %/$(M_FILE) + libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix \ + _$(s)_.lo,$(SIZEOBJS))) $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_4) +-@ARCH_AARCH64_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv8-a+lse + @ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv7-a+fp -DHAVE_KERNEL64 + @ARCH_I386_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=i586 + @ARCH_X86_64_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -mcx16 -mcx16 diff --git a/devel/gcc/patches-14.x/920-specs_nonfatal_getenv.patch b/devel/gcc/patches-14.x/920-specs_nonfatal_getenv.patch index 121b684a2c..a1b34f40fc 100644 --- a/devel/gcc/patches-14.x/920-specs_nonfatal_getenv.patch +++ b/devel/gcc/patches-14.x/920-specs_nonfatal_getenv.patch @@ -7,7 +7,7 @@ Date: Sat Apr 21 03:02:39 2012 +0000 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -10319,8 +10319,10 @@ getenv_spec_function (int argc, const ch +@@ -10337,8 +10337,10 @@ getenv_spec_function (int argc, const ch } if (!value) diff --git a/devel/gcc/patches-14.x/980-fix-build-error-with-Xcode-16.3.patch b/devel/gcc/patches-14.x/980-fix-build-error-with-Xcode-16.3.patch new file mode 100644 index 0000000000..c55100133c --- /dev/null +++ b/devel/gcc/patches-14.x/980-fix-build-error-with-Xcode-16.3.patch @@ -0,0 +1,47 @@ +From 93954654b87552c4fe0273cab99d0f42f213f7f8 Mon Sep 17 00:00:00 2001 +From: Georgi Valkov +Date: Mon, 14 Apr 2025 15:45:59 +0300 +Subject: [PATCH] zlib: fix build error with Xcode 16.3 + +Xcode 16.3 defines TARGET_OS_MAC, it was not defined in prior versions. +zutil.h conditionally defines fdopen as NULL when this macro is defined, +resulting in the following build error: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7: error: expected identifier or '(' + 318 | FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen)); + | ^ +./zutil.h:147:33: note: expanded from macro 'fdopen' + 147 | # define fdopen(fd,mode) NULL /* No fdopen() */ + +In Xcode 16.2 and earlier, TARGET_OS_MAC was not defined so this entire +block was ignored, gcc and gdb used to compile and work fine. + +This may have been used for compatibility with older versions of macOS, +but is no longer needed. By pure luck, the build worked fine for a long +time, because it did not properly detect macOS. +Fixed by removing the check for TARGET_OS_MAC. + +Note that since Xcode 16.3, an entire set of TARGET_OS macros +are now defined, most of which are set to 0: +TARGET_OS_LINUX 0 +TARGET_OS_MAC 1 +TARGET_OS_OSX 1 + +[1] https://github.com/openwrt/openwrt/pull/18467 + +Signed-off-by: Georgi Valkov +--- + zlib/zutil.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/zlib/zutil.h ++++ b/zlib/zutil.h +@@ -130,7 +130,7 @@ 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