diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index dd61d1e21..0565b1ec9 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -19,7 +19,7 @@ config GCC_VERSION default "7.5.0" if GCC_VERSION_7 default "9.3.0" if GCC_VERSION_9 default "10.3.0" if GCC_VERSION_10 - default "11.2.0" if GCC_VERSION_11 + default "11.3.0" if GCC_VERSION_11 default "8.4.0" config GCC_USE_IREMAP diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index 76230ffc6..0b2f7cdc0 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -44,8 +44,8 @@ ifeq ($(PKG_VERSION),10.3.0) PKG_HASH:=64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344 endif -ifeq ($(PKG_VERSION),11.2.0) - PKG_HASH:=d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b +ifeq ($(PKG_VERSION),11.3.0) + PKG_HASH:=b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39 endif PATCH_DIR=../patches/$(GCC_VERSION) diff --git a/toolchain/gcc/patches/11.2.0/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/11.2.0/930-fix-mips-noexecstack.patch deleted file mode 100644 index 591dfe5a5..000000000 --- a/toolchain/gcc/patches/11.2.0/930-fix-mips-noexecstack.patch +++ /dev/null @@ -1,111 +0,0 @@ -From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 -From: Andrew McDonnell -Date: Fri, 3 Oct 2014 19:09:00 +0930 -Subject: Add .note.GNU-stack section - -See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html -Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html - -Re: [Patch, MIPS] Add .note.GNU-stack section - - From: Steve Ellcey - -On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: -> -> -> On Wed, Sep 10, 2014 at 9:27 AM, wrote: - -> This works except you did not update the assembly files in -> libgcc or glibc. We (Cavium) have the same patch in our tree -> for a few released versions. - -> Mind just checking yours in then Andrew? - -> Thanks! -> -eric - -I talked to Andrew about what files he changed in GCC and created and -tested this new patch. Andrew also mentioned changing some assembly -files in glibc but I don't see any use of '.section .note.GNU-stack' in -any assembly files in glibc (for any platform) so I wasn't planning on -creating a glibc to add them to mips glibc assembly language files. - -OK to check in this patch? - -Steve Ellcey -sellcey@mips.com - - - -2014-09-26 Steve Ellcey ---- - gcc/config/mips/mips.c | 3 +++ - libgcc/config/mips/crti.S | 4 ++++ - libgcc/config/mips/crtn.S | 3 +++ - libgcc/config/mips/mips16.S | 4 ++++ - libgcc/config/mips/vr4120-div.S | 4 ++++ - 5 files changed, 18 insertions(+) - ---- a/gcc/config/mips/mips.c -+++ b/gcc/config/mips/mips.c -@@ -22890,6 +22890,9 @@ mips_asm_file_end (void) - #define TARGET_ASM_FILE_END mips_asm_file_end - - -+#undef TARGET_ASM_FILE_END -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack -+ - struct gcc_target targetm = TARGET_INITIALIZER; - - #include "gt-mips.h" ---- a/libgcc/config/mips/crti.S -+++ b/libgcc/config/mips/crti.S -@@ -24,6 +24,10 @@ see the files COPYING3 and COPYING.RUNTI - /* An executable stack is *not* required for these functions. */ - #include "gnustack.h" - -+ -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ - /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. - Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ - ---- a/libgcc/config/mips/crtn.S -+++ b/libgcc/config/mips/crtn.S -@@ -24,6 +24,9 @@ see the files COPYING3 and COPYING.RUNTI - /* An executable stack is *not* required for these functions. */ - #include "gnustack.h" - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ - /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. - Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ - ---- a/libgcc/config/mips/mips16.S -+++ b/libgcc/config/mips/mips16.S -@@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI - values using the soft-float calling convention, but do the actual - operation using the hard floating point instructions. */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ .previous -+ - #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) - - /* This file contains 32-bit assembly code. */ ---- a/libgcc/config/mips/vr4120-div.S -+++ b/libgcc/config/mips/vr4120-div.S -@@ -29,6 +29,10 @@ see the files COPYING3 and COPYING.RUNTI - -mfix-vr4120. div and ddiv do not give the correct result when one - of the operands is negative. */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ .previous -+ - .set nomips16 - - #define DIV \ diff --git a/toolchain/gcc/patches/11.2.0/002-case_insensitive.patch b/toolchain/gcc/patches/11.3.0/002-case_insensitive.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/002-case_insensitive.patch rename to toolchain/gcc/patches/11.3.0/002-case_insensitive.patch diff --git a/toolchain/gcc/patches/11.2.0/010-documentation.patch b/toolchain/gcc/patches/11.3.0/010-documentation.patch similarity index 94% rename from toolchain/gcc/patches/11.2.0/010-documentation.patch rename to toolchain/gcc/patches/11.3.0/010-documentation.patch index 885bd0301..25a5e1e99 100644 --- a/toolchain/gcc/patches/11.2.0/010-documentation.patch +++ b/toolchain/gcc/patches/11.3.0/010-documentation.patch @@ -12,7 +12,7 @@ Date: Tue Feb 26 16:16:33 2013 +0000 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in -@@ -3355,18 +3355,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) +@@ -3348,18 +3348,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) doc/gccint.info: $(TEXI_GCCINT_FILES) doc/cppinternals.info: $(TEXI_CPPINT_FILES) diff --git a/toolchain/gcc/patches/11.3.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch b/toolchain/gcc/patches/11.3.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch new file mode 100644 index 000000000..423def600 --- /dev/null +++ b/toolchain/gcc/patches/11.3.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch @@ -0,0 +1,46 @@ +From ea650cae26da4a8fc04f0c4666f4dd776d0b5fc0 Mon Sep 17 00:00:00 2001 +From: Ilya Lipnitskiy +Date: Sun, 14 Nov 2021 21:54:25 -0800 +Subject: [PATCH] configure: define TARGET_LIBC_GNUSTACK on musl + +musl only uses PT_GNU_STACK to set default thread stack size and has no +executable stack support[0], so there is no reason not to emit the +.note.GNU-stack section on musl builds. + +[0]: https://lore.kernel.org/all/20190423192534.GN23599@brightrain.aerifal.cx/T/#u + +gcc/ChangeLog: + + * configure: Regenerate. + * configure.ac: define TARGET_LIBC_GNUSTACK on musl + +Signed-off-by: Ilya Lipnitskiy +--- + gcc/configure | 3 +++ + gcc/configure.ac | 3 +++ + 2 files changed, 6 insertions(+) + +--- a/gcc/configure ++++ b/gcc/configure +@@ -31533,6 +31533,9 @@ fi + # Check if the target LIBC handles PT_GNU_STACK. + gcc_cv_libc_gnustack=unknown + case "$target" in ++ mips*-*-linux-musl*) ++ gcc_cv_libc_gnustack=yes ++ ;; + mips*-*-linux*) + + if test $glibc_version_major -gt 2 \ +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -7023,6 +7023,9 @@ fi + # Check if the target LIBC handles PT_GNU_STACK. + gcc_cv_libc_gnustack=unknown + case "$target" in ++ mips*-*-linux-musl*) ++ gcc_cv_libc_gnustack=yes ++ ;; + mips*-*-linux*) + GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], ) + ;; diff --git a/toolchain/gcc/patches/11.2.0/110-Fix-MIPS-PR-84790.patch b/toolchain/gcc/patches/11.3.0/110-Fix-MIPS-PR-84790.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/110-Fix-MIPS-PR-84790.patch rename to toolchain/gcc/patches/11.3.0/110-Fix-MIPS-PR-84790.patch diff --git a/toolchain/gcc/patches/11.2.0/230-musl_libssp.patch b/toolchain/gcc/patches/11.3.0/230-musl_libssp.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/230-musl_libssp.patch rename to toolchain/gcc/patches/11.3.0/230-musl_libssp.patch diff --git a/toolchain/gcc/patches/11.2.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/11.3.0/300-mips_Os_cpu_rtx_cost_model.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/300-mips_Os_cpu_rtx_cost_model.patch rename to toolchain/gcc/patches/11.3.0/300-mips_Os_cpu_rtx_cost_model.patch diff --git a/toolchain/gcc/patches/11.2.0/810-arm-softfloat-libgcc.patch b/toolchain/gcc/patches/11.3.0/810-arm-softfloat-libgcc.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/810-arm-softfloat-libgcc.patch rename to toolchain/gcc/patches/11.3.0/810-arm-softfloat-libgcc.patch diff --git a/toolchain/gcc/patches/11.2.0/820-libgcc_pic.patch b/toolchain/gcc/patches/11.3.0/820-libgcc_pic.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/820-libgcc_pic.patch rename to toolchain/gcc/patches/11.3.0/820-libgcc_pic.patch diff --git a/toolchain/gcc/patches/11.2.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/11.3.0/840-armv4_pass_fix-v4bx_to_ld.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/840-armv4_pass_fix-v4bx_to_ld.patch rename to toolchain/gcc/patches/11.3.0/840-armv4_pass_fix-v4bx_to_ld.patch diff --git a/toolchain/gcc/patches/11.2.0/850-use_shared_libgcc.patch b/toolchain/gcc/patches/11.3.0/850-use_shared_libgcc.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/850-use_shared_libgcc.patch rename to toolchain/gcc/patches/11.3.0/850-use_shared_libgcc.patch diff --git a/toolchain/gcc/patches/11.2.0/851-libgcc_no_compat.patch b/toolchain/gcc/patches/11.3.0/851-libgcc_no_compat.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/851-libgcc_no_compat.patch rename to toolchain/gcc/patches/11.3.0/851-libgcc_no_compat.patch diff --git a/toolchain/gcc/patches/11.2.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/11.3.0/870-ppc_no_crtsavres.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/870-ppc_no_crtsavres.patch rename to toolchain/gcc/patches/11.3.0/870-ppc_no_crtsavres.patch diff --git a/toolchain/gcc/patches/11.2.0/881-no_tm_section.patch b/toolchain/gcc/patches/11.3.0/881-no_tm_section.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/881-no_tm_section.patch rename to toolchain/gcc/patches/11.3.0/881-no_tm_section.patch diff --git a/toolchain/gcc/patches/11.2.0/900-bad-mips16-crt.patch b/toolchain/gcc/patches/11.3.0/900-bad-mips16-crt.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/900-bad-mips16-crt.patch rename to toolchain/gcc/patches/11.3.0/900-bad-mips16-crt.patch diff --git a/toolchain/gcc/patches/11.2.0/910-mbsd_multi.patch b/toolchain/gcc/patches/11.3.0/910-mbsd_multi.patch similarity index 97% rename from toolchain/gcc/patches/11.2.0/910-mbsd_multi.patch rename to toolchain/gcc/patches/11.3.0/910-mbsd_multi.patch index 9f9d3226e..21f532043 100644 --- a/toolchain/gcc/patches/11.2.0/910-mbsd_multi.patch +++ b/toolchain/gcc/patches/11.3.0/910-mbsd_multi.patch @@ -40,7 +40,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 case OPT_fconstant_string_class_: constant_string_class_name = arg; break; -@@ -1196,6 +1205,47 @@ c_common_init (void) +@@ -1198,6 +1207,47 @@ c_common_init (void) return false; } @@ -114,7 +114,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 ; On SVR4 targets, it also controls whether or not to emit a --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -9055,6 +9055,17 @@ This option is only supported for C and +@@ -9058,6 +9058,17 @@ This option is only supported for C and @option{-Wall} and by @option{-Wpedantic}, which can be disabled with @option{-Wno-pointer-sign}. diff --git a/toolchain/gcc/patches/11.2.0/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/11.3.0/920-specs_nonfatal_getenv.patch similarity index 90% rename from toolchain/gcc/patches/11.2.0/920-specs_nonfatal_getenv.patch rename to toolchain/gcc/patches/11.3.0/920-specs_nonfatal_getenv.patch index dda33c020..83bcb25a8 100644 --- a/toolchain/gcc/patches/11.2.0/920-specs_nonfatal_getenv.patch +++ b/toolchain/gcc/patches/11.3.0/920-specs_nonfatal_getenv.patch @@ -7,7 +7,7 @@ Date: Sat Apr 21 03:02:39 2012 +0000 --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -10100,8 +10100,10 @@ getenv_spec_function (int argc, const ch +@@ -10106,8 +10106,10 @@ getenv_spec_function (int argc, const ch } if (!value) diff --git a/toolchain/gcc/patches/11.2.0/931-libffi-fix-MIPS-softfloat-build-issue.patch b/toolchain/gcc/patches/11.3.0/931-libffi-fix-MIPS-softfloat-build-issue.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/931-libffi-fix-MIPS-softfloat-build-issue.patch rename to toolchain/gcc/patches/11.3.0/931-libffi-fix-MIPS-softfloat-build-issue.patch diff --git a/toolchain/gcc/patches/11.2.0/960-gotools-fix-compilation-when-making-cross-compiler.patch b/toolchain/gcc/patches/11.3.0/960-gotools-fix-compilation-when-making-cross-compiler.patch similarity index 100% rename from toolchain/gcc/patches/11.2.0/960-gotools-fix-compilation-when-making-cross-compiler.patch rename to toolchain/gcc/patches/11.3.0/960-gotools-fix-compilation-when-making-cross-compiler.patch diff --git a/toolchain/gcc/patches/11.3.0/970-macos_arm64-building-fix.patch b/toolchain/gcc/patches/11.3.0/970-macos_arm64-building-fix.patch new file mode 100644 index 000000000..424899eb9 --- /dev/null +++ b/toolchain/gcc/patches/11.3.0/970-macos_arm64-building-fix.patch @@ -0,0 +1,45 @@ +commit 9c6e71079b46ad5433165feaa2001450f2017b56 +Author: Przemysław Buczkowski +Date: Mon Aug 16 13:16:21 2021 +0100 + + GCC: Patch for Apple Silicon compatibility + + This patch fixes a linker error occuring when compiling + the cross-compiler on macOS and ARM64 architecture. + + Adapted from: + https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404 + + Change-Id: Ia3ee98a163bbb62689f42e2da83a5ef36beb0913 + Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4329 + Reviewed-by: John Scipione + Reviewed-by: Adrien Destugues + +--- a/gcc/config/aarch64/aarch64.h ++++ b/gcc/config/aarch64/aarch64.h +@@ -1236,7 +1236,7 @@ extern const char *aarch64_rewrite_mcpu + #define MCPU_TO_MARCH_SPEC_FUNCTIONS \ + { "rewrite_mcpu", aarch64_rewrite_mcpu }, + +-#if defined(__aarch64__) ++#if defined(__aarch64__) && ! defined(__APPLE__) + extern const char *host_detect_local_cpu (int argc, const char **argv); + #define HAVE_LOCAL_CPU_DETECT + # define EXTRA_SPEC_FUNCTIONS \ +--- a/gcc/config/host-darwin.c ++++ b/gcc/config/host-darwin.c +@@ -22,6 +22,8 @@ + #include "coretypes.h" + #include "diagnostic-core.h" + #include "config/host-darwin.h" ++#include "hosthooks.h" ++#include "hosthooks-def.h" + + /* Yes, this is really supposed to work. */ + /* This allows for a pagesize of 16384, which we have on Darwin20, but should +@@ -79,3 +81,5 @@ darwin_gt_pch_use_address (void *addr, s + + return ret; + } ++ ++const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;