From e5d148194b4ab01270251f6730c5ac078aed8146 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 14 Nov 2019 22:58:33 +0000 Subject: 7.5.0: patchset 1 based on 7.4.0 patchset The difference from 7.4.0 is a single dropped patch: - 21_all_kr-decl-PR88214.patch: backported upstream Signed-off-by: Sergei Trofimovich --- 7.5.0/gentoo/01_all_default-fortify-source.patch | 22 ++++++ .../02_all_default-warn-format-security.patch | 22 ++++++ 7.5.0/gentoo/03_all_default-warn-trampolines.patch | 13 +++ 7.5.0/gentoo/04_all_default-ssp-fix.patch | 32 ++++++++ 7.5.0/gentoo/05_all_alpha-mieee-default.patch | 39 +++++++++ 7.5.0/gentoo/06_all_ia64_note.GNU-stack.patch | 92 ++++++++++++++++++++++ 7.5.0/gentoo/07_all_libiberty-asprintf.patch | 18 +++++ 7.5.0/gentoo/08_all_libiberty-pic.patch | 10 +++ 7.5.0/gentoo/09_all_nopie-all-flags.patch | 18 +++++ 7.5.0/gentoo/10_all_extra-options.patch | 87 ++++++++++++++++++++ .../11_all_pr55930-dependency-tracking.patch | 18 +++++ 7.5.0/gentoo/12_all_sh-drop-sysroot-suffix.patch | 32 ++++++++ 7.5.0/gentoo/13_all_respect-build-cxxflags.patch | 39 +++++++++ 7.5.0/gentoo/14_all_libgfortran-Werror.patch | 20 +++++ 7.5.0/gentoo/15_all_libgomp-Werror.patch | 20 +++++ 7.5.0/gentoo/16_all_libitm-Werror.patch | 19 +++++ 7.5.0/gentoo/17_all_libatomic-Werror.patch | 19 +++++ 7.5.0/gentoo/18_all_libbacktrace-Werror.patch | 17 ++++ .../19_all_libsanitizer-libbacktrace-Werror.patch | 17 ++++ 7.5.0/gentoo/20_all_libstdcxx-no-vtv.patch | 61 ++++++++++++++ 7.5.0/gentoo/21_all_lto-ctor-dtor-target.patch | 64 +++++++++++++++ 7.5.0/gentoo/README.history | 22 ++++++ 22 files changed, 701 insertions(+) create mode 100644 7.5.0/gentoo/01_all_default-fortify-source.patch create mode 100644 7.5.0/gentoo/02_all_default-warn-format-security.patch create mode 100644 7.5.0/gentoo/03_all_default-warn-trampolines.patch create mode 100644 7.5.0/gentoo/04_all_default-ssp-fix.patch create mode 100644 7.5.0/gentoo/05_all_alpha-mieee-default.patch create mode 100644 7.5.0/gentoo/06_all_ia64_note.GNU-stack.patch create mode 100644 7.5.0/gentoo/07_all_libiberty-asprintf.patch create mode 100644 7.5.0/gentoo/08_all_libiberty-pic.patch create mode 100644 7.5.0/gentoo/09_all_nopie-all-flags.patch create mode 100644 7.5.0/gentoo/10_all_extra-options.patch create mode 100644 7.5.0/gentoo/11_all_pr55930-dependency-tracking.patch create mode 100644 7.5.0/gentoo/12_all_sh-drop-sysroot-suffix.patch create mode 100644 7.5.0/gentoo/13_all_respect-build-cxxflags.patch create mode 100644 7.5.0/gentoo/14_all_libgfortran-Werror.patch create mode 100644 7.5.0/gentoo/15_all_libgomp-Werror.patch create mode 100644 7.5.0/gentoo/16_all_libitm-Werror.patch create mode 100644 7.5.0/gentoo/17_all_libatomic-Werror.patch create mode 100644 7.5.0/gentoo/18_all_libbacktrace-Werror.patch create mode 100644 7.5.0/gentoo/19_all_libsanitizer-libbacktrace-Werror.patch create mode 100644 7.5.0/gentoo/20_all_libstdcxx-no-vtv.patch create mode 100644 7.5.0/gentoo/21_all_lto-ctor-dtor-target.patch create mode 100644 7.5.0/gentoo/README.history (limited to '7.5.0') diff --git a/7.5.0/gentoo/01_all_default-fortify-source.patch b/7.5.0/gentoo/01_all_default-fortify-source.patch new file mode 100644 index 0000000..d307474 --- /dev/null +++ b/7.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/7.5.0/gentoo/02_all_default-warn-format-security.patch b/7.5.0/gentoo/02_all_default-warn-format-security.patch new file mode 100644 index 0000000..8994654 --- /dev/null +++ b/7.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 2016-03-23 18:51:56.000000000 +0100 ++++ b/gcc/c-family/c.opt 2016-04-28 23:45:54.063351272 +0200 +@@ -459,7 +459,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonlit + Warn about format strings that are not literals. + + 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 +@@ -475,7 +475,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_l + 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) ++C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) + Warn about printf/scanf/strftime/strfmon format string anomalies. + + Wignored-qualifiers diff --git a/7.5.0/gentoo/03_all_default-warn-trampolines.patch b/7.5.0/gentoo/03_all_default-warn-trampolines.patch new file mode 100644 index 0000000..7a644cb --- /dev/null +++ b/7.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/7.5.0/gentoo/04_all_default-ssp-fix.patch b/7.5.0/gentoo/04_all_default-ssp-fix.patch new file mode 100644 index 0000000..2cd1b8d --- /dev/null +++ b/7.5.0/gentoo/04_all_default-ssp-fix.patch @@ -0,0 +1,32 @@ +Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding +Change the buffer size. + +--- a/gcc/gcc.c 2017-07-04 09:15:57.740793000 +0200 ++++ b/gcc/gcc.c 2018-03-02 13:58:44.387741114 +0100 +@@ -857,6 +857,12 @@ proper position among the other output f + #define LINK_GCC_C_SEQUENCE_SPEC "%G %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" \ +@@ -1150,1 +1150,1 @@ static const char *cc1_options = +- %{fsyntax-only:-o %j} %{-param*}\ ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ +--- a/gcc/params.def 2016-03-30 09:47:40.000000000 +0200 ++++ b/gcc/params.def 2016-09-19 12:56:58.443179039 +0200 +@@ -673,7 +673,7 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT, + DEFPARAM (PARAM_SSP_BUFFER_SIZE, + "ssp-buffer-size", + "The lower bound for a buffer to be considered for stack smashing protection.", +- 8, 1, 0) ++ 4, 1, 0) + + DEFPARAM (PARAM_MIN_SIZE_FOR_STACK_SHARING, + "min-size-for-stack-sharing", diff --git a/7.5.0/gentoo/05_all_alpha-mieee-default.patch b/7.5.0/gentoo/05_all_alpha-mieee-default.patch new file mode 100644 index 0000000..b266d77 --- /dev/null +++ b/7.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 + +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 Report RejectNegative Mask(IEEE) ++Target Report Mask(IEEE) + Emit IEEE-conformant code, without inexact exceptions. + + mieee-with-inexact + diff --git a/7.5.0/gentoo/06_all_ia64_note.GNU-stack.patch b/7.5.0/gentoo/06_all_ia64_note.GNU-stack.patch new file mode 100644 index 0000000..66a787e --- /dev/null +++ b/7.5.0/gentoo/06_all_ia64_note.GNU-stack.patch @@ -0,0 +1,92 @@ +http://gcc.gnu.org/PR21098 + + +2004-09-20 Jakub Jelinek + + * 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 + + * 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 + . */ + ++#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/7.5.0/gentoo/07_all_libiberty-asprintf.patch b/7.5.0/gentoo/07_all_libiberty-asprintf.patch new file mode 100644 index 0000000..bee0c4c --- /dev/null +++ b/7.5.0/gentoo/07_all_libiberty-asprintf.patch @@ -0,0 +1,18 @@ +2008-07-25 Magnus Granberg + + * include/libiberty.h (asprintf): Don't declare if defined as a macro + +--- a/include/libiberty.h ++++ b/include/libiberty.h +@@ -609,8 +609,11 @@ extern int pwait (int, int *, int); + /* 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 + + #if !HAVE_DECL_VASPRINTF + /* Like vsprintf but provides a pointer to malloc'd storage, which diff --git a/7.5.0/gentoo/08_all_libiberty-pic.patch b/7.5.0/gentoo/08_all_libiberty-pic.patch new file mode 100644 index 0000000..b6160a7 --- /dev/null +++ b/7.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/7.5.0/gentoo/09_all_nopie-all-flags.patch b/7.5.0/gentoo/09_all_nopie-all-flags.patch new file mode 100644 index 0000000..48536e6 --- /dev/null +++ b/7.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 2015-06-25 19:18:12.000000000 +0200 ++++ b/gcc/Makefile.in 2016-04-22 00:12:54.029178860 +0200 +@@ -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/7.5.0/gentoo/10_all_extra-options.patch b/7.5.0/gentoo/10_all_extra-options.patch new file mode 100644 index 0000000..912fd02 --- /dev/null +++ b/7.5.0/gentoo/10_all_extra-options.patch @@ -0,0 +1,87 @@ +On Hardened we add or remove some options like -fstack-check, +-fstack-protector-all, -fstrict_overflow and -z now + +--- a/libgcc/Makefile.in 2011-11-22 04:01:02.000000000 +0100 ++++ b/libgcc/Makefile.in 2011-12-25 15:18:22.449610631 +0100 +@@ -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 -fstack-check=no \ + $(INHIBIT_LIBC_CFLAGS) + + # Additional options to use when compiling libgcc2.a. +@@ -279,7 +290,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF + -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) ++ -fstack-check=no $(INHIBIT_LIBC_CFLAGS) + + # Extra flags to use when compiling crt{begin,end}.o. + CRTSTUFF_T_CFLAGS = +--- a/gcc/defaults.h 2016-01-04 15:30:50.000000000 +0100 ++++ b/gcc/defaults.h 2016-05-02 22:23:43.815707806 +0200 +@@ -1398,8 +1398,12 @@ see the files COPYING3 and COPYING.RUNTI + /* Default value for flag_stack_protect when flag_stack_protect is initialized to -1: + --enable-default-ssp: Default flag_stack_protect to -fstack-protector-strong. + --disable-default-ssp: Default flag_stack_protect to 0. ++ Hardened: Default flag_stack_protect to -fstack-protector-all. + */ + #ifdef ENABLE_DEFAULT_SSP ++# ifdef EXTRA_OPTIONS ++# define DEFAULT_FLAG_SSP 2 ++# endif + # ifndef DEFAULT_FLAG_SSP + # define DEFAULT_FLAG_SSP 3 + # endif +--- a/gcc/gcc.c 2016-02-19 23:18:38.000000000 +0100 ++++ b/gcc/gcc.c 2016-05-02 22:56:10.185721270 +0200 +@@ -868,6 +868,13 @@ proper position among the other output f + #endif + #endif + ++#define STACK_CHECK_SPEC "" ++#ifdef EXTRA_OPTIONS ++#define LINK_NOW_SPEC "%{!nonow:-z now} " ++#else ++#define LINK_NOW_SPEC "" ++#endif ++ + #ifdef ENABLE_DEFAULT_PIE + #define NO_PIE_SPEC "no-pie|static" + #define PIE_SPEC NO_PIE_SPEC "|r|shared:;" +@@ -1013,7 +1020,7 @@ proper position among the other output f + %(linker) " \ + LINK_PLUGIN_SPEC \ + "%{flto|flto=*:% +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 +--- + gcc/config.gcc | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/gcc/config.gcc b/gcc/config.gcc +index 55c314afdbd..c320f24f123 100644 +--- 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/7.5.0/gentoo/13_all_respect-build-cxxflags.patch b/7.5.0/gentoo/13_all_respect-build-cxxflags.patch new file mode 100644 index 0000000..14139ea --- /dev/null +++ b/7.5.0/gentoo/13_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/7.5.0/gentoo/14_all_libgfortran-Werror.patch b/7.5.0/gentoo/14_all_libgfortran-Werror.patch new file mode 100644 index 0000000..f6c26bf --- /dev/null +++ b/7.5.0/gentoo/14_all_libgfortran-Werror.patch @@ -0,0 +1,20 @@ +libgfortran does not respect --disable-werror + +https://bugs.gentoo.org/433435 +http://gcc.gnu.org/PR54724 + + +--- a/libgfortran/configure.ac ++++ b/libgfortran/configure.ac +@@ -140,3 +140,3 @@ AM_PROG_CC_C_O + if test "x$GCC" = "xyes"; then +- AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring" ++ AM_FCFLAGS="-I . -Wall -fimplicit-none -fno-repack-arrays -fno-underscoring" + ## We like to use C11 and C99 routines when available. This makes +--- a/libgfortran/configure ++++ b/libgfortran/configure +@@ -5764,3 +5764,3 @@ fi + # Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC. + if test "x$GCC" = "xyes"; then +- AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring" ++ AM_FCFLAGS="-I . -Wall -fimplicit-none -fno-repack-arrays -fno-underscoring" diff --git a/7.5.0/gentoo/15_all_libgomp-Werror.patch b/7.5.0/gentoo/15_all_libgomp-Werror.patch new file mode 100644 index 0000000..416808a --- /dev/null +++ b/7.5.0/gentoo/15_all_libgomp-Werror.patch @@ -0,0 +1,20 @@ +libgomp does not respect --disable-werror + +https://bugs.gentoo.org/229059 +http://gcc.gnu.org/PR38436 +--- a/libgomp/configure.ac ++++ b/libgomp/configure.ac +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS" + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi +--- a/libgomp/configure ++++ b/libgomp/configure +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS" + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi diff --git a/7.5.0/gentoo/16_all_libitm-Werror.patch b/7.5.0/gentoo/16_all_libitm-Werror.patch new file mode 100644 index 0000000..27181e0 --- /dev/null +++ b/7.5.0/gentoo/16_all_libitm-Werror.patch @@ -0,0 +1,19 @@ +libitm does not respect --disable-werror + +https://bugs.gentoo.org/475350 +--- a/libitm/configure.ac ++++ b/libitm/configure.ac +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS" + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi +--- a/libitm/configure ++++ b/libitm/configure +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS" + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi diff --git a/7.5.0/gentoo/17_all_libatomic-Werror.patch b/7.5.0/gentoo/17_all_libatomic-Werror.patch new file mode 100644 index 0000000..0550722 --- /dev/null +++ b/7.5.0/gentoo/17_all_libatomic-Werror.patch @@ -0,0 +1,19 @@ +libatomic does not respect --disable-werror + +https://bugs.gentoo.org/475350 +--- a/libatomic/configure.ac ++++ b/libatomic/configure.ac +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS" + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi +--- a/libatomic/configure ++++ b/libatomic/configure +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS" + # Add -Wall -Werror if we are using GCC. + if test "x$GCC" = "xyes"; then +- XCFLAGS="$XCFLAGS -Wall -Werror" ++ XCFLAGS="$XCFLAGS -Wall" + fi diff --git a/7.5.0/gentoo/18_all_libbacktrace-Werror.patch b/7.5.0/gentoo/18_all_libbacktrace-Werror.patch new file mode 100644 index 0000000..57dd284 --- /dev/null +++ b/7.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/7.5.0/gentoo/19_all_libsanitizer-libbacktrace-Werror.patch b/7.5.0/gentoo/19_all_libsanitizer-libbacktrace-Werror.patch new file mode 100644 index 0000000..46a219a --- /dev/null +++ b/7.5.0/gentoo/19_all_libsanitizer-libbacktrace-Werror.patch @@ -0,0 +1,17 @@ +libsanitizer/libbacktrace 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 +@@ -293,3 +293,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/7.5.0/gentoo/20_all_libstdcxx-no-vtv.patch b/7.5.0/gentoo/20_all_libstdcxx-no-vtv.patch new file mode 100644 index 0000000..68508bd --- /dev/null +++ b/7.5.0/gentoo/20_all_libstdcxx-no-vtv.patch @@ -0,0 +1,61 @@ +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 +@@ -217,7 +217,6 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + + # Symbol versioning for shared libraries. +--- a/libstdc++-v3/src/Makefile.in ++++ b/libstdc++-v3/src/Makefile.in +@@ -511,7 +511,6 @@ CXXLINK = \ + $(LIBTOOL) --tag CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ +- $(VTV_CXXLINKFLAGS) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + + @ENABLE_SYMVERS_TRUE@CLEANFILES = libstdc++-symbols.ver $(version_dep) +--- a/libstdc++-v3/src/c++11/Makefile.am ++++ b/libstdc++-v3/src/c++11/Makefile.am +@@ -204,5 +204,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 +@@ -496,7 +496,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 +@@ -273,5 +273,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 +@@ -500,7 +500,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/7.5.0/gentoo/21_all_lto-ctor-dtor-target.patch b/7.5.0/gentoo/21_all_lto-ctor-dtor-target.patch new file mode 100644 index 0000000..206daae --- /dev/null +++ b/7.5.0/gentoo/21_all_lto-ctor-dtor-target.patch @@ -0,0 +1,64 @@ +https://bugs.gentoo.org/677724 + +Apply file-specific target-specific optimisation to constructors and +destructors. Fixes leaking of target-specific options from one unit +to another. On firefox this change fixes -mavx2 leak from files guarded +by CPU flag detection into other files. + +From 332446ac24e5b37f441f7c9cb0b97fc36f9f0aa3 Mon Sep 17 00:00:00 2001 +From: hubicka +Date: Sat, 15 Dec 2018 10:31:37 +0000 +Subject: [PATCH] * ipa.c (cgraph_build_static_cdtor_1): Add + OPTIMIZATION and TARGET parameters. (cgraph_build_static_cdtor): + Update. (build_cdtor): Use OPTIMIZATION and TARGET of the first real + cdtor callsed. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267168 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/ipa.c | 12 +++++++++--- + +--- a/gcc/ipa.c ++++ b/gcc/ipa.c +@@ -831,7 +831,9 @@ ipa_discover_variable_flags (void) + be produced. */ + + static void +-cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) ++cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final, ++ tree optimization, ++ tree target) + { + static int counter = 0; + char which_buf[16]; +@@ -862,6 +864,8 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) + + TREE_STATIC (decl) = 1; + TREE_USED (decl) = 1; ++ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) = optimization; ++ DECL_FUNCTION_SPECIFIC_TARGET (decl) = target; + DECL_ARTIFICIAL (decl) = 1; + DECL_IGNORED_P (decl) = 1; + DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1; +@@ -911,7 +915,7 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) + void + cgraph_build_static_cdtor (char which, tree body, int priority) + { +- cgraph_build_static_cdtor_1 (which, body, priority, false); ++ cgraph_build_static_cdtor_1 (which, body, priority, false, NULL, NULL); + } + + /* When target does not have ctors and dtors, we call all constructor +@@ -993,7 +997,9 @@ build_cdtor (bool ctor_p, const vec &cdtors) + gcc_assert (body != NULL_TREE); + /* Generate a function to call all the function of like + priority. */ +- cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true); ++ cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true, ++ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (cdtors[0]), ++ DECL_FUNCTION_SPECIFIC_TARGET (cdtors[0])); + } + } + +-- +2.20.1 + diff --git a/7.5.0/gentoo/README.history b/7.5.0/gentoo/README.history new file mode 100644 index 0000000..3958c90 --- /dev/null +++ b/7.5.0/gentoo/README.history @@ -0,0 +1,22 @@ +1 14 Nov 2019 + + 01_all_default-fortify-source.patch + + 02_all_default-warn-format-security.patch + + 03_all_default-warn-trampolines.patch + + 04_all_default-ssp-fix.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_extra-options.patch + + 11_all_pr55930-dependency-tracking.patch + + 12_all_sh-drop-sysroot-suffix.patch + + 13_all_respect-build-cxxflags.patch + + 14_all_libgfortran-Werror.patch + + 15_all_libgomp-Werror.patch + + 16_all_libitm-Werror.patch + + 17_all_libatomic-Werror.patch + + 18_all_libbacktrace-Werror.patch + + 19_all_libsanitizer-libbacktrace-Werror.patch + + 20_all_libstdcxx-no-vtv.patch + + 21_all_lto-ctor-dtor-target.patch -- cgit v1.2.3-18-g5258