Skip to content

Commit f87b157

Browse files
Ansueljollaman999
authored andcommitted
toolchain: add gcc 11 version
Add gcc 11 version. Same patches of gcc 10. Build tested on: ipq806x ipq807x Run tested on: ipq806x ipq807x Signed-off-by: Ansuel Smith <[email protected]> [refresh patches] Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent 12a1c9a commit f87b157

21 files changed

+851
-0
lines changed

toolchain/gcc/Config.in

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ choice
1818

1919
config GCC_USE_VERSION_10
2020
bool "gcc 10.x"
21+
22+
config GCC_USE_VERSION_11
23+
bool "gcc 11.x"
2124
endchoice
2225

2326
config GCC_USE_GRAPHITE

toolchain/gcc/Config.version

+5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ config GCC_VERSION_10
1010
default y if GCC_USE_VERSION_10
1111
bool
1212

13+
config GCC_VERSION_11
14+
default y if GCC_USE_VERSION_11
15+
bool
16+
1317
config GCC_VERSION
1418
string
1519
default "7.5.0" if GCC_VERSION_7
1620
default "9.3.0" if GCC_VERSION_9
1721
default "10.3.0" if GCC_VERSION_10
22+
default "11.1.0" if GCC_VERSION_11
1823
default "8.4.0"
1924

2025
config GCC_USE_IREMAP

toolchain/gcc/common.mk

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ ifeq ($(PKG_VERSION),10.3.0)
4444
PKG_HASH:=64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344
4545
endif
4646

47+
ifeq ($(PKG_VERSION),11.1.0)
48+
PKG_HASH:=4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf
49+
endif
50+
4751
PATCH_DIR=../patches/$(GCC_VERSION)
4852

4953
BUGURL=http://bugs.openwrt.org/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e
2+
Author: Felix Fietkau <[email protected]>
3+
Date: Sun Oct 19 21:45:51 2014 +0000
4+
5+
gcc: do not assume that the Mac OS X filesystem is case insensitive
6+
7+
Signed-off-by: Felix Fietkau <[email protected]>
8+
9+
SVN-Revision: 42973
10+
11+
--- a/include/filenames.h
12+
+++ b/include/filenames.h
13+
@@ -44,11 +44,6 @@ extern "C" {
14+
# define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
15+
# define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
16+
#else /* not DOSish */
17+
-# if defined(__APPLE__)
18+
-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
19+
-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
20+
-# endif
21+
-# endif /* __APPLE__ */
22+
# define HAS_DRIVE_SPEC(f) (0)
23+
# define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c)
24+
# define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2
2+
Author: Luka Perkov <[email protected]>
3+
Date: Tue Feb 26 16:16:33 2013 +0000
4+
5+
gcc: don't build documentation
6+
7+
This closes #13039.
8+
9+
Signed-off-by: Luka Perkov <[email protected]>
10+
11+
SVN-Revision: 35807
12+
13+
--- a/gcc/Makefile.in
14+
+++ b/gcc/Makefile.in
15+
@@ -3355,18 +3355,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
16+
doc/gccint.info: $(TEXI_GCCINT_FILES)
17+
doc/cppinternals.info: $(TEXI_CPPINT_FILES)
18+
19+
-doc/%.info: %.texi
20+
- if [ x$(BUILD_INFO) = xinfo ]; then \
21+
- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
22+
- -I $(gcc_docdir)/include -o $@ $<; \
23+
- fi
24+
+doc/%.info:
25+
26+
# Duplicate entry to handle renaming of gccinstall.info
27+
-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
28+
- if [ x$(BUILD_INFO) = xinfo ]; then \
29+
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
30+
- -I $(gcc_docdir)/include -o $@ $<; \
31+
- fi
32+
+doc/gccinstall.info:
33+
34+
doc/cpp.dvi: $(TEXI_CPP_FILES)
35+
doc/gcc.dvi: $(TEXI_GCC_FILES)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790.
2+
MIPS16 functions have a static assembler prologue which clobbers
3+
registers v0 and v1. Add these register clobbers to function call
4+
instructions.
5+
6+
--- a/gcc/config/mips/mips.c
7+
+++ b/gcc/config/mips/mips.c
8+
@@ -3132,6 +3132,12 @@ mips_emit_call_insn (rtx pattern, rtx or
9+
emit_insn (gen_update_got_version ());
10+
}
11+
12+
+ if (TARGET_MIPS16 && TARGET_USE_GOT)
13+
+ {
14+
+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS16_PIC_TEMP);
15+
+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS_PROLOGUE_TEMP (word_mode));
16+
+ }
17+
+
18+
if (TARGET_MIPS16
19+
&& TARGET_EXPLICIT_RELOCS
20+
&& TARGET_CALL_CLOBBERED_GP)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- a/gcc/gcc.c
2+
+++ b/gcc/gcc.c
3+
@@ -978,7 +978,9 @@ proper position among the other output f
4+
#endif
5+
6+
#ifndef LINK_SSP_SPEC
7+
-#ifdef TARGET_LIBC_PROVIDES_SSP
8+
+#if DEFAULT_LIBC == LIBC_MUSL
9+
+#define LINK_SSP_SPEC "-lssp_nonshared"
10+
+#elif defined(TARGET_LIBC_PROVIDES_SSP)
11+
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
12+
"|fstack-protector-strong|fstack-protector-explicit:}"
13+
#else
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
commit ecf7671b769fe96f7b5134be442089f8bdba55d2
2+
Author: Felix Fietkau <[email protected]>
3+
Date: Thu Aug 4 20:29:45 2016 +0200
4+
5+
gcc: add a patch to generate better code with Os on mips
6+
7+
Also happens to reduce compressed code size a bit
8+
9+
Signed-off-by: Felix Fietkau <[email protected]>
10+
11+
--- a/gcc/config/mips/mips.c
12+
+++ b/gcc/config/mips/mips.c
13+
@@ -20041,7 +20041,7 @@ mips_option_override (void)
14+
flag_pcc_struct_return = 0;
15+
16+
/* Decide which rtx_costs structure to use. */
17+
- if (optimize_size)
18+
+ if (0 && optimize_size)
19+
mips_cost = &mips_rtx_cost_optimize_size;
20+
else
21+
mips_cost = &mips_rtx_cost_data[mips_tune];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
commit 8570c4be394cff7282f332f97da2ff569a927ddb
2+
Author: Imre Kaloz <[email protected]>
3+
Date: Wed Feb 2 20:06:12 2011 +0000
4+
5+
fixup arm soft-float symbols
6+
7+
SVN-Revision: 25325
8+
9+
--- a/libgcc/config/arm/t-linux
10+
+++ b/libgcc/config/arm/t-linux
11+
@@ -1,6 +1,10 @@
12+
LIB1ASMSRC = arm/lib1funcs.S
13+
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
14+
- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3
15+
+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \
16+
+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
17+
+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
18+
+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
19+
+ _arm_fixsfsi _arm_fixunssfsi
20+
21+
# Just for these, we omit the frame pointer since it makes such a big
22+
# difference.
23+
--- a/gcc/config/arm/linux-elf.h
24+
+++ b/gcc/config/arm/linux-elf.h
25+
@@ -58,8 +58,6 @@
26+
%{shared:-lc} \
27+
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
28+
29+
-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
30+
-
31+
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
32+
33+
#define LINUX_TARGET_LINK_SPEC "%{h*} \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
commit c96312958c0621e72c9b32da5bc224ffe2161384
2+
Author: Felix Fietkau <[email protected]>
3+
Date: Mon Oct 19 23:26:09 2009 +0000
4+
5+
gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow)
6+
7+
SVN-Revision: 18086
8+
9+
--- a/libgcc/Makefile.in
10+
+++ b/libgcc/Makefile.in
11+
@@ -930,11 +930,12 @@ $(libgcov-driver-objects): %$(objext): $
12+
13+
# Static libraries.
14+
libgcc.a: $(libgcc-objects)
15+
+libgcc_pic.a: $(libgcc-s-objects)
16+
libgcov.a: $(libgcov-objects)
17+
libunwind.a: $(libunwind-objects)
18+
libgcc_eh.a: $(libgcc-eh-objects)
19+
20+
-libgcc.a libgcov.a libunwind.a libgcc_eh.a:
21+
+libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a:
22+
-rm -f $@
23+
24+
objects="$(objects)"; \
25+
@@ -958,7 +959,7 @@ all: libunwind.a
26+
endif
27+
28+
ifeq ($(enable_shared),yes)
29+
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
30+
+all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT)
31+
ifneq ($(LIBUNWIND),)
32+
all: libunwind$(SHLIB_EXT)
33+
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
34+
@@ -1164,6 +1165,10 @@ install-shared:
35+
chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
36+
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
37+
38+
+ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/
39+
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a
40+
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a
41+
+
42+
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
43+
@shlib_base_name@,libgcc_s,$(subst \
44+
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc
2+
Author: Imre Kaloz <[email protected]>
3+
Date: Wed Feb 2 19:34:36 2011 +0000
4+
5+
add armv4 fixup patches
6+
7+
SVN-Revision: 25322
8+
9+
10+
--- a/gcc/config/arm/linux-eabi.h
11+
+++ b/gcc/config/arm/linux-eabi.h
12+
@@ -91,10 +91,15 @@
13+
#define MUSL_DYNAMIC_LINKER \
14+
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1"
15+
16+
+/* For armv4 we pass --fix-v4bx to linker to support EABI */
17+
+#undef TARGET_FIX_V4BX_SPEC
18+
+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\
19+
+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}"
20+
+
21+
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
22+
use the GNU/Linux version, not the generic BPABI version. */
23+
#undef LINK_SPEC
24+
-#define LINK_SPEC EABI_LINK_SPEC \
25+
+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \
26+
LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
27+
LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd
2+
Author: Felix Fietkau <[email protected]>
3+
Date: Sun Feb 12 20:25:47 2012 +0000
4+
5+
gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary
6+
7+
SVN-Revision: 30486
8+
--- a/gcc/config/arm/linux-eabi.h
9+
+++ b/gcc/config/arm/linux-eabi.h
10+
@@ -132,10 +132,6 @@
11+
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \
12+
LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
13+
14+
-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
15+
- do not use -lfloat. */
16+
-#undef LIBGCC_SPEC
17+
-
18+
/* Clear the instruction cache from `beg' to `end'. This is
19+
implemented in lib1funcs.S, so ensure an error if this definition
20+
is used. */
21+
--- a/gcc/config/linux.h
22+
+++ b/gcc/config/linux.h
23+
@@ -66,6 +66,10 @@ see the files COPYING3 and COPYING.RUNTI
24+
builtin_version ("CRuntime_Musl"); \
25+
} while (0)
26+
27+
+#ifndef LIBGCC_SPEC
28+
+#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}"
29+
+#endif
30+
+
31+
/* Determine which dynamic linker to use depending on whether GLIBC or
32+
uClibc or Bionic or musl is the default C library and whether
33+
-muclibc or -mglibc or -mbionic or -mmusl has been passed to change
34+
--- a/libgcc/mkmap-symver.awk
35+
+++ b/libgcc/mkmap-symver.awk
36+
@@ -136,5 +136,5 @@ function output(lib) {
37+
else if (inherit[lib])
38+
printf("} %s;\n", inherit[lib]);
39+
else
40+
- printf ("\n local:\n\t*;\n};\n");
41+
+ printf ("\n\t*;\n};\n");
42+
}
43+
--- a/gcc/config/rs6000/linux.h
44+
+++ b/gcc/config/rs6000/linux.h
45+
@@ -62,6 +62,9 @@
46+
#undef CPP_OS_DEFAULT_SPEC
47+
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
48+
49+
+#undef LIBGCC_SPEC
50+
+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc"
51+
+
52+
#undef LINK_SHLIB_SPEC
53+
#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \
54+
%{static-pie:-static -pie --no-dynamic-linker -z text}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
commit 64661de100da1ec1061ef3e5e400285dce115e6b
2+
Author: Felix Fietkau <[email protected]>
3+
Date: Sun May 10 13:16:35 2015 +0000
4+
5+
gcc: add some size optimization patches
6+
7+
Signed-off-by: Felix Fietkau <[email protected]>
8+
9+
SVN-Revision: 45664
10+
11+
--- a/libgcc/config/t-libunwind
12+
+++ b/libgcc/config/t-libunwind
13+
@@ -2,8 +2,7 @@
14+
15+
HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
16+
17+
-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
18+
- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
19+
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
20+
LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
21+
22+
# Override the default value from t-slibgcc-elf-ver and mention -lunwind
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/gcc/config/rs6000/rs6000-logue.c
2+
+++ b/gcc/config/rs6000/rs6000-logue.c
3+
@@ -348,7 +348,7 @@ rs6000_savres_strategy (rs6000_stack_t *
4+
/* Define cutoff for using out-of-line functions to save registers. */
5+
if (DEFAULT_ABI == ABI_V4 || TARGET_ELF)
6+
{
7+
- if (!optimize_size)
8+
+ if (1)
9+
{
10+
strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
11+
strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/libgcc/crtstuff.c
2+
+++ b/libgcc/crtstuff.c
3+
@@ -152,7 +152,7 @@ call_ ## FUNC (void) \
4+
#endif
5+
6+
#if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF)
7+
-# define USE_TM_CLONE_REGISTRY 1
8+
+# define USE_TM_CLONE_REGISTRY 0
9+
#elif !defined(USE_TM_CLONE_REGISTRY)
10+
# define USE_TM_CLONE_REGISTRY 0
11+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--- a/libgcc/config/mips/t-mips16
2+
+++ b/libgcc/config/mips/t-mips16
3+
@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16
4+
5+
# Version these symbols if building libgcc.so.
6+
SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver
7+
+
8+
+CRTSTUFF_T_CFLAGS += -mno-mips16
9+
+CRTSTUFF_T_CFLAGS_S += -mno-mips16

0 commit comments

Comments
 (0)