gcc: Add 12.1

Add GCC 12.1 https://gcc.gnu.org/gcc-12/

The following patches from GCC 11.3.0 are no longer needed:
- 0005-arc-Update-ZOL-pattern.patch
- 0006-arc-Update-u-maddhisi4-patterns.patch
- 0007-arc-Fix-maddhisi-patterns.patch
- 0008-Darwin-aarch64-Initial-support-for-the-self-host-dri.patch
- 0009-libstdc-Check-for-TLS-support-on-mingw-cross-compile.patch

One new patch is needed to avoid issues building sh-unknown-elf:
- 0006-sh-Avoid-mb-m1-multilib-combination.patch

It is also necessary to build all-build-libcpp. This target exists as
far back as GCC 6 so has been done unconditionally.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
(cherry picked from commit db6f703f52e33a5791c5c2728fa1e3a330a08e98)
This commit is contained in:
Chris Packham 2022-05-08 16:16:08 +12:00 committed by Stephanos Ioannidis
parent 2bdfd25f0e
commit 64c142e57c
11 changed files with 443 additions and 3 deletions

View File

@ -0,0 +1,18 @@
---
libtool-ldflags | 5 +++++
1 file changed, 5 insertions(+)
--- a/libtool-ldflags
+++ b/libtool-ldflags
@@ -36,6 +36,11 @@
for arg
do
case $arg in
+ -framework)
+ # libtool handles this option. It should not be prefixed with
+ # -Xcompiler, as that would split it from the argument that
+ # follows.
+ ;;
-f*|--*|-static-lib*|-shared-lib*|-B*)
# Libtool does not ascribe any special meaning options
# that begin with -f or with a double-dash. So, it will

View File

@ -0,0 +1,14 @@
---
libcc1/connection.cc | 1 +
1 file changed, 1 insertion(+)
--- a/libcc1/connection.cc
+++ b/libcc1/connection.cc
@@ -21,6 +21,7 @@
#include <string>
#include <unistd.h>
#include <sys/types.h>
+#include <sys/select.h>
#include <string.h>
#include <errno.h>
#include "marshall.hh"

View File

@ -0,0 +1,31 @@
---
gcc/config/arm/linux-elf.h | 2 +-
libgcc/config/arm/t-linux | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -58,7 +58,7 @@
%{shared:-lc} \
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
+#define LIBGCC_SPEC "-lgcc"
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
--- a/libgcc/config/arm/t-linux
+++ b/libgcc/config/arm/t-linux
@@ -1,6 +1,11 @@
LIB1ASMSRC = arm/lib1funcs.S
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3
+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \
+ _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.

View File

@ -0,0 +1,17 @@
disable split-stack for non-thread builds
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
libgcc/config/t-stack | 2 ++
1 file changed, 2 insertions(+)
--- a/libgcc/config/t-stack
+++ b/libgcc/config/t-stack
@@ -1,4 +1,6 @@
# Makefile fragment to provide generic support for -fsplit-stack.
# This should be used in config.host for any host which supports
# -fsplit-stack.
+ifeq ($(enable_threads),yes)
LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c
+endif

View File

@ -0,0 +1,262 @@
From 9db1164d68ee1da7434af48db4f828d7df51b055 Mon Sep 17 00:00:00 2001
From: Keith Packard <keithp@keithp.com>
Date: Sun, 24 Jan 2021 14:20:33 -0800
Subject: [PATCH] Remove use of include_next from c++ headers
Using include_next bypasses the default header search path and lets
files later in the include path take priority over earlier files.
This makes replacing libc impossible as the default libc headers will
occur after the libstdc++ headers, and so be picked up in place of
headers inserted at the begining of the search path or appended to the
end of the search path.
Using include_next is a hack to work-around broken combinations of
libraries, and is not necessary in a well constructed toolchain.
Signed-off-by: Keith Packard <keithp@keithp.com>
---
libstdc++-v3/include/bits/std_abs.h | 4 ++--
libstdc++-v3/include/c/cassert | 2 +-
libstdc++-v3/include/c/cctype | 2 +-
libstdc++-v3/include/c/cerrno | 2 +-
libstdc++-v3/include/c/cfloat | 2 +-
libstdc++-v3/include/c/climits | 2 +-
libstdc++-v3/include/c/clocale | 2 +-
libstdc++-v3/include/c/cmath | 2 +-
libstdc++-v3/include/c/csetjmp | 2 +-
libstdc++-v3/include/c/csignal | 2 +-
libstdc++-v3/include/c/cstdarg | 2 +-
libstdc++-v3/include/c/cstddef | 2 +-
libstdc++-v3/include/c/cstdio | 2 +-
libstdc++-v3/include/c/cstdlib | 2 +-
libstdc++-v3/include/c/cstring | 2 +-
libstdc++-v3/include/c/ctime | 2 +-
libstdc++-v3/include/c/cuchar | 2 +-
libstdc++-v3/include/c/cwchar | 2 +-
libstdc++-v3/include/c/cwctype | 2 +-
libstdc++-v3/include/c_global/cmath | 2 +-
libstdc++-v3/include/c_global/cstdlib | 2 +-
21 files changed, 22 insertions(+), 22 deletions(-)
--- a/libstdc++-v3/include/bits/std_abs.h
+++ b/libstdc++-v3/include/bits/std_abs.h
@@ -35,9 +35,9 @@
#include <bits/c++config.h>
#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
-#include_next <stdlib.h>
+#include <stdlib.h>
#ifdef __CORRECT_ISO_CPP_MATH_H_PROTO
-# include_next <math.h>
+# include <math.h>
#endif
#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
--- a/libstdc++-v3/include/c/cassert
+++ b/libstdc++-v3/include/c/cassert
@@ -31,4 +31,4 @@
#pragma GCC system_header
#include <bits/c++config.h>
-#include_next <assert.h>
+#include <assert.h>
--- a/libstdc++-v3/include/c/cctype
+++ b/libstdc++-v3/include/c/cctype
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <ctype.h>
+#include <ctype.h>
#endif
--- a/libstdc++-v3/include/c/cerrno
+++ b/libstdc++-v3/include/c/cerrno
@@ -41,7 +41,7 @@
#pragma GCC system_header
#include <bits/c++config.h>
-#include_next <errno.h>
+#include <errno.h>
// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
#ifndef errno
--- a/libstdc++-v3/include/c/cfloat
+++ b/libstdc++-v3/include/c/cfloat
@@ -32,6 +32,6 @@
#pragma GCC system_header
#include <bits/c++config.h>
-#include_next <float.h>
+#include <float.h>
#endif
--- a/libstdc++-v3/include/c/climits
+++ b/libstdc++-v3/include/c/climits
@@ -32,6 +32,6 @@
#pragma GCC system_header
#include <bits/c++config.h>
-#include_next <limits.h>
+#include <limits.h>
#endif
--- a/libstdc++-v3/include/c/clocale
+++ b/libstdc++-v3/include/c/clocale
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <locale.h>
+#include <locale.h>
#endif
--- a/libstdc++-v3/include/c/cmath
+++ b/libstdc++-v3/include/c/cmath
@@ -33,7 +33,7 @@
#include <bits/c++config.h>
-#include_next <math.h>
+#include <math.h>
// Get rid of those macros defined in <math.h> in lieu of real functions.
#undef abs
--- a/libstdc++-v3/include/c/csetjmp
+++ b/libstdc++-v3/include/c/csetjmp
@@ -31,7 +31,7 @@
#pragma GCC system_header
-#include_next <setjmp.h>
+#include <setjmp.h>
// Get rid of those macros defined in <setjmp.h> in lieu of real functions.
#undef longjmp
--- a/libstdc++-v3/include/c/csignal
+++ b/libstdc++-v3/include/c/csignal
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <signal.h>
+#include <signal.h>
#endif
--- a/libstdc++-v3/include/c/cstdarg
+++ b/libstdc++-v3/include/c/cstdarg
@@ -32,6 +32,6 @@
#pragma GCC system_header
#undef __need___va_list
-#include_next <stdarg.h>
+#include <stdarg.h>
#endif
--- a/libstdc++-v3/include/c/cstddef
+++ b/libstdc++-v3/include/c/cstddef
@@ -35,6 +35,6 @@
#define __need_ptrdiff_t
#define __need_NULL
#define __need_offsetof
-#include_next <stddef.h>
+#include <stddef.h>
#endif
--- a/libstdc++-v3/include/c/cstdio
+++ b/libstdc++-v3/include/c/cstdio
@@ -31,7 +31,7 @@
#pragma GCC system_header
-#include_next <stdio.h>
+#include <stdio.h>
// Get rid of those macros defined in <stdio.h> in lieu of real functions.
#undef clearerr
--- a/libstdc++-v3/include/c/cstdlib
+++ b/libstdc++-v3/include/c/cstdlib
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <stdlib.h>
+#include <stdlib.h>
#endif
--- a/libstdc++-v3/include/c/cstring
+++ b/libstdc++-v3/include/c/cstring
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <string.h>
+#include <string.h>
#endif
--- a/libstdc++-v3/include/c/ctime
+++ b/libstdc++-v3/include/c/ctime
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <time.h>
+#include <time.h>
#endif
--- a/libstdc++-v3/include/c/cuchar
+++ b/libstdc++-v3/include/c/cuchar
@@ -39,7 +39,7 @@
#include <cwchar>
#if _GLIBCXX_USE_C11_UCHAR_CXX11
-# include_next <uchar.h>
+# include <uchar.h>
#endif
#endif // C++11
--- a/libstdc++-v3/include/c/cwchar
+++ b/libstdc++-v3/include/c/cwchar
@@ -36,7 +36,7 @@
#include <ctime>
#if _GLIBCXX_HAVE_WCHAR_H
-#include_next <wchar.h>
+#include <wchar.h>
#endif
// Need to do a bit of trickery here with mbstate_t as char_traits
--- a/libstdc++-v3/include/c/cwctype
+++ b/libstdc++-v3/include/c/cwctype
@@ -34,7 +34,7 @@
#include <bits/c++config.h>
#if _GLIBCXX_HAVE_WCTYPE_H
-#include_next <wctype.h>
+#include <wctype.h>
#endif
#endif
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -42,7 +42,7 @@
#include <bits/cpp_type_traits.h>
#include <ext/type_traits.h>
#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
-#include_next <math.h>
+#include <math.h>
#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#include <bits/std_abs.h>
--- a/libstdc++-v3/include/c_global/cstdlib
+++ b/libstdc++-v3/include/c_global/cstdlib
@@ -72,7 +72,7 @@
// Need to ensure this finds the C library's <stdlib.h> not a libstdc++
// wrapper that might already be installed later in the include search path.
#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
-#include_next <stdlib.h>
+#include <stdlib.h>
#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#include <bits/std_abs.h>

View File

@ -0,0 +1,26 @@
From ac6e15a2776e8fffdbd108213e8690c9f30a7380 Mon Sep 17 00:00:00 2001
From: Chris Packham <chris.packham@alliedtelesis.co.nz>
Date: Mon, 16 May 2022 20:55:36 +1200
Subject: [PATCH] libsanitizer: mips64: Set struct_kernel_stat_sz to match the
kernel
The kernel's struct stat is 104 bytes when compiling for
_MIPS_SIM_ABI64. Set struct_kernel_stat_sz to match.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105614
---
libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -83,7 +83,7 @@
#elif defined(__mips__)
const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID
? FIRST_32_SECOND_64(104, 128)
- : FIRST_32_SECOND_64(144, 216);
+ : FIRST_32_SECOND_64(144, 104);
const unsigned struct_kernel_stat64_sz = 104;
#elif defined(__s390__) && !defined(__s390x__)
const unsigned struct_kernel_stat_sz = 64;

View File

@ -0,0 +1,64 @@
From 497bbd01e39ca21091c0e3bb83c83f49319d3cab Mon Sep 17 00:00:00 2001
From: Chris Packham <chris.packham@alliedtelesis.co.nz>
Date: Tue, 17 May 2022 21:36:05 +1200
Subject: [PATCH] sh: Avoid mb/m1 multilib combination
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105607
It's not entirely clear why but the mb/m1 combination fails when
building libgcc.
gcc/libgcc/config/sh/lib1funcs.S: Assembler messages:
gcc/libgcc/config/sh/lib1funcs.S:933: Error: opcode not valid for this cpu variant
gcc/libgcc/config/sh/lib1funcs.S:935: Error: opcode not valid for this cpu variant
gcc/libgcc/config/sh/lib1funcs.S:942: Error: opcode not valid for this cpu variant
gcc/libgcc/config/sh/lib1funcs.S:944: Error: opcode not valid for this cpu variant
make[4]: *** [Makefile:491: _movmem_i4_s.o] Error 1
The assembly that is being complained about is
931 L_movmem_loop:
932 mov.l r3,@(12,r4)
933 dt r6
934 mov.l @r5+,r0
935 bt/s L_movmem_2mod4_end
936 mov.l @r5+,r1
937 add #16,r4
938 L_movmem_start_even:
939 mov.l @r5+,r2
940 mov.l @r5+,r3
941 mov.l r0,@r4
942 dt r6
943 mov.l r1,@(4,r4)
944 bf/s L_movmem_loop
945 mov.l r2,@(8,r4)
946 rts
947 mov.l r3,@(12,r4)
Under GCC11 the combination was not built but somehow under GCC12 it is.
As a workaround add mb/m1 to the list of excluded combinations.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
gcc/config/sh/t-sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh
index dd5652e11bfb..fa901201e5e6 100644
--- a/gcc/config/sh/t-sh
+++ b/gcc/config/sh/t-sh
@@ -63,9 +63,9 @@ MULTILIB_MATCHES = $(shell \
# SH1 and SH2A support big endian only.
ifeq ($(DEFAULT_ENDIAN),ml)
-MULTILIB_EXCEPTIONS = m1 ml/m1 m2a* ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
+MULTILIB_EXCEPTIONS = m1 ml/m1 mb/m1 m2a* ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
else
-MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
+MULTILIB_EXCEPTIONS = ml/m1 mb/m1 ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
endif
MULTILIB_OSDIRNAMES = \
--
2.36.1

8
packages/gcc/12.1.0/chksum vendored Normal file
View File

@ -0,0 +1,8 @@
md5 gcc-12.1.0.tar.xz ed45b55ee859ada4b25a1e76e0c4d966
sha1 gcc-12.1.0.tar.xz 81614dacd8625a3896a57df375b695dba0c75f36
sha256 gcc-12.1.0.tar.xz 62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
sha512 gcc-12.1.0.tar.xz 2121d295292814a6761edf1fba08c5f633ebe16f52b80e7b73a91050e71e1d2ed98bf17eebad263e191879561c02b48906c53faa4c4670c486a26fc75df23900
md5 gcc-12.1.0.tar.gz 7854cdccc3a7988aa37fb0d0038b8096
sha1 gcc-12.1.0.tar.gz 7e79c695a0380ac838fa7c876a121cd28a73a9f5
sha256 gcc-12.1.0.tar.gz e88a004a14697bbbaba311f38a938c716d9a652fd151aaaa4cf1b5b99b90e2de
sha512 gcc-12.1.0.tar.gz 32da0e69478b6848e187c3a37579b76d0176b34cdb94726bf3ce7fdda7764965adbb5d2013de5a9b254adad9eb1cfaff90f4ba8da54cfe56e46b9cbfe8882a3b

0
packages/gcc/12.1.0/version.desc vendored Normal file
View File

View File

@ -2,5 +2,5 @@ repository='git git://gcc.gnu.org/git/gcc.git'
mirrors='$(CT_Mirrors GNU gcc/gcc-${CT_GCC_VERSION}) $(CT_Mirrors sourceware gcc/releases/gcc-${CT_GCC_VERSION})'
relevantpattern='4.*|. *|.'
origin='GNU'
milestones='4.9 5 6 7 8 9 10 11'
milestones='4.9 5 6 7 8 9 10 11 12'
archive_formats='.tar.xz .tar.gz'

View File

@ -621,10 +621,10 @@ do_gcc_core_backend() {
CT_DoExecLog CFG make ${CT_JOBSFLAGS} configure-libiberty
CT_DoExecLog ALL make ${CT_JOBSFLAGS} -C libiberty libiberty.a
CT_DoExecLog CFG make ${CT_JOBSFLAGS} configure-gcc configure-libcpp
CT_DoExecLog ALL make ${CT_JOBSFLAGS} all-libcpp
CT_DoExecLog ALL make ${CT_JOBSFLAGS} all-libcpp all-build-libcpp
else
CT_DoExecLog CFG make ${CT_JOBSFLAGS} configure-gcc configure-libcpp configure-build-libiberty
CT_DoExecLog ALL make ${CT_JOBSFLAGS} all-libcpp all-build-libiberty
CT_DoExecLog ALL make ${CT_JOBSFLAGS} all-libcpp all-build-libcpp all-build-libiberty
fi
# HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
if [ -d "${CT_SRC_DIR}/gcc/libdecnumber" ]; then