forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GCC 12.1 is out. Add support for it. Deleted (upstreamed): 011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch 931-libffi-fix-MIPS-softfloat-build-issue.patch Deleted (unneeded?) 970-macos_arm64-building-fix.patch Other patches manually rebased due to C++ conversion and consequent file name changing (.c to .cc). Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
- Loading branch information
1 parent
8885cf8
commit c4bd303
Showing
20 changed files
with
625 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e | ||
Author: Felix Fietkau <nbd@openwrt.org> | ||
Date: Sun Oct 19 21:45:51 2014 +0000 | ||
|
||
gcc: do not assume that the Mac OS X filesystem is case insensitive | ||
|
||
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | ||
|
||
SVN-Revision: 42973 | ||
|
||
--- a/include/filenames.h | ||
+++ b/include/filenames.h | ||
@@ -44,11 +44,6 @@ extern "C" { | ||
# define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) | ||
# define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) | ||
#else /* not DOSish */ | ||
-# if defined(__APPLE__) | ||
-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM | ||
-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 | ||
-# endif | ||
-# endif /* __APPLE__ */ | ||
# define HAS_DRIVE_SPEC(f) (0) | ||
# define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) | ||
# define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2 | ||
Author: Luka Perkov <luka@openwrt.org> | ||
Date: Tue Feb 26 16:16:33 2013 +0000 | ||
|
||
gcc: don't build documentation | ||
|
||
This closes #13039. | ||
|
||
Signed-off-by: Luka Perkov <luka@openwrt.org> | ||
|
||
SVN-Revision: 35807 | ||
|
||
--- a/gcc/Makefile.in | ||
+++ b/gcc/Makefile.in | ||
@@ -3366,18 +3366,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) | ||
doc/gccint.info: $(TEXI_GCCINT_FILES) | ||
doc/cppinternals.info: $(TEXI_CPPINT_FILES) | ||
|
||
-doc/%.info: %.texi | ||
- if [ x$(BUILD_INFO) = xinfo ]; then \ | ||
- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ | ||
- -I $(gcc_docdir)/include -o $@ $<; \ | ||
- fi | ||
+doc/%.info: | ||
|
||
# Duplicate entry to handle renaming of gccinstall.info | ||
-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) | ||
- if [ x$(BUILD_INFO) = xinfo ]; then \ | ||
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ | ||
- -I $(gcc_docdir)/include -o $@ $<; \ | ||
- fi | ||
+doc/gccinstall.info: | ||
|
||
doc/cpp.dvi: $(TEXI_CPP_FILES) | ||
doc/gcc.dvi: $(TEXI_GCC_FILES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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 | ||
@@ -3134,6 +3134,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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- a/gcc/gcc.cc | ||
+++ b/gcc/gcc.cc | ||
@@ -985,7 +985,9 @@ proper position among the other output f | ||
#endif | ||
|
||
#ifndef LINK_SSP_SPEC | ||
-#ifdef TARGET_LIBC_PROVIDES_SSP | ||
+#if DEFAULT_LIBC == LIBC_MUSL | ||
+#define LINK_SSP_SPEC "-lssp_nonshared" | ||
+#elif defined(TARGET_LIBC_PROVIDES_SSP) | ||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ | ||
"|fstack-protector-strong|fstack-protector-explicit:}" | ||
#else |
21 changes: 21 additions & 0 deletions
21
toolchain/gcc/patches/12.1.0/300-mips_Os_cpu_rtx_cost_model.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
commit ecf7671b769fe96f7b5134be442089f8bdba55d2 | ||
Author: Felix Fietkau <nbd@nbd.name> | ||
Date: Thu Aug 4 20:29:45 2016 +0200 | ||
|
||
gcc: add a patch to generate better code with Os on mips | ||
|
||
Also happens to reduce compressed code size a bit | ||
|
||
Signed-off-by: Felix Fietkau <nbd@nbd.name> | ||
|
||
--- a/gcc/config/mips/mips.cc | ||
+++ b/gcc/config/mips/mips.cc | ||
@@ -20216,7 +20216,7 @@ mips_option_override (void) | ||
flag_pcc_struct_return = 0; | ||
|
||
/* Decide which rtx_costs structure to use. */ | ||
- if (optimize_size) | ||
+ if (0 && optimize_size) | ||
mips_cost = &mips_rtx_cost_optimize_size; | ||
else | ||
mips_cost = &mips_rtx_cost_data[mips_tune]; |
33 changes: 33 additions & 0 deletions
33
toolchain/gcc/patches/12.1.0/810-arm-softfloat-libgcc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
commit 8570c4be394cff7282f332f97da2ff569a927ddb | ||
Author: Imre Kaloz <kaloz@openwrt.org> | ||
Date: Wed Feb 2 20:06:12 2011 +0000 | ||
|
||
fixup arm soft-float symbols | ||
|
||
SVN-Revision: 25325 | ||
|
||
--- a/libgcc/config/arm/t-linux | ||
+++ b/libgcc/config/arm/t-linux | ||
@@ -1,6 +1,10 @@ | ||
LIB1ASMSRC = arm/lib1funcs.S | ||
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ | ||
- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 | ||
+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ | ||
+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ | ||
+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ | ||
+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ | ||
+ _arm_fixsfsi _arm_fixunssfsi | ||
|
||
# Just for these, we omit the frame pointer since it makes such a big | ||
# difference. | ||
--- a/gcc/config/arm/linux-elf.h | ||
+++ b/gcc/config/arm/linux-elf.h | ||
@@ -58,8 +58,6 @@ | ||
%{shared:-lc} \ | ||
%{!shared:%{profile:-lc_p}%{!profile:-lc}}" | ||
|
||
-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" | ||
- | ||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" | ||
|
||
#define LINUX_TARGET_LINK_SPEC "%{h*} \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
commit c96312958c0621e72c9b32da5bc224ffe2161384 | ||
Author: Felix Fietkau <nbd@openwrt.org> | ||
Date: Mon Oct 19 23:26:09 2009 +0000 | ||
|
||
gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow) | ||
|
||
SVN-Revision: 18086 | ||
|
||
--- a/libgcc/Makefile.in | ||
+++ b/libgcc/Makefile.in | ||
@@ -930,11 +930,12 @@ $(libgcov-driver-objects): %$(objext): $ | ||
|
||
# Static libraries. | ||
libgcc.a: $(libgcc-objects) | ||
+libgcc_pic.a: $(libgcc-s-objects) | ||
libgcov.a: $(libgcov-objects) | ||
libunwind.a: $(libunwind-objects) | ||
libgcc_eh.a: $(libgcc-eh-objects) | ||
|
||
-libgcc.a libgcov.a libunwind.a libgcc_eh.a: | ||
+libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: | ||
-rm -f $@ | ||
|
||
objects="$(objects)"; \ | ||
@@ -958,7 +959,7 @@ all: libunwind.a | ||
endif | ||
|
||
ifeq ($(enable_shared),yes) | ||
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) | ||
+all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) | ||
ifneq ($(LIBUNWIND),) | ||
all: libunwind$(SHLIB_EXT) | ||
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) | ||
@@ -1164,6 +1165,10 @@ install-shared: | ||
chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a | ||
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a | ||
|
||
+ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ | ||
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a | ||
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a | ||
+ | ||
$(subst @multilib_dir@,$(MULTIDIR),$(subst \ | ||
@shlib_base_name@,libgcc_s,$(subst \ | ||
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) |
28 changes: 28 additions & 0 deletions
28
toolchain/gcc/patches/12.1.0/840-armv4_pass_fix-v4bx_to_ld.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc | ||
Author: Imre Kaloz <kaloz@openwrt.org> | ||
Date: Wed Feb 2 19:34:36 2011 +0000 | ||
|
||
add armv4 fixup patches | ||
|
||
SVN-Revision: 25322 | ||
|
||
|
||
--- a/gcc/config/arm/linux-eabi.h | ||
+++ b/gcc/config/arm/linux-eabi.h | ||
@@ -91,10 +91,15 @@ | ||
#define MUSL_DYNAMIC_LINKER \ | ||
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1" | ||
|
||
+/* For armv4 we pass --fix-v4bx to linker to support EABI */ | ||
+#undef TARGET_FIX_V4BX_SPEC | ||
+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ | ||
+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" | ||
+ | ||
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to | ||
use the GNU/Linux version, not the generic BPABI version. */ | ||
#undef LINK_SPEC | ||
-#define LINK_SPEC EABI_LINK_SPEC \ | ||
+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ | ||
LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ | ||
LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd | ||
Author: Felix Fietkau <nbd@openwrt.org> | ||
Date: Sun Feb 12 20:25:47 2012 +0000 | ||
|
||
gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary | ||
|
||
SVN-Revision: 30486 | ||
--- a/gcc/config/arm/linux-eabi.h | ||
+++ b/gcc/config/arm/linux-eabi.h | ||
@@ -132,10 +132,6 @@ | ||
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ | ||
LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) | ||
|
||
-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we | ||
- do not use -lfloat. */ | ||
-#undef LIBGCC_SPEC | ||
- | ||
/* Clear the instruction cache from `beg' to `end'. This is | ||
implemented in lib1funcs.S, so ensure an error if this definition | ||
is used. */ | ||
--- a/gcc/config/linux.h | ||
+++ b/gcc/config/linux.h | ||
@@ -71,6 +71,10 @@ see the files COPYING3 and COPYING.RUNTI | ||
builtin_version ("CRuntime_Musl"); \ | ||
} while (0) | ||
|
||
+#ifndef LIBGCC_SPEC | ||
+#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" | ||
+#endif | ||
+ | ||
/* Determine which dynamic linker to use depending on whether GLIBC or | ||
uClibc or Bionic or musl is the default C library and whether | ||
-muclibc or -mglibc or -mbionic or -mmusl has been passed to change | ||
--- a/libgcc/mkmap-symver.awk | ||
+++ b/libgcc/mkmap-symver.awk | ||
@@ -136,5 +136,5 @@ function output(lib) { | ||
else if (inherit[lib]) | ||
printf("} %s;\n", inherit[lib]); | ||
else | ||
- printf ("\n local:\n\t*;\n};\n"); | ||
+ printf ("\n\t*;\n};\n"); | ||
} | ||
--- a/gcc/config/rs6000/linux.h | ||
+++ b/gcc/config/rs6000/linux.h | ||
@@ -67,6 +67,9 @@ | ||
#undef CPP_OS_DEFAULT_SPEC | ||
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" | ||
|
||
+#undef LIBGCC_SPEC | ||
+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" | ||
+ | ||
#undef LINK_SHLIB_SPEC | ||
#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \ | ||
%{static-pie:-static -pie --no-dynamic-linker -z text}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
commit 64661de100da1ec1061ef3e5e400285dce115e6b | ||
Author: Felix Fietkau <nbd@openwrt.org> | ||
Date: Sun May 10 13:16:35 2015 +0000 | ||
|
||
gcc: add some size optimization patches | ||
|
||
Signed-off-by: Felix Fietkau <nbd@openwrt.org> | ||
|
||
SVN-Revision: 45664 | ||
|
||
--- a/libgcc/config/t-libunwind | ||
+++ b/libgcc/config/t-libunwind | ||
@@ -2,8 +2,7 @@ | ||
|
||
HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER | ||
|
||
-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ | ||
- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c | ||
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c | ||
LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c | ||
|
||
# Override the default value from t-slibgcc-elf-ver and mention -lunwind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/gcc/config/rs6000/rs6000-logue.cc | ||
+++ b/gcc/config/rs6000/rs6000-logue.cc | ||
@@ -348,7 +348,7 @@ rs6000_savres_strategy (rs6000_stack_t * | ||
/* Define cutoff for using out-of-line functions to save registers. */ | ||
if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) | ||
{ | ||
- if (!optimize_size) | ||
+ if (1) | ||
{ | ||
strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; | ||
strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/libgcc/crtstuff.c | ||
+++ b/libgcc/crtstuff.c | ||
@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ | ||
#endif | ||
|
||
#if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) | ||
-# define USE_TM_CLONE_REGISTRY 1 | ||
+# define USE_TM_CLONE_REGISTRY 0 | ||
#elif !defined(USE_TM_CLONE_REGISTRY) | ||
# define USE_TM_CLONE_REGISTRY 0 | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- a/libgcc/config/mips/t-mips16 | ||
+++ b/libgcc/config/mips/t-mips16 | ||
@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 | ||
|
||
# Version these symbols if building libgcc.so. | ||
SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver | ||
+ | ||
+CRTSTUFF_T_CFLAGS += -mno-mips16 | ||
+CRTSTUFF_T_CFLAGS_S += -mno-mips16 |
Oops, something went wrong.