commit: cdf3810aa79bf2de2d2ee2a48ba3397cb1b63193 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Sun Dec 15 04:58:14 2024 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sun Dec 15 05:01:17 2024 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=cdf3810a
11.5.0: add 77_all_PR115917-ada-lto.patch ... with 11.5.0 based on 11.4.0. Signed-off-by: Sam James <sam <AT> gentoo.org> 11.5.0/gentoo/01_all_default-fortify-source.patch | 22 ++ .../02_all_default-warn-format-security.patch | 22 ++ .../gentoo/03_all_default-warn-trampolines.patch | 13 + 11.5.0/gentoo/04_all_nossp-on-nostdlib.patch | 27 ++ 11.5.0/gentoo/05_all_alpha-mieee-default.patch | 39 +++ 11.5.0/gentoo/06_all_ia64_note.GNU-stack.patch | 92 +++++ 11.5.0/gentoo/07_all_libiberty-asprintf.patch | 18 + 11.5.0/gentoo/08_all_libiberty-pic.patch | 10 + 11.5.0/gentoo/09_all_nopie-all-flags.patch | 18 + 11.5.0/gentoo/10_all_sh-drop-sysroot-suffix.patch | 26 ++ 11.5.0/gentoo/11_all_ia64-TEXTREL.patch | 22 ++ .../gentoo/12_all_disable-systemtap-switch.patch | 115 +++++++ 11.5.0/gentoo/13_all_m68k-textrel-on-libgcc.patch | 87 +++++ 11.5.0/gentoo/14_all_respect-build-cxxflags.patch | 39 +++ 11.5.0/gentoo/15_all_libgomp-Werror.patch | 26 ++ 11.5.0/gentoo/16_all_libitm-Werror.patch | 25 ++ 11.5.0/gentoo/17_all_libatomic-Werror.patch | 25 ++ 11.5.0/gentoo/18_all_libbacktrace-Werror.patch | 17 + 11.5.0/gentoo/19_all_libsanitizer-Werror.patch | 17 + 11.5.0/gentoo/20_all_libstdcxx-no-vtv.patch | 97 ++++++ 11.5.0/gentoo/21_all_default_ssp-buffer-size.patch | 14 + 11.5.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch | 26 ++ ...all_EXTRA_OPTIONS-fstack-clash-protection.patch | 65 ++++ .../24_all_lto-intl-workaround-PR95194.patch | 20 ++ 11.5.0/gentoo/25_all_plugin-objdump.patch | 34 ++ 11.5.0/gentoo/27_all_msgfmt-libstdc++-link.patch | 39 +++ 11.5.0/gentoo/28_all_drop_CFLAGS_sed.patch | 35 ++ 11.5.0/gentoo/29_all_tar_libstdc++-link.patch | 57 ++++ .../75_all_x86_PR99703_12_no-cet-for-i486.patch | 373 +++++++++++++++++++++ .../gentoo/76_all_all_PR103910_12_ICE-on-PCH.patch | 35 ++ 11.5.0/gentoo/77_all_PR115917-ada-lto.patch | 52 +++ 11.5.0/gentoo/README.history | 33 ++ 11.5.0/musl/25_all_multilib_pure64.patch | 83 +++++ 11.5.0/musl/50_all_calloc_libgccjit.patch | 122 +++++++ 11.5.0/musl/50_all_libssp_unconditionally.patch | 24 ++ 11.5.0/musl/50_all_posix_memalign.patch | 28 ++ 36 files changed, 1797 insertions(+) diff --git a/11.5.0/gentoo/01_all_default-fortify-source.patch b/11.5.0/gentoo/01_all_default-fortify-source.patch new file mode 100644 index 0000000..d307474 --- /dev/null +++ b/11.5.0/gentoo/01_all_default-fortify-source.patch @@ -0,0 +1,22 @@ +Taken Debian's patch and removed docs matches: + https://salsa.debian.org/toolchain-team/gcc.git +Also see https://bugs.gentoo.org/621036 where +initially Gentoo used too complicated macro. + +# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++, +# DP: if the optimization level is > 0 +--- a/gcc/c-family/c-cppbuiltin.c ++++ b/gcc/c-family/c-cppbuiltin.c +@@ -951,6 +951,12 @@ c_cpp_builtins (cpp_reader *pfile) + builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); + builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); + ++#if !defined(ACCEL_COMPILER) ++ /* Fortify Source enabled by default for optimization levels > 0 */ ++ if (optimize) ++ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2); ++#endif ++ + /* Misc. */ + if (flag_gnu89_inline) + cpp_define (pfile, "__GNUC_GNU_INLINE__"); diff --git a/11.5.0/gentoo/02_all_default-warn-format-security.patch b/11.5.0/gentoo/02_all_default-warn-format-security.patch new file mode 100644 index 0000000..13fa24a --- /dev/null +++ b/11.5.0/gentoo/02_all_default-warn-format-security.patch @@ -0,0 +1,22 @@ +Enable -Wformat and -Wformat-security by default. + +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -637,7 +637,7 @@ + of the destination region. Same as -Wformat-overflow=1. + + Wformat-security +-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) ++C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) + Warn about possible security problems with format functions. + + Wformat-signedness +@@ -658,7 +658,7 @@ + Warn about zero-length formats. + + Wformat= +-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2) ++C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2) + Warn about printf/scanf/strftime/strfmon format string anomalies. + + Wformat-overflow= diff --git a/11.5.0/gentoo/03_all_default-warn-trampolines.patch b/11.5.0/gentoo/03_all_default-warn-trampolines.patch new file mode 100644 index 0000000..7a644cb --- /dev/null +++ b/11.5.0/gentoo/03_all_default-warn-trampolines.patch @@ -0,0 +1,13 @@ +Enable -Wtrampolines by default. + +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -712,7 +712,7 @@ Common Var(warn_system_headers) Warning + Do not suppress warnings from system headers. + + Wtrampolines +-Common Var(warn_trampolines) Warning ++Common Var(warn_trampolines) Init(1) Warning + Warn whenever a trampoline is generated. + + Wtype-limits diff --git a/11.5.0/gentoo/04_all_nossp-on-nostdlib.patch b/11.5.0/gentoo/04_all_nossp-on-nostdlib.patch new file mode 100644 index 0000000..20afef1 --- /dev/null +++ b/11.5.0/gentoo/04_all_nossp-on-nostdlib.patch @@ -0,0 +1,27 @@ +Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding + +https://bugs.gentoo.org/484714 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -977,6 +977,12 @@ + #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" + #endif + ++#ifdef ENABLE_DEFAULT_SSP ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " ++#else ++#define NO_SSP_SPEC "" ++#endif ++ + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +@@ -1273,7 +1279,7 @@ + %{-version:--version}\ + %{-help=*:--help=%*}\ + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ +- %{fsyntax-only:-o %j} %{-param*}\ ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ diff --git a/11.5.0/gentoo/05_all_alpha-mieee-default.patch b/11.5.0/gentoo/05_all_alpha-mieee-default.patch new file mode 100644 index 0000000..cf33f14 --- /dev/null +++ b/11.5.0/gentoo/05_all_alpha-mieee-default.patch @@ -0,0 +1,39 @@ +Set the default behavior on alpha to use -mieee since the large majority of +time we want this (bad/weird things can happen with packages built without +it). + +To satisfy those people who may not want -mieee forced on them all the time, +we also provide -mno-ieee. + +Patch by Mike Frysinger <[email protected]> + +Note: upstream doesn't want to take this due to long standing behavior, and +because it'd make behavior across OS's inconsistent: + https://gcc.gnu.org/ml/gcc-patches/2003-07/msg02144.html + +This makes sense for upstream, but Gentoo is more concerned about packages +behaving the same across arches under Linux. + +--- a/gcc/config/alpha/alpha.h ++++ b/gcc/config/alpha/alpha.h +@@ -96,6 +96,8 @@ along with GCC; see the file COPYING3. If not see + while (0) + #endif + ++#define CPP_SPEC "%{!no-ieee:-mieee}" ++ + /* Run-time compilation parameters selecting different hardware subsets. */ + + /* Which processor to schedule for. The cpu attribute defines a list that +--- a/gcc/config/alpha/alpha.opt ++++ b/gcc/config/alpha/alpha.opt +@@ -35,7 +35,7 @@ + Request IEEE-conformant math library routines (OSF/1). + + mieee +-Target RejectNegative Mask(IEEE) ++Target Mask(IEEE) + Emit IEEE-conformant code, without inexact exceptions. + + mieee-with-inexact + diff --git a/11.5.0/gentoo/06_all_ia64_note.GNU-stack.patch b/11.5.0/gentoo/06_all_ia64_note.GNU-stack.patch new file mode 100644 index 0000000..66a787e --- /dev/null +++ b/11.5.0/gentoo/06_all_ia64_note.GNU-stack.patch @@ -0,0 +1,92 @@ +http://gcc.gnu.org/PR21098 + + +2004-09-20 Jakub Jelinek <[email protected]> + + * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also + on ppc64-linux. + + * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on + ia64-linux. + * config/ia64/crtbegin.asm: Likewise. + * config/ia64/crtend.asm: Likewise. + * config/ia64/crti.asm: Likewise. + * config/ia64/crtn.asm: Likewise. + +2004-05-14 Jakub Jelinek <[email protected]> + + * config/ia64/linux.h (TARGET_ASM_FILE_END): Define. + + +--- a/gcc/config/ia64/linux.h ++++ b/gcc/config/ia64/linux.h +@@ -24,6 +24,8 @@ a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack ++ + /* This is for -profile to use -lc_p instead of -lc. */ + #undef CC1_SPEC + #define CC1_SPEC "%{profile:-p} %{G*}" +--- a/gcc/config/rs6000/ppc-asm.h ++++ b/gcc/config/rs6000/ppc-asm.h +@@ -352,7 +352,7 @@ GLUE(.L,name): \ + #endif + #endif + +-#if defined __linux__ && !defined __powerpc64__ ++#if defined __linux__ + .section .note.GNU-stack + .previous + #endif +--- a/libgcc/config/ia64/crtbegin.S ++++ b/libgcc/config/ia64/crtbegin.S +@@ -252,3 +252,7 @@ __do_jv_register_classes: + .weak __cxa_finalize + #endif + .weak _Jv_RegisterClasses ++ ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +--- a/libgcc/config/ia64/crtend.S ++++ b/libgcc/config/ia64/crtend.S +@@ -119,3 +119,6 @@ __do_global_ctors_aux: + + br.ret.sptk.many rp + .endp __do_global_ctors_aux ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +--- a/libgcc/config/ia64/crti.S ++++ b/libgcc/config/ia64/crti.S +@@ -49,5 +49,8 @@ _fini: + .save rp, r33 + mov r33 = b0 + .body ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif + + # end of crti.S +--- a/libgcc/config/ia64/crtn.S ++++ b/libgcc/config/ia64/crtn.S +@@ -39,5 +39,8 @@ + .restore sp + mov r12 = r35 + br.ret.sptk.many b0 ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif + + # end of crtn.S +--- a/libgcc/config/ia64/lib1funcs.S ++++ b/libgcc/config/ia64/lib1funcs.S +@@ -793,3 +793,6 @@ __floattitf: + .endp __floattitf + #endif + #endif ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif diff --git a/11.5.0/gentoo/07_all_libiberty-asprintf.patch b/11.5.0/gentoo/07_all_libiberty-asprintf.patch new file mode 100644 index 0000000..702ae3c --- /dev/null +++ b/11.5.0/gentoo/07_all_libiberty-asprintf.patch @@ -0,0 +1,18 @@ +2008-07-25 Magnus Granberg <[email protected]> + + * include/libiberty.h (asprintf): Don't declare if defined as a macro + +--- a/include/libiberty.h ++++ b/include/libiberty.h +@@ -652,8 +652,11 @@ + /* Like sprintf but provides a pointer to malloc'd storage, which must + be freed by the caller. */ + ++/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */ ++#ifndef asprintf + extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2; + #endif ++#endif + + /* Like asprintf but allocates memory without fail. This works like + xmalloc. */ diff --git a/11.5.0/gentoo/08_all_libiberty-pic.patch b/11.5.0/gentoo/08_all_libiberty-pic.patch new file mode 100644 index 0000000..b6160a7 --- /dev/null +++ b/11.5.0/gentoo/08_all_libiberty-pic.patch @@ -0,0 +1,10 @@ +--- a/libiberty/Makefile.in ++++ b/libiberty/Makefile.in +@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) + $(AR) $(AR_FLAGS) $(TARGETLIB) \ + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ + $(RANLIB) $(TARGETLIB); \ ++ cp $(TARGETLIB) ../ ; \ + cd ..; \ + else true; fi + diff --git a/11.5.0/gentoo/09_all_nopie-all-flags.patch b/11.5.0/gentoo/09_all_nopie-all-flags.patch new file mode 100644 index 0000000..5563182 --- /dev/null +++ b/11.5.0/gentoo/09_all_nopie-all-flags.patch @@ -0,0 +1,18 @@ +We need to pass NO_PIE_CFLAGS to ALL_* so gcc don't fail when +we compile it with older gcc and pie. + +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -991,10 +991,10 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) + ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) + + # This is the variable to use when using $(COMPILER). +-ALL_COMPILERFLAGS = $(ALL_CXXFLAGS) ++ALL_COMPILERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS) + + # This is the variable to use when using $(LINKER). +-ALL_LINKERFLAGS = $(ALL_CXXFLAGS) ++ALL_LINKERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS) + + # Build and host support libraries. + diff --git a/11.5.0/gentoo/10_all_sh-drop-sysroot-suffix.patch b/11.5.0/gentoo/10_all_sh-drop-sysroot-suffix.patch new file mode 100644 index 0000000..b1c3591 --- /dev/null +++ b/11.5.0/gentoo/10_all_sh-drop-sysroot-suffix.patch @@ -0,0 +1,26 @@ +From 5eeeff19bb4978a8d3c0d53bc81744bc25d82993 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich <[email protected]> +Date: Sat, 14 Apr 2018 13:07:39 +0100 +Subject: [PATCH] gcc/config.gcc: sh-*: Disable sysroot-suffix (PR42947) + +sh-* is a multilib target. It is also one of 2 sysroot-prefix targets. +Unfortunately two options do not mix well. Attempt to use default +multilib flavour always prepends sysroot-prefix. + +Bug: https://bugs.gentoo.org/511548 +Bug: https://gcc.gnu.org/PR42947 +Signed-off-by: Sergei Trofimovich <[email protected]> +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -2866,8 +2866,6 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ + if test x${enable_incomplete_targets} = xyes ; then + tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1" + fi +- tm_file="$tm_file ./sysroot-suffix.h" +- tmake_file="$tmake_file t-sysroot-suffix" + ;; + sh-*-rtems*) + tmake_file="${tmake_file} sh/t-sh sh/t-rtems" +-- +2.17.0 + diff --git a/11.5.0/gentoo/11_all_ia64-TEXTREL.patch b/11.5.0/gentoo/11_all_ia64-TEXTREL.patch new file mode 100644 index 0000000..5059e4d --- /dev/null +++ b/11.5.0/gentoo/11_all_ia64-TEXTREL.patch @@ -0,0 +1,22 @@ +Fix textrels on -rdynamic binaries: +Bug: https://gcc.gnu.org/PR84553 +Bug: https://bugs.gentoo.org/566118 +--- a/gcc/config/ia64/ia64.c ++++ b/gcc/config/ia64/ia64.c +@@ -10838,12 +10838,14 @@ ia64_hpux_reloc_rw_mask (void) + + /* For others, relax this so that relocations to local data goes in + read-only segments, but we still cannot allow global relocations +- in read-only segments. */ ++ in read-only segments. Except that use of -rdynamic at link time ++ may make any local data global, so we can't allow local data in ++ read-only segments either. */ + + static int + ia64_reloc_rw_mask (void) + { +- return flag_pic ? 3 : 2; ++ return flag_pic ? 3 : 3; + } + + /* Return the section to use for X. The only special thing we do here diff --git a/11.5.0/gentoo/12_all_disable-systemtap-switch.patch b/11.5.0/gentoo/12_all_disable-systemtap-switch.patch new file mode 100644 index 0000000..d4ecefa --- /dev/null +++ b/11.5.0/gentoo/12_all_disable-systemtap-switch.patch @@ -0,0 +1,115 @@ +From bb510ed7ea82093c924b027489db6f92250a85b3 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich <[email protected]> +Date: Sat, 12 May 2018 12:56:46 +0100 +Subject: [PATCH] gcc/configure.ac: add --disable-systemtap switch + +Before the change systemtap probes were enabled +if target headers had sys/sdt.h at ./configure time. + +After the change explicitly ask to enable or disable +for probe support and not rely on automagic dependency +discovery. + +Bug: https://bugs.gentoo.org/654748 +Bug: https://gcc.gnu.org/bugzilla/PR61257 +Signed-off-by: Sergei Trofimovich <[email protected]> +--- a/gcc/configure ++++ b/gcc/configure +@@ -988,6 +988,7 @@ enable_gnu_unique_object + enable_linker_build_id + enable_libssp + enable_default_ssp ++enable_systemtap + with_long_double_128 + with_long_double_format + with_gc +@@ -1740,6 +1741,7 @@ Optional Features: + compiler will always pass --build-id to linker + --enable-libssp enable linking against libssp + --enable-default-ssp enable Stack Smashing Protection as default ++ --disable-systemtap enable systemtap static probe points [default=auto] + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer +@@ -29330,17 +29332,33 @@ fi + + # Test for <sys/sdt.h> on the target. + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5 ++ ++# Check whether --enable-systemtap was given. ++if test "${enable_systemtap+set}" = set; then : ++ enableval=$enable_systemtap; enable_systemtap=$enableval ++else ++ enable_systemtap=auto ++fi ++ ++ ++if test x$enable_systemtap != xno; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5 + $as_echo_n "checking sys/sdt.h in the target C library... " >&6; } +-have_sys_sdt_h=no +-if test -f $target_header_dir/sys/sdt.h; then +- have_sys_sdt_h=yes ++ have_sys_sdt_h=no ++ if test -f $target_header_dir/sys/sdt.h ; then ++ have_sys_sdt_h=yes + + $as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h + +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5 ++ fi ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5 + $as_echo "$have_sys_sdt_h" >&6; } ++ if test x$enable_systemtap = xyes ; then ++ if test x$have_sys_sdt_h = xno ; then ++ as_fn_error $? "sys/sdt.h was not found" "$LINENO" 5 ++ fi ++ fi ++fi + + # Check if TFmode long double should be used by default or not. + # Some glibc targets used DFmode long double, but with glibc 2.4 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -6000,14 +6000,28 @@ AC_SUBST([enable_default_ssp]) + + # Test for <sys/sdt.h> on the target. + GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H]) +-AC_MSG_CHECKING(sys/sdt.h in the target C library) +-have_sys_sdt_h=no +-if test -f $target_header_dir/sys/sdt.h; then +- have_sys_sdt_h=yes +- AC_DEFINE(HAVE_SYS_SDT_H, 1, +- [Define if your target C library provides sys/sdt.h]) +-fi +-AC_MSG_RESULT($have_sys_sdt_h) ++ ++AC_ARG_ENABLE(systemtap, ++[AS_HELP_STRING([--disable-systemtap], ++ [enable systemtap static probe points [default=auto]])], ++ enable_systemtap=$enableval, ++ enable_systemtap=auto) ++ ++if test x$enable_systemtap != xno; then ++ AC_MSG_CHECKING(sys/sdt.h in the target C library) ++ have_sys_sdt_h=no ++ if test -f $target_header_dir/sys/sdt.h ; then ++ have_sys_sdt_h=yes ++ AC_DEFINE(HAVE_SYS_SDT_H, 1, ++ [Define if your target C library provides sys/sdt.h]) ++ fi ++ AC_MSG_RESULT($have_sys_sdt_h) ++ if test x$enable_systemtap = xyes ; then ++ if test x$have_sys_sdt_h = xno ; then ++ AC_MSG_ERROR([sys/sdt.h was not found]) ++ fi ++ fi ++fi + + # Check if TFmode long double should be used by default or not. + # Some glibc targets used DFmode long double, but with glibc 2.4 +-- +2.17.0 + diff --git a/11.5.0/gentoo/13_all_m68k-textrel-on-libgcc.patch b/11.5.0/gentoo/13_all_m68k-textrel-on-libgcc.patch new file mode 100644 index 0000000..4cb8350 --- /dev/null +++ b/11.5.0/gentoo/13_all_m68k-textrel-on-libgcc.patch @@ -0,0 +1,87 @@ +https://gcc.gnu.org/PR86224 + +From 1d89df42bdaf0745fd2a0d294471ac16f0553707 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich <[email protected]> +Date: Sat, 28 Jul 2018 11:33:27 +0100 +Subject: [PATCH] libgcc: m68k: avoid absolute relocation in shared library + +Signed-off-by: Sergei Trofimovich <[email protected]> +--- a/libgcc/config/m68k/lb1sf68.S ++++ b/libgcc/config/m68k/lb1sf68.S +@@ -435,7 +435,10 @@ $_exception_handler: + .text + FUNC(__mulsi3) + .globl SYM (__mulsi3) ++ .globl SYM (__mulsi3_internal) ++ .hidden SYM (__mulsi3_internal) + SYM (__mulsi3): ++SYM (__mulsi3_internal): + movew sp@(4), d0 /* x0 -> d0 */ + muluw sp@(10), d0 /* x0*y1 */ + movew sp@(6), d1 /* x1 -> d1 */ +@@ -458,7 +461,10 @@ SYM (__mulsi3): + .text + FUNC(__udivsi3) + .globl SYM (__udivsi3) ++ .globl SYM (__udivsi3_internal) ++ .hidden SYM (__udivsi3_internal) + SYM (__udivsi3): ++SYM (__udivsi3_internal): + #ifndef __mcoldfire__ + movel d2, sp@- + movel sp@(12), d1 /* d1 = divisor */ +@@ -534,7 +540,10 @@ L2: subql IMM (1),d4 + .text + FUNC(__divsi3) + .globl SYM (__divsi3) ++ .globl SYM (__divsi3_internal) ++ .hidden SYM (__divsi3_internal) + SYM (__divsi3): ++SYM (__divsi3_internal): + movel d2, sp@- + + moveq IMM (1), d2 /* sign of result stored in d2 (=1 or =-1) */ +@@ -557,7 +566,7 @@ L1: movel sp@(8), d0 /* d0 = dividend */ + + L2: movel d1, sp@- + movel d0, sp@- +- PICCALL SYM (__udivsi3) /* divide abs(dividend) by abs(divisor) */ ++ PICCALL SYM (__udivsi3_internal) /* divide abs(dividend) by abs(divisor) */ + addql IMM (8), sp + + tstb d2 +@@ -577,13 +586,13 @@ SYM (__umodsi3): + movel sp@(4), d0 /* d0 = dividend */ + movel d1, sp@- + movel d0, sp@- +- PICCALL SYM (__udivsi3) ++ PICCALL SYM (__udivsi3_internal) + addql IMM (8), sp + movel sp@(8), d1 /* d1 = divisor */ + #ifndef __mcoldfire__ + movel d1, sp@- + movel d0, sp@- +- PICCALL SYM (__mulsi3) /* d0 = (a/b)*b */ ++ PICCALL SYM (__mulsi3_internal) /* d0 = (a/b)*b */ + addql IMM (8), sp + #else + mulsl d1,d0 +@@ -603,13 +612,13 @@ SYM (__modsi3): + movel sp@(4), d0 /* d0 = dividend */ + movel d1, sp@- + movel d0, sp@- +- PICCALL SYM (__divsi3) ++ PICCALL SYM (__divsi3_internal) + addql IMM (8), sp + movel sp@(8), d1 /* d1 = divisor */ + #ifndef __mcoldfire__ + movel d1, sp@- + movel d0, sp@- +- PICCALL SYM (__mulsi3) /* d0 = (a/b)*b */ ++ PICCALL SYM (__mulsi3_internal) /* d0 = (a/b)*b */ + addql IMM (8), sp + #else + mulsl d1,d0 +-- +2.18.0 + diff --git a/11.5.0/gentoo/14_all_respect-build-cxxflags.patch b/11.5.0/gentoo/14_all_respect-build-cxxflags.patch new file mode 100644 index 0000000..14139ea --- /dev/null +++ b/11.5.0/gentoo/14_all_respect-build-cxxflags.patch @@ -0,0 +1,39 @@ +Pass CXXFLAGS as CXXFLAGS_FOR_BUILD to stage1. + +Fixes build failure when CXXFLAGS contains +TARGET-specific flags. + +Tested on x86_64-pc-linux-gnu host as: + # CFLAGS='-O2 -mfpu=neon-vfpv4' CXXFLAGS='-O2 -mfpu=neon-vfpv4' \ + armv7a-unknown-linux-gnueabihf-emerge -v1 sys-devel/gcc --quiet-build=n + +Fix by Peter Levine. +https://bugs.gentoo.org/581406 +--- a/Makefile.in ++++ b/Makefile.in +@@ -170,6 +170,7 @@ + # built for the build system to override those in BASE_FLAGS_TO_PASS. + EXTRA_BUILD_FLAGS = \ + CFLAGS="$(CFLAGS_FOR_BUILD)" \ ++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)" + + # This is the list of directories to built for the host system. +@@ -710,6 +711,7 @@ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ + "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ ++ "CXXFLAGS_FOR_BUILD=$(CXXFLAGS_FOR_BUILD)" \ + "EXPECT=$(EXPECT)" \ + "FLEX=$(FLEX)" \ + "INSTALL=$(INSTALL)" \ +--- a/Makefile.tpl ++++ b/Makefile.tpl +@@ -172,6 +172,7 @@ + # built for the build system to override those in BASE_FLAGS_TO_PASS. + EXTRA_BUILD_FLAGS = \ + CFLAGS="$(CFLAGS_FOR_BUILD)" \ ++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)" + + # This is the list of directories to built for the host system. diff --git a/11.5.0/gentoo/15_all_libgomp-Werror.patch b/11.5.0/gentoo/15_all_libgomp-Werror.patch new file mode 100644 index 0000000..deda157 --- /dev/null +++ b/11.5.0/gentoo/15_all_libgomp-Werror.patch @@ -0,0 +1,26 @@ +libgomp does not respect --disable-werror + +https://bugs.gentoo.org/229059 +http://gcc.gnu.org/PR38436 +--- a/libgomp/configure.ac ++++ b/libgomp/configure.ac +@@ -123,7 +123,7 @@ + + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi + + # Find other programs we need. +--- a/libgomp/configure ++++ b/libgomp/configure +@@ -4613,7 +4613,7 @@ + + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi + + # Find other programs we need. diff --git a/11.5.0/gentoo/16_all_libitm-Werror.patch b/11.5.0/gentoo/16_all_libitm-Werror.patch new file mode 100644 index 0000000..c8e991c --- /dev/null +++ b/11.5.0/gentoo/16_all_libitm-Werror.patch @@ -0,0 +1,25 @@ +libitm does not respect --disable-werror + +https://bugs.gentoo.org/475350 +--- a/libitm/configure.ac ++++ b/libitm/configure.ac +@@ -263,7 +263,7 @@ + + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi + + XCFLAGS="$XCFLAGS $XPCFLAGS" +--- a/libitm/configure ++++ b/libitm/configure +@@ -17854,7 +17854,7 @@ + + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi + + XCFLAGS="$XCFLAGS $XPCFLAGS" diff --git a/11.5.0/gentoo/17_all_libatomic-Werror.patch b/11.5.0/gentoo/17_all_libatomic-Werror.patch new file mode 100644 index 0000000..7b29b04 --- /dev/null +++ b/11.5.0/gentoo/17_all_libatomic-Werror.patch @@ -0,0 +1,25 @@ +libatomic does not respect --disable-werror + +https://bugs.gentoo.org/475350 +--- a/libatomic/configure.ac ++++ b/libatomic/configure.ac +@@ -253,7 +253,7 @@ + + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi + + # Add CET specific flags if CET is enabled +--- a/libatomic/configure ++++ b/libatomic/configure +@@ -15562,7 +15562,7 @@ + + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi + + # Add CET specific flags if CET is enabled diff --git a/11.5.0/gentoo/18_all_libbacktrace-Werror.patch b/11.5.0/gentoo/18_all_libbacktrace-Werror.patch new file mode 100644 index 0000000..57dd284 --- /dev/null +++ b/11.5.0/gentoo/18_all_libbacktrace-Werror.patch @@ -0,0 +1,17 @@ +libbacktrace does not respect --disable-werror + +https://bugs.gentoo.org/667104 +--- a/libbacktrace/configure ++++ b/libbacktrace/configure +@@ -11634,3 +11634,3 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test -n "${with_target_subdir}"; then +- WARN_FLAGS="$WARN_FLAGS -Werror" ++ WARN_FLAGS="$WARN_FLAGS" + fi +--- a/libbacktrace/configure.ac ++++ b/libbacktrace/configure.ac +@@ -138,3 +138,3 @@ ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \ + if test -n "${with_target_subdir}"; then +- WARN_FLAGS="$WARN_FLAGS -Werror" ++ WARN_FLAGS="$WARN_FLAGS" + fi diff --git a/11.5.0/gentoo/19_all_libsanitizer-Werror.patch b/11.5.0/gentoo/19_all_libsanitizer-Werror.patch new file mode 100644 index 0000000..0e484a4 --- /dev/null +++ b/11.5.0/gentoo/19_all_libsanitizer-Werror.patch @@ -0,0 +1,17 @@ +libsanitizer does not respect --disable-werror + +https://bugs.gentoo.org/667104 +--- a/libsanitizer/libbacktrace/Makefile.am ++++ b/libsanitizer/libbacktrace/Makefile.am +@@ -37,3 +37,3 @@ AM_CPPFLAGS = -I $(top_srcdir)/../include -I $(top_srcdir)/../libgcc \ + WARN_FLAGS = -W -Wall -Wwrite-strings -Wmissing-format-attribute \ +- -Wcast-qual -Werror ++ -Wcast-qual + C_WARN_FLAGS = $(WARN_FLAGS) -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition +--- a/libsanitizer/libbacktrace/Makefile.in ++++ b/libsanitizer/libbacktrace/Makefile.in +@@ -297,3 +297,3 @@ AM_CPPFLAGS = -I $(top_srcdir)/../include -I $(top_srcdir)/../libgcc \ + WARN_FLAGS = -W -Wall -Wwrite-strings -Wmissing-format-attribute \ +- -Wcast-qual -Werror ++ -Wcast-qual + diff --git a/11.5.0/gentoo/20_all_libstdcxx-no-vtv.patch b/11.5.0/gentoo/20_all_libstdcxx-no-vtv.patch new file mode 100644 index 0000000..c079698 --- /dev/null +++ b/11.5.0/gentoo/20_all_libstdcxx-no-vtv.patch @@ -0,0 +1,97 @@ +Final libstdc++.so should not contain rpath to make libvtv usable. +It's up to final binaries to link against proper libvtv. + +Bug: https://bugs.gentoo.org/582524 +Bug: https://gcc.gnu.org/PR85884 +--- a/libstdc++-v3/src/Makefile.am ++++ b/libstdc++-v3/src/Makefile.am +@@ -266,7 +266,6 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) \ + $(LTLDFLAGS) $(LTLIBICONV) \ + -o $@ +--- a/libstdc++-v3/src/Makefile.in ++++ b/libstdc++-v3/src/Makefile.in +@@ -630,7 +630,6 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) \ + $(LTLDFLAGS) $(LTLIBICONV) \ + -o $@ +--- a/libstdc++-v3/src/c++11/Makefile.am ++++ b/libstdc++-v3/src/c++11/Makefile.am +@@ -214,5 +214,4 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +--- a/libstdc++-v3/src/c++11/Makefile.in ++++ b/libstdc++-v3/src/c++11/Makefile.in +@@ -580,7 +580,6 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + + all: all-am +--- a/libstdc++-v3/src/c++17/Makefile.am ++++ b/libstdc++-v3/src/c++17/Makefile.am +@@ -132,5 +132,4 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +--- a/libstdc++-v3/src/c++17/Makefile.in ++++ b/libstdc++-v3/src/c++17/Makefile.in +@@ -509,7 +509,6 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + + all: all-am +--- a/libstdc++-v3/src/c++20/Makefile.am ++++ b/libstdc++-v3/src/c++20/Makefile.am +@@ -101,5 +101,4 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +--- a/libstdc++-v3/src/c++20/Makefile.in ++++ b/libstdc++-v3/src/c++20/Makefile.in +@@ -486,7 +486,6 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + + all: all-am +--- a/libstdc++-v3/src/c++98/Makefile.am ++++ b/libstdc++-v3/src/c++98/Makefile.am +@@ -268,5 +268,4 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +--- a/libstdc++-v3/src/c++98/Makefile.in ++++ b/libstdc++-v3/src/c++98/Makefile.in +@@ -582,7 +582,6 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + + all: all-am diff --git a/11.5.0/gentoo/21_all_default_ssp-buffer-size.patch b/11.5.0/gentoo/21_all_default_ssp-buffer-size.patch new file mode 100644 index 0000000..ae5a707 --- /dev/null +++ b/11.5.0/gentoo/21_all_default_ssp-buffer-size.patch @@ -0,0 +1,14 @@ +Change the minimal SSP buffer size. + +https://bugs.gentoo.org/484714 +--- a/gcc/params.opt ++++ b/gcc/params.opt +@@ -849,7 +849,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim + The maximum number of SSA_NAME assignments to follow in determining a value. + + -param=ssp-buffer-size= +-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization ++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization + The lower bound for a buffer to be considered for stack smashing protection. + + -param=stack-clash-protection-guard-size= diff --git a/11.5.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch b/11.5.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch new file mode 100644 index 0000000..630d900 --- /dev/null +++ b/11.5.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch @@ -0,0 +1,26 @@ +On Hardened we add some options like -z now + +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -994,6 +994,12 @@ + #endif + #endif + ++#ifdef EXTRA_OPTIONS ++#define LINK_NOW_SPEC "%{!nonow:-z now} " ++#else ++#define LINK_NOW_SPEC "" ++#endif ++ + #ifdef ENABLE_DEFAULT_PIE + #define PIE_SPEC "!no-pie" + #define NO_FPIE1_SPEC "fno-pie" +@@ -1154,7 +1160,7 @@ + %(linker) " \ + LINK_PLUGIN_SPEC \ + "%{flto|flto=*:%<fcompare-debug*} \ +- %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \ ++ %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC LINK_NOW_SPEC \ + "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \ + "%X %{o*} %{e*} %{N} %{n} %{r}\ + %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ diff --git a/11.5.0/gentoo/23_all_EXTRA_OPTIONS-fstack-clash-protection.patch b/11.5.0/gentoo/23_all_EXTRA_OPTIONS-fstack-clash-protection.patch new file mode 100644 index 0000000..1db9de1 --- /dev/null +++ b/11.5.0/gentoo/23_all_EXTRA_OPTIONS-fstack-clash-protection.patch @@ -0,0 +1,65 @@ +On Hardened we add some options like -fstack-clash-protection. + +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -2367,7 +2367,7 @@ Common Alias(fstack-check=, specific, no + Insert stack checking code into the program. Same as -fstack-check=specific. + + fstack-clash-protection +-Common Var(flag_stack_clash_protection) Optimization ++Common Var(flag_stack_clash_protection) Optimization Init(-1) + Insert code to probe each page of stack space as it is allocated to protect + from stack-clash style attacks. + +--- a/gcc/defaults.h ++++ b/gcc/defaults.h +@@ -1435,6 +1435,15 @@ see the files COPYING3 and COPYING.RUNTI + #define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100) + #endif + ++/* Default value for flag_clash_protector when flag_clash_protector is ++ initialized to -1. */ ++#ifdef EXTRA_OPTIONS ++#define DEFAULT_FLAG_SCP 1 ++#endif ++#ifndef DEFAULT_FLAG_SCP ++#define DEFAULT_FLAG_SCP 0 ++#endif ++ + /* By default, the C++ compiler will use function addresses in the + vtable entries. Setting this nonzero tells the compiler to use + function descriptors instead. The value of this macro says how +--- a/gcc/toplev.c ++++ b/gcc/toplev.c +@@ -1682,6 +1682,10 @@ process_options (void) + + /* -fstack-clash-protection is not currently supported on targets + where the stack grows up. */ ++ if (flag_stack_clash_protection == -1) ++ { ++ flag_stack_clash_protection = DEFAULT_FLAG_SCP; ++ } + if (flag_stack_clash_protection && !STACK_GROWS_DOWNWARD) + { + warning_at (UNKNOWN_LOCATION, 0, + +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -225,7 +225,7 @@ endif + LIBGCC2_DEBUG_CFLAGS = -g + LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \ + $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \ +- -fbuilding-libgcc -fno-stack-protector \ ++ -fbuilding-libgcc -fno-stack-protector -fno-stack-clash-protection \ + $(INHIBIT_LIBC_CFLAGS) + + # Additional options to use when compiling libgcc2.a. +@@ -279,7 +290,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF + $(NO_PIE_CFLAGS) -finhibit-size-directive -fno-inline -fno-exceptions \ + -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ + -fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \ +- $(INHIBIT_LIBC_CFLAGS) $(USE_TM_CLONE_REGISTRY) ++ -fno-stack-clash-protection $(INHIBIT_LIBC_CFLAGS) $(USE_TM_CLONE_REGISTRY) + + # Extra flags to use when compiling crt{begin,end}.o. + CRTSTUFF_T_CFLAGS = diff --git a/11.5.0/gentoo/24_all_lto-intl-workaround-PR95194.patch b/11.5.0/gentoo/24_all_lto-intl-workaround-PR95194.patch new file mode 100644 index 0000000..9613216 --- /dev/null +++ b/11.5.0/gentoo/24_all_lto-intl-workaround-PR95194.patch @@ -0,0 +1,20 @@ +Trick libintl not to use '_INTL_REDIRECT_ASM' mode as it's +incompatible with LTO builds. + +glibc does not normally use libintl implementations and uses +it's own primitives. But musl ond others do fall back to libintl. + +Reported-by: Andrew Savchenko +Bug: https://bugs.gentoo.org/723370 +Bug: https://gcc.gnu.org/PR95194 +--- a/intl/libgnuintl.h ++++ b/intl/libgnuintl.h +@@ -93,7 +93,7 @@ extern "C" { + If he doesn't, we choose the method. A third possible method is + _INTL_REDIRECT_ASM, supported only by GCC. */ + #if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) +-# if __GNUC__ >= 2 && !defined __APPLE_CC__ && (defined __STDC__ || defined __cplusplus) ++# if __GNUC__ >= 2 && !defined __APPLE_CC__ && (defined __STDC__ || defined __cplusplus) && USE_ASM_ALIASES_THAT_BREAK_LTO + # define _INTL_REDIRECT_ASM + # else + # ifdef __cplusplus diff --git a/11.5.0/gentoo/25_all_plugin-objdump.patch b/11.5.0/gentoo/25_all_plugin-objdump.patch new file mode 100644 index 0000000..a9c33fd --- /dev/null +++ b/11.5.0/gentoo/25_all_plugin-objdump.patch @@ -0,0 +1,34 @@ +https://gcc.gnu.org/PR95648 +--- a/config/gcc-plugin.m4 ++++ b/config/gcc-plugin.m4 +@@ -45,7 +45,7 @@ AC_DEFUN([GCC_ENABLE_PLUGINS], + ;; + *) + if test x$build = x$host; then +- export_sym_check="objdump${exeext} -T" ++ export_sym_check="$ac_cv_prog_OBJDUMP -T" + elif test x$host = x$target; then + export_sym_check="$gcc_cv_objdump -T" + else +--- a/gcc/configure ++++ b/gcc/configure +@@ -30386,7 +30386,7 @@ fi + ;; + *) + if test x$build = x$host; then +- export_sym_check="objdump${exeext} -T" ++ export_sym_check="$ac_cv_prog_OBJDUMP -T" + elif test x$host = x$target; then + export_sym_check="$gcc_cv_objdump -T" + else +--- a/libcc1/configure ++++ b/libcc1/configure +@@ -14819,7 +14819,7 @@ fi + ;; + *) + if test x$build = x$host; then +- export_sym_check="objdump${exeext} -T" ++ export_sym_check="$ac_cv_prog_OBJDUMP -T" + elif test x$host = x$target; then + export_sym_check="$gcc_cv_objdump -T" + else diff --git a/11.5.0/gentoo/27_all_msgfmt-libstdc++-link.patch b/11.5.0/gentoo/27_all_msgfmt-libstdc++-link.patch new file mode 100644 index 0000000..0d2f113 --- /dev/null +++ b/11.5.0/gentoo/27_all_msgfmt-libstdc++-link.patch @@ -0,0 +1,39 @@ +Ensure that msgfmt doesn't encounter problems during gcc bootstrapping. + +Solves error messages like the following: + +msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6) + +The libgcc_s.so used during build doesn't satisfy the needs of the +libstdc++.so that msgfmt is linked against. On the other hand, msgfmt +is used as a stand-alone application here, and what library it uses +behind the scenes is of no concern to the gcc build process. +Therefore, simply invoking it "as usual", i.e. without any special +library path, will make it work as expected here. + +2011-09-19 Martin von Gagern + +References: +https://bugs.gentoo.org/372377 +https://bugs.gentoo.org/295480 +https://bugs.gentoo.org/843119 +--- a/libstdc++-v3/po/Makefile.am ++++ b/libstdc++-v3/po/Makefile.am +@@ -39,6 +39,7 @@ MSGFMT = msgfmt + EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN) + + .po.mo: ++ env --unset=LD_LIBRARY_PATH \ + $(MSGFMT) -o $@ $< + + all-local: all-local-$(USE_NLS) +--- a/libstdc++-v3/po/Makefile.in ++++ b/libstdc++-v3/po/Makefile.in +@@ -419,6 +419,7 @@ uninstall-am: uninstall-info-am + + + .po.mo: ++ env --unset=LD_LIBRARY_PATH \ + $(MSGFMT) -o $@ $< + + all-local: all-local-$(USE_NLS) diff --git a/11.5.0/gentoo/28_all_drop_CFLAGS_sed.patch b/11.5.0/gentoo/28_all_drop_CFLAGS_sed.patch new file mode 100644 index 0000000..0a9fa13 --- /dev/null +++ b/11.5.0/gentoo/28_all_drop_CFLAGS_sed.patch @@ -0,0 +1,35 @@ +https://bugs.gentoo.org/849722 +https://github.com/InBetweenNames/gentooLTO/issues/846 +https://github.com/vaeth/portage-bashrc-mv/issues/11 +--- a/gcc/configure ++++ b/gcc/configure +@@ -5265,13 +5265,6 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +-# Remove the -O2: for historical reasons, unless bootstrapping we prefer +-# optimizations to be activated explicitly by the toplevel. +-case "$CC" in +- */prev-gcc/xgcc*) ;; +- *) CFLAGS=`echo "$CFLAGS " | sed -e "s/-Ofast[ ]//" -e "s/-O[gs][ ]//" -e "s/-O[0-9]*[ ]//" ` +- CXXFLAGS=`echo "$CXXFLAGS " | sed -e "s/-Ofast[ ]//" -e "s/-O[gs][ ]//" -e "s/-O[0-9]*[ ]//" ` ;; +-esac + + + +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -439,13 +439,6 @@ ACX_PROG_GNAT([-I"$srcdir"/ada/libgnat]) + # Do configure tests with the C++ compiler, since that's what we build with. + AC_LANG(C++) + +-# Remove the -O2: for historical reasons, unless bootstrapping we prefer +-# optimizations to be activated explicitly by the toplevel. +-case "$CC" in +- */prev-gcc/xgcc*) ;; +- *) CFLAGS=`echo "$CFLAGS " | sed -e "s/-Ofast[[ ]]//" -e "s/-O[[gs]][[ ]]//" -e "s/-O[[0-9]]*[[ ]]//" ` +- CXXFLAGS=`echo "$CXXFLAGS " | sed -e "s/-Ofast[[ ]]//" -e "s/-O[[gs]][[ ]]//" -e "s/-O[[0-9]]*[[ ]]//" ` ;; +-esac + AC_SUBST(CFLAGS) + AC_SUBST(CXXFLAGS) + diff --git a/11.5.0/gentoo/29_all_tar_libstdc++-link.patch b/11.5.0/gentoo/29_all_tar_libstdc++-link.patch new file mode 100644 index 0000000..680ab38 --- /dev/null +++ b/11.5.0/gentoo/29_all_tar_libstdc++-link.patch @@ -0,0 +1,57 @@ +From eae11e896edef4199a128bf6720b5bd4e5edc2f9 Mon Sep 17 00:00:00 2001 +From: Sam James <[email protected]> +Date: Sat, 17 Dec 2022 02:42:59 +0000 +Subject: [PATCH] Fix calling libarchive's tar + +https://bugs.gentoo.org/886447 + +Very similar to 33_all_msgfmt-libstdc++-link.patch, whose description is: +""" +Ensure that msgfmt doesn't encounter problems during gcc bootstrapping. + +Solves error messages like the following: + +msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6) + +The libgcc_s.so used during build doesn't satisfy the needs of the +libstdc++.so that msgfmt is linked against. On the other hand, msgfmt +is used as a stand-alone application here, and what library it uses +behind the scenes is of no concern to the gcc build process. +Therefore, simply invoking it "as usual", i.e. without any special +library path, will make it work as expected here. + +2011-09-19 Martin von Gagern + +References: +https://bugs.gentoo.org/372377 +https://bugs.gentoo.org/295480 +https://bugs.gentoo.org/843119 +""" + +Signed-off-by: Sam James <[email protected]> +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -3902,10 +3902,10 @@ install-headers-tar: stmp-int-hdrs install-include-dir + # Unless a full pathname is provided, some shells would print the new CWD, + # found in CDPATH, corrupting the output. We could just redirect the + # output of `cd', but some shells lose on redirection within `()'s +- (cd `${PWD_COMMAND}`/include ; \ +- tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - ) +- (cd `${PWD_COMMAND}`/include-fixed ; \ +- tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - ) ++ (unset LD_LIBRARY_PATH ; cd `${PWD_COMMAND}`/include ; \ ++ tar -cf - .; exit 0) | (unset LD_LIBRARY_PATH ; cd $(DESTDIR)$(libsubdir)/include; tar xpf - ) ++ (unset LD_LIBRARY_PATH ; cd `${PWD_COMMAND}`/include-fixed ; \ ++ tar -cf - .; exit 0) | (unset LD_LIBRARY_PATH ; cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - ) + # /bin/sh on some systems returns the status of the first tar, + # and that can lose with GNU tar which always writes a full block. + # So use `exit 0' to ignore its exit status. +@@ -3926,7 +3926,7 @@ install-headers-cp: stmp-int-hdrs install-include-dir + # Targets without dependencies, for use in prev-gcc during bootstrap. + real-install-headers-tar: + (cd `${PWD_COMMAND}`/include-fixed ; \ +- tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - ) ++ unset LD_LIBRARY_PATH; tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; unset LD_LIBRARY_PATH; tar xpf - ) + + real-install-headers-cpio: + cd `${PWD_COMMAND}`/include-fixed ; \ diff --git a/11.5.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i486.patch b/11.5.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i486.patch new file mode 100644 index 0000000..f953e09 --- /dev/null +++ b/11.5.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i486.patch @@ -0,0 +1,373 @@ +https://bugs.gentoo.org/777117 +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99703 + +From: "H.J. Lu" <[email protected]> +Date: Fri, 12 Feb 2021 16:30:23 -0800 +Subject: GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs + +Backport of fd7eb4bc94cafa745eba75c64fa483a1689a5aad to GCC 11 + +Sync with binutils for PR binutils/27397. Check if host supports +multi-byte NOPs before enabling CET on host. + +config/ + + PR bootstrap/99703 + * cet.m4 (GCC_CET_HOST_FLAGS): Check if host supports multi-byte + NOPs. + +All applicable configure scripts have been regenerated. Patch hunks +which only updated line numbers have been excluded to reduce conflicts. + +--- a/config/cet.m4 ++++ b/config/cet.m4 +@@ -130,6 +130,18 @@ fi + if test x$may_have_cet = xyes; then + if test x$cross_compiling = xno; then + AC_TRY_RUN([ ++int ++main () ++{ ++ asm ("endbr32"); ++ return 0; ++} ++ ], ++ [have_multi_byte_nop=yes], ++ [have_multi_byte_nop=no]) ++ have_cet=no ++ if test x$have_multi_byte_nop = xyes; then ++ AC_TRY_RUN([ + static void + foo (void) + { +@@ -155,9 +167,10 @@ main () + bar (); + return 0; + } +- ], +- [have_cet=no], +- [have_cet=yes]) ++ ], ++ [have_cet=no], ++ [have_cet=yes]) ++ fi + if test x$enable_cet = xno -a x$have_cet = xyes; then + AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host]) + fi +--- a/gcc/configure ++++ b/gcc/configure +@@ -32416,6 +32416,34 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + ++int ++main () ++{ ++ asm ("endbr32"); ++ return 0; ++} ++ ++_ACEOF ++if ac_fn_cxx_try_run "$LINENO"; then : ++ have_multi_byte_nop=yes ++else ++ have_multi_byte_nop=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ have_cet=no ++ if test x$have_multi_byte_nop = xyes; then ++ if test "$cross_compiling" = yes; then : ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "cannot run test program while cross compiling ++See \`config.log' for more details" "$LINENO" 5; } ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ + static void + foo (void) + { +@@ -32452,6 +32480,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ++ fi + if test x$enable_cet = xno -a x$have_cet = xyes; then + as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 + fi +--- a/libbacktrace/configure ++++ b/libbacktrace/configure +@@ -12517,6 +12517,34 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + ++int ++main () ++{ ++ asm ("endbr32"); ++ return 0; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ have_multi_byte_nop=yes ++else ++ have_multi_byte_nop=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ have_cet=no ++ if test x$have_multi_byte_nop = xyes; then ++ if test "$cross_compiling" = yes; then : ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "cannot run test program while cross compiling ++See \`config.log' for more details" "$LINENO" 5; } ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ + static void + foo (void) + { +@@ -12553,6 +12581,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ++ fi + if test x$enable_cet = xno -a x$have_cet = xyes; then + as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 + fi +--- a/libcc1/configure ++++ b/libcc1/configure +@@ -14653,6 +14653,34 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + ++int ++main () ++{ ++ asm ("endbr32"); ++ return 0; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ have_multi_byte_nop=yes ++else ++ have_multi_byte_nop=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ have_cet=no ++ if test x$have_multi_byte_nop = xyes; then ++ if test "$cross_compiling" = yes; then : ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "cannot run test program while cross compiling ++See \`config.log' for more details" "$LINENO" 5; } ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ + static void + foo (void) + { +@@ -14689,6 +14717,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ++ fi + if test x$enable_cet = xno -a x$have_cet = xyes; then + as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 + fi +--- a/libcpp/configure ++++ b/libcpp/configure +@@ -7668,6 +7668,34 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + ++int ++main () ++{ ++ asm ("endbr32"); ++ return 0; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ have_multi_byte_nop=yes ++else ++ have_multi_byte_nop=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ have_cet=no ++ if test x$have_multi_byte_nop = xyes; then ++ if test "$cross_compiling" = yes; then : ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "cannot run test program while cross compiling ++See \`config.log' for more details" "$LINENO" 5; } ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ + static void + foo (void) + { +@@ -7704,6 +7732,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ++ fi + if test x$enable_cet = xno -a x$have_cet = xyes; then + as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 + fi +--- a/libdecnumber/configure ++++ b/libdecnumber/configure +@@ -5321,6 +5321,34 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + ++int ++main () ++{ ++ asm ("endbr32"); ++ return 0; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ have_multi_byte_nop=yes ++else ++ have_multi_byte_nop=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ have_cet=no ++ if test x$have_multi_byte_nop = xyes; then ++ if test "$cross_compiling" = yes; then : ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "cannot run test program while cross compiling ++See \`config.log' for more details" "$LINENO" 5; } ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ + static void + foo (void) + { +@@ -5357,6 +5385,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ++ fi + if test x$enable_cet = xno -a x$have_cet = xyes; then + as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 + fi +--- a/libiberty/configure ++++ b/libiberty/configure +@@ -5396,6 +5396,34 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + ++int ++main () ++{ ++ asm ("endbr32"); ++ return 0; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ have_multi_byte_nop=yes ++else ++ have_multi_byte_nop=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ have_cet=no ++ if test x$have_multi_byte_nop = xyes; then ++ if test "$cross_compiling" = yes; then : ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "cannot run test program while cross compiling ++See \`config.log' for more details" "$LINENO" 5; } ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ + static void + foo (void) + { +@@ -5432,6 +5460,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ++ fi + if test x$enable_cet = xno -a x$have_cet = xyes; then + as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 + fi +--- a/lto-plugin/configure ++++ b/lto-plugin/configure +@@ -5791,6 +5791,34 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + ++int ++main () ++{ ++ asm ("endbr32"); ++ return 0; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ have_multi_byte_nop=yes ++else ++ have_multi_byte_nop=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ have_cet=no ++ if test x$have_multi_byte_nop = xyes; then ++ if test "$cross_compiling" = yes; then : ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "cannot run test program while cross compiling ++See \`config.log' for more details" "$LINENO" 5; } ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ + static void + foo (void) + { +@@ -5827,6 +5855,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ++ fi + if test x$enable_cet = xno -a x$have_cet = xyes; then + as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 + fi +-- +2.34.1 diff --git a/11.5.0/gentoo/76_all_all_PR103910_12_ICE-on-PCH.patch b/11.5.0/gentoo/76_all_all_PR103910_12_ICE-on-PCH.patch new file mode 100644 index 0000000..358b9b3 --- /dev/null +++ b/11.5.0/gentoo/76_all_all_PR103910_12_ICE-on-PCH.patch @@ -0,0 +1,35 @@ +https://bugs.gentoo.org/822690 +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103910 + +From d243f4009d8071b734df16cd70f4c5d09a373769 Mon Sep 17 00:00:00 2001 +From: Andrew Pinski <[email protected]> +Date: Wed, 5 Jan 2022 22:00:07 +0000 +Subject: [PATCH] Fix target/103910: missing GTY on x86_mfence causing PCH + usage to ICE + +With -O3 -march=opteron, a mfence builtin is added after the loop +to say the nontemporal stores are no longer needed. This all good +without precompiled headers as the function decl that is referneced +by x86_mfence is referenced in another variable but with precompiled +headers, x86_mfence is all messed up and the decl was GC'ed away. +This fixes the problem by marking x86_mfence as GTY to save/restore +during precompiled headers just like most other variables in +the header file. + +Committed as obvious after a bootstrap/test on x86_64-linux-gnu. + +gcc/ChangeLog: + + PR target/103910 + * config/i386/i386.h (x86_mfence): Mark with GTY. +--- a/gcc/config/i386/i386.h ++++ b/gcc/config/i386/i386.h +@@ -486,7 +486,7 @@ extern unsigned char ix86_prefetch_sse; + + /* Fence to use after loop using storent. */ + +-extern tree x86_mfence; ++extern GTY(()) tree x86_mfence; + #define FENCE_FOLLOWING_MOVNT x86_mfence + + /* Once GDB has been enhanced to deal with functions without frame diff --git a/11.5.0/gentoo/77_all_PR115917-ada-lto.patch b/11.5.0/gentoo/77_all_PR115917-ada-lto.patch new file mode 100644 index 0000000..2e25ddf --- /dev/null +++ b/11.5.0/gentoo/77_all_PR115917-ada-lto.patch @@ -0,0 +1,52 @@ +From dd97dff998c9fc35e36397fc647f7360e1cadf70 Mon Sep 17 00:00:00 2001 +Message-ID: <dd97dff998c9fc35e36397fc647f7360e1cadf70.1727635310.git....@gentoo.org> +From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <[email protected]> +Date: Thu, 15 Aug 2024 19:17:41 +0200 +Subject: [PATCH] gnat: fix lto-type-mismatch between C_Version_String and + gnat_version_string [PR115917] + +gcc/ada/ChangeLog: + + PR ada/115917 + * gnatvsn.ads: Add note about the duplication of this value in + version.c. + * version.c (VER_LEN_MAX): Define to the same value as + Gnatvsn.Ver_Len_Max. + (gnat_version_string): Use VER_LEN_MAX as bound. + +(cherry picked from commit 9cbcf8d1de159e6113fafb5dc2feb4a7e467a302) +--- + gcc/ada/gnatvsn.ads | 3 ++- + gcc/ada/version.c | 5 ++++- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads +index 47a06b96c3cf..99d06c7e5aa4 100644 +--- a/gcc/ada/gnatvsn.ads ++++ b/gcc/ada/gnatvsn.ads +@@ -83,7 +83,8 @@ package Gnatvsn is + -- space to store any possible version string value for checks. This + -- value should never be decreased in the future, but it would be + -- OK to increase it if absolutely necessary. If it is increased, +- -- be sure to increase GNAT.Compiler.Version.Ver_Len_Max as well. ++ -- be sure to increase GNAT.Compiler.Version.Ver_Len_Max, and to update ++ -- the VER_LEN_MAX define in version.c as well. + + Ver_Prefix : constant String := "GNAT Version: "; + -- Prefix generated by binder. If it is changed, be sure to change +diff --git a/gcc/ada/version.c b/gcc/ada/version.c +index 5e64edd0b17d..2fa9b8c2c859 100644 +--- a/gcc/ada/version.c ++++ b/gcc/ada/version.c +@@ -31,4 +31,7 @@ + + #include "version.h" + +-char gnat_version_string[] = version_string; ++/* Logically a reference to Gnatvsn.Ver_Len_Max. Please keep in sync. */ ++#define VER_LEN_MAX 256 ++ ++char gnat_version_string[VER_LEN_MAX] = version_string; +-- +2.46.2 + diff --git a/11.5.0/gentoo/README.history b/11.5.0/gentoo/README.history new file mode 100644 index 0000000..7445ba8 --- /dev/null +++ b/11.5.0/gentoo/README.history @@ -0,0 +1,33 @@ +1 15 Dec 2024 + + + 01_all_default-fortify-source.patch + + 02_all_default-warn-format-security.patch + + 03_all_default-warn-trampolines.patch + + 04_all_nossp-on-nostdlib.patch + + 05_all_alpha-mieee-default.patch + + 06_all_ia64_note.GNU-stack.patch + + 07_all_libiberty-asprintf.patch + + 08_all_libiberty-pic.patch + + 09_all_nopie-all-flags.patch + + 10_all_sh-drop-sysroot-suffix.patch + + 11_all_ia64-TEXTREL.patch + + 12_all_disable-systemtap-switch.patch + + 13_all_m68k-textrel-on-libgcc.patch + + 14_all_respect-build-cxxflags.patch + + 15_all_libgomp-Werror.patch + + 16_all_libitm-Werror.patch + + 17_all_libatomic-Werror.patch + + 18_all_libbacktrace-Werror.patch + + 19_all_libsanitizer-Werror.patch + + 20_all_libstdcxx-no-vtv.patch + + 21_all_default_ssp-buffer-size.patch + + 22_all_EXTRA_OPTIONS-z-now.patch + + 23_all_EXTRA_OPTIONS-fstack-clash-protection.patch + + 24_all_lto-intl-workaround-PR95194.patch + + 25_all_plugin-objdump.patch + + 27_all_msgfmt-libstdc++-link.patch + + 28_all_drop_CFLAGS_sed.patch + + 29_all_tar_libstdc++-link.patch + + 75_all_x86_PR99703_12_no-cet-for-i486.patch + + 76_all_all_PR103910_12_ICE-on-PCH.patch + + 77_all_PR115917-ada-lto.patch diff --git a/11.5.0/musl/25_all_multilib_pure64.patch b/11.5.0/musl/25_all_multilib_pure64.patch new file mode 100644 index 0000000..d55c04c --- /dev/null +++ b/11.5.0/musl/25_all_multilib_pure64.patch @@ -0,0 +1,83 @@ +https://bugs.gentoo.org/675954 +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90077 + +--- a/gcc/config/aarch64/t-aarch64-linux ++++ b/gcc/config/aarch64/t-aarch64-linux +@@ -22,7 +22,7 @@ + LIB1ASMFUNCS = _aarch64_sync_cache_range + + AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) +-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) ++MULTILIB_OSDIRNAMES = mabi.lp64=../lib + MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu) + + MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) +--- a/gcc/config/i386/t-linux64 ++++ b/gcc/config/i386/t-linux64 +@@ -33,6 +33,6 @@ + comma=, + MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) + MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) +-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) +-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) +-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) ++MULTILIB_OSDIRNAMES = m64=../lib ++MULTILIB_OSDIRNAMES+= m32=../lib32 ++MULTILIB_OSDIRNAMES+= mx32=../libx32 +--- a/gcc/config/rs6000/t-linux ++++ b/gcc/config/rs6000/t-linux +@@ -2,7 +2,8 @@ + # or soft-float. + ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float))) + ifneq (,$(findstring powerpc64,$(target))) +-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + else + MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu) + endif +@@ -10,7 +11,8 @@ + MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME)) + endif + ifneq (,$(findstring powerpc64le,$(target))) +-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + endif + endif + +--- a/gcc/config/rs6000/t-linux64 ++++ b/gcc/config/rs6000/t-linux64 +@@ -28,8 +28,8 @@ + MULTILIB_OPTIONS := m64/m32 + MULTILIB_DIRNAMES := 64 32 + MULTILIB_EXTRA_OPTS := +-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu) +-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + + rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c + $(COMPILE) $< +--- a/gcc/config/rs6000/t-linux64bele ++++ b/gcc/config/rs6000/t-linux64bele +@@ -2,6 +2,6 @@ + + MULTILIB_OPTIONS += mlittle + MULTILIB_DIRNAMES += le +-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)))))) +-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES))) ++MULTILIB_OSDIRNAMES = m64=../lib ++MULTILIB_OSDIRNAMES+= m32=../lib32 + MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} +--- a/gcc/config/rs6000/t-linux64lebe ++++ b/gcc/config/rs6000/t-linux64lebe +@@ -2,6 +2,6 @@ + + MULTILIB_OPTIONS += mbig + MULTILIB_DIRNAMES += be +-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES)))))) +-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES))) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} diff --git a/11.5.0/musl/50_all_calloc_libgccjit.patch b/11.5.0/musl/50_all_calloc_libgccjit.patch new file mode 100644 index 0000000..bbb6787 --- /dev/null +++ b/11.5.0/musl/50_all_calloc_libgccjit.patch @@ -0,0 +1,122 @@ +https://git.alpinelinux.org/aports/plain/main/gcc/0042-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch +https://bugs.gentoo.org/828580 +https://bugs.gentoo.org/851555 + +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106102 +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104799 + +From 72f32e3383129ad139df76d9a063fac9b03079b1 Mon Sep 17 00:00:00 2001 +From: Alex McGrath <[email protected]> +Date: Wed, 13 Oct 2021 23:24:27 +0100 +Subject: [PATCH] Fix attempt to use poisoned calloc error in libgccjit + +This moves usages of pthread.h to above any usage of system.h as it +included #pragma GCC poison calloc +--- a/gcc/cp/mapper-client.cc ++++ b/gcc/cp/mapper-client.cc +@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see + #define INCLUDE_STRING + #define INCLUDE_VECTOR + #define INCLUDE_MAP ++#include <pthread.h> + #include "system.h" + + #include "line-map.h" +--- a/gcc/cp/mapper-resolver.cc ++++ b/gcc/cp/mapper-resolver.cc +@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see + #define INCLUDE_VECTOR + #define INCLUDE_ALGORITHM + #define INCLUDE_MAP ++#include <pthread.h> + #include "system.h" + + // We don't want or need to be aware of networking +--- a/gcc/cp/module.cc ++++ b/gcc/cp/module.cc +@@ -204,6 +204,7 @@ Classes used: + #include "config.h" + #define INCLUDE_STRING + #define INCLUDE_VECTOR ++#include <pthread.h> + #include "system.h" + #include "coretypes.h" + #include "cp-tree.h" +--- a/gcc/jit/jit-playback.c ++++ b/gcc/jit/jit-playback.c +@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + ++#include <pthread.h> ++ + #include "config.h" + #include "system.h" + #include "coretypes.h" +@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3. If not see + #include "diagnostic.h" + #include "stmt.h" + +-#include <pthread.h> +- + #include "jit-playback.h" + #include "jit-result.h" + #include "jit-builtins.h" +--- a/gcc/jit/jit-recording.c ++++ b/gcc/jit/jit-recording.c +@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + ++#include <pthread.h> ++ + #include "config.h" + #include "system.h" + #include "coretypes.h" +@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3. If not see + #include "pretty-print.h" + #include "toplev.h" + +-#include <pthread.h> +- + #include "jit-builtins.h" + #include "jit-recording.h" + #include "jit-playback.h" +--- a/gcc/jit/libgccjit.c ++++ b/gcc/jit/libgccjit.c +@@ -18,13 +18,14 @@ You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + ++#include <pthread.h> ++ + #include "config.h" + #include "system.h" + #include "coretypes.h" + #include "timevar.h" + #include "typed-splay-tree.h" + #include "cppbuiltin.h" +-#include <pthread.h> + + #include "libgccjit.h" + #include "jit-recording.h" +--- a/libcc1/libcc1plugin.cc ++++ b/libcc1/libcc1plugin.cc +@@ -17,6 +17,7 @@ + along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + ++#include <pthread.h> + #include <cc1plugin-config.h> + + #undef PACKAGE_NAME +--- a/libcc1/libcp1plugin.cc ++++ b/libcc1/libcp1plugin.cc +@@ -18,6 +18,7 @@ + along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + ++#include <pthread.h> + #include <cc1plugin-config.h> + + #undef PACKAGE_NAME diff --git a/11.5.0/musl/50_all_libssp_unconditionally.patch b/11.5.0/musl/50_all_libssp_unconditionally.patch new file mode 100644 index 0000000..42796f2 --- /dev/null +++ b/11.5.0/musl/50_all_libssp_unconditionally.patch @@ -0,0 +1,24 @@ +https://bugs.gentoo.org/706210 +https://bugs.gentoo.org/747346 + +Author: Timo Teräs <[email protected]> + +"Alpine musl package provides libssp_nonshared.a. We link to it unconditionally, +as otherwise we get link failures if some objects are -fstack-protector built +and final link happens with -fno-stack-protector. This seems to be the common +case when bootstrapping gcc, the piepatches do not seem to fully fix the +crosstoolchain and bootstrap sequence wrt. stack-protector flag usage." + +(We do the same in Gentoo.) +--- a/gcc/gcc.c.orig ++++ b/gcc/gcc.c +@@ -870,8 +870,7 @@ + + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP +-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +- "|fstack-protector-strong|fstack-protector-explicit:}" ++#define LINK_SSP_SPEC "-lssp_nonshared" + #else + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit" \ diff --git a/11.5.0/musl/50_all_posix_memalign.patch b/11.5.0/musl/50_all_posix_memalign.patch new file mode 100644 index 0000000..dd75a93 --- /dev/null +++ b/11.5.0/musl/50_all_posix_memalign.patch @@ -0,0 +1,28 @@ +--- a/gcc/config/i386/pmm_malloc.h ++++ b/gcc/config/i386/pmm_malloc.h +@@ -27,12 +27,13 @@ + #include <stdlib.h> + + /* We can't depend on <stdlib.h> since the prototype of posix_memalign +- may not be visible. */ ++ may not be visible and we can't pollute the namespace either. */ + #ifndef __cplusplus +-extern int posix_memalign (void **, size_t, size_t); ++extern int __gcc_posix_memalign (void **, size_t, size_t) + #else +-extern "C" int posix_memalign (void **, size_t, size_t) throw (); ++extern "C" int __gcc_posix_memalign (void **, size_t, size_t) throw () + #endif ++__asm__("posix_memalign"); + + static __inline void * + _mm_malloc (size_t __size, size_t __alignment) +@@ -42,7 +43,7 @@ + return malloc (__size); + if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4)) + __alignment = sizeof (void *); +- if (posix_memalign (&__ptr, __alignment, __size) == 0) ++ if (__gcc_posix_memalign (&__ptr, __alignment, __size) == 0) + return __ptr; + else + return NULL;
