public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2021-12-02 15:03 David Seifert
  0 siblings, 0 replies; 15+ messages in thread
From: David Seifert @ 2021-12-02 15:03 UTC (permalink / raw
  To: gentoo-commits

commit:     e84b34dedf9f3bc2e21fa9f1dbb77770d29afde8
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 27 19:20:58 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Nov 27 19:20:58 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=e84b34de

11.3.0: rebase patches to avoid fuzz

* 11.3.0/gentoo/02_all_default-warn-format-security.patch
* 11.3.0/gentoo/04_all_nossp-on-nostdlib.patch
* 11.3.0/gentoo/07_all_libiberty-asprintf.patch
* 11.3.0/gentoo/15_all_libgomp-Werror.patch
* 11.3.0/gentoo/16_all_libitm-Werror.patch
* 11.3.0/gentoo/17_all_libatomic-Werror.patch
* 11.3.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 11.3.0/gentoo/02_all_default-warn-format-security.patch | 12 ++++++------
 11.3.0/gentoo/04_all_nossp-on-nostdlib.patch            | 10 +++++-----
 11.3.0/gentoo/07_all_libiberty-asprintf.patch           |  6 +++---
 11.3.0/gentoo/15_all_libgomp-Werror.patch               | 10 ++++++++--
 11.3.0/gentoo/16_all_libitm-Werror.patch                | 10 ++++++++--
 11.3.0/gentoo/17_all_libatomic-Werror.patch             | 10 ++++++++--
 11.3.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch          | 14 +++++++-------
 7 files changed, 45 insertions(+), 27 deletions(-)

diff --git a/11.3.0/gentoo/02_all_default-warn-format-security.patch b/11.3.0/gentoo/02_all_default-warn-format-security.patch
index f809abd..13fa24a 100644
--- a/11.3.0/gentoo/02_all_default-warn-format-security.patch
+++ b/11.3.0/gentoo/02_all_default-warn-format-security.patch
@@ -1,9 +1,9 @@
 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.
+--- 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)
@@ -11,7 +11,7 @@ Enable -Wformat and -Wformat-security by default.
  Warn about possible security problems with format functions.
  
  Wformat-signedness
-@@ -475,7 +475,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_l
+@@ -658,7 +658,7 @@
  Warn about zero-length formats.
  
  Wformat=
@@ -19,4 +19,4 @@ Enable -Wformat and -Wformat-security by default.
 +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.
  
- Wignored-qualifiers
+ Wformat-overflow=

diff --git a/11.3.0/gentoo/04_all_nossp-on-nostdlib.patch b/11.3.0/gentoo/04_all_nossp-on-nostdlib.patch
index 4e581a5..20afef1 100644
--- a/11.3.0/gentoo/04_all_nossp-on-nostdlib.patch
+++ b/11.3.0/gentoo/04_all_nossp-on-nostdlib.patch
@@ -1,10 +1,10 @@
 Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding 
 
 https://bugs.gentoo.org/484714
---- 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"
+--- 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
@@ -16,7 +16,7 @@ https://bugs.gentoo.org/484714
  #ifndef LINK_SSP_SPEC
  #ifdef TARGET_LIBC_PROVIDES_SSP
  #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
-@@ -1131,7 +1148,7 @@ static const char *cc1_options =
+@@ -1273,7 +1279,7 @@
   %{-version:--version}\
   %{-help=*:--help=%*}\
   %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\

diff --git a/11.3.0/gentoo/07_all_libiberty-asprintf.patch b/11.3.0/gentoo/07_all_libiberty-asprintf.patch
index bee0c4c..702ae3c 100644
--- a/11.3.0/gentoo/07_all_libiberty-asprintf.patch
+++ b/11.3.0/gentoo/07_all_libiberty-asprintf.patch
@@ -4,7 +4,7 @@
 
 --- a/include/libiberty.h
 +++ b/include/libiberty.h
-@@ -609,8 +609,11 @@ extern int pwait (int, int *, int);
+@@ -652,8 +652,11 @@
  /* Like sprintf but provides a pointer to malloc'd storage, which must
     be freed by the caller.  */
  
@@ -14,5 +14,5 @@
  #endif
 +#endif
  
- #if !HAVE_DECL_VASPRINTF
- /* Like vsprintf but provides a pointer to malloc'd storage, which
+ /* Like asprintf but allocates memory without fail. This works like
+    xmalloc.  */

diff --git a/11.3.0/gentoo/15_all_libgomp-Werror.patch b/11.3.0/gentoo/15_all_libgomp-Werror.patch
index 416808a..deda157 100644
--- a/11.3.0/gentoo/15_all_libgomp-Werror.patch
+++ b/11.3.0/gentoo/15_all_libgomp-Werror.patch
@@ -4,17 +4,23 @@ 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"
+@@ -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
-@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
+@@ -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.3.0/gentoo/16_all_libitm-Werror.patch b/11.3.0/gentoo/16_all_libitm-Werror.patch
index 27181e0..c8e991c 100644
--- a/11.3.0/gentoo/16_all_libitm-Werror.patch
+++ b/11.3.0/gentoo/16_all_libitm-Werror.patch
@@ -3,17 +3,23 @@ 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"
+@@ -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
-@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
+@@ -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.3.0/gentoo/17_all_libatomic-Werror.patch b/11.3.0/gentoo/17_all_libatomic-Werror.patch
index 0550722..7b29b04 100644
--- a/11.3.0/gentoo/17_all_libatomic-Werror.patch
+++ b/11.3.0/gentoo/17_all_libatomic-Werror.patch
@@ -3,17 +3,23 @@ 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"
+@@ -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
-@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
+@@ -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.3.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch b/11.3.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch
index 121dec4..630d900 100644
--- a/11.3.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch
+++ b/11.3.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch
@@ -1,8 +1,8 @@
 On Hardened we add some options like -z now
 
---- 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,12 @@ proper position among the other output f
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -994,6 +994,12 @@
  #endif
  #endif
  
@@ -13,9 +13,9 @@ On Hardened we add some options like -z now
 +#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
+ #define PIE_SPEC		"!no-pie"
+ #define NO_FPIE1_SPEC		"fno-pie"
+@@ -1154,7 +1160,7 @@
      %(linker) " \
      LINK_PLUGIN_SPEC \
     "%{flto|flto=*:%<fcompare-debug*} \
@@ -23,4 +23,4 @@ On Hardened we add some options like -z now
 +    %{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:%{!nostartfiles:%S}} \
+     %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2021-12-02 15:03 David Seifert
  0 siblings, 0 replies; 15+ messages in thread
From: David Seifert @ 2021-12-02 15:03 UTC (permalink / raw
  To: gentoo-commits

commit:     51a7ace358097005038a0d31350b0c6d3da34e00
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 27 19:30:17 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Nov 27 19:30:17 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=51a7ace3

11.3.0: add patch to enable CET

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 11.3.0/gentoo/26_all_enable-cet.patch | 101 ++++++++++++++++++++++++++++++++++
 11.3.0/gentoo/README.history          |   1 +
 2 files changed, 102 insertions(+)

diff --git a/11.3.0/gentoo/26_all_enable-cet.patch b/11.3.0/gentoo/26_all_enable-cet.patch
new file mode 100644
index 0000000..77678a9
--- /dev/null
+++ b/11.3.0/gentoo/26_all_enable-cet.patch
@@ -0,0 +1,101 @@
+From c1f37f6e3a4fcdefb6b3dfc3d84fc42920a70c00 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sat, 27 Nov 2021 19:16:02 +0000
+Subject: [PATCH] Enable CET (-fcf-protection=full) by default
+
+Needs:
+- CET to be enabled for GCC
+- -DEXTRA_OPTIONS_CF to be passed during build (via toolchain.eclass)
+  for now to avoid accidentally enabling it on other arches.
+
+  Only supported on amd64.
+---
+ gcc/common.opt                 |  2 +-
+ gcc/config/i386/i386-options.c |  5 +++++
+ gcc/defaults.h                 | 13 +++++++++++++
+ gcc/flag-types.h               |  1 +
+ gcc/toplev.c                   |  4 +++-
+ 5 files changed, 23 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index a88778b4e..4993a7ec3 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -1783,7 +1783,7 @@ fcf-protection
+ Common RejectNegative Alias(fcf-protection=,full)
+ 
+ fcf-protection=
+-Common Joined RejectNegative Enum(cf_protection_level) Var(flag_cf_protection) Init(CF_NONE)
++Common Joined RejectNegative Enum(cf_protection_level) Var(flag_cf_protection) Init(CF_UNSET)
+ -fcf-protection=[full|branch|return|none|check]	Instrument functions with checks to verify jump/call/return control-flow transfer
+ instructions have valid targets.
+ 
+diff --git a/gcc/config/i386/i386-options.c b/gcc/config/i386/i386-options.c
+index 18d2c0b9f..4fb76f2a1 100644
+--- a/gcc/config/i386/i386-options.c
++++ b/gcc/config/i386/i386-options.c
+@@ -3037,6 +3037,11 @@ ix86_option_override_internal (bool main_args_p,
+         = build_target_option_node (opts, opts_set);
+     }
+ 
++  if (flag_cf_protection == CF_UNSET)
++    {
++      flag_cf_protection = DEFAULT_FLAG_CF;
++    }
++
+   if (opts->x_flag_cf_protection != CF_NONE)
+     {
+       if ((opts->x_flag_cf_protection & CF_BRANCH) == CF_BRANCH
+diff --git a/gcc/defaults.h b/gcc/defaults.h
+index 0f6cd78c5..5694412b7 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -1463,6 +1463,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ #define DEFAULT_FLAG_SCP 0
+ #endif
+ 
++/* Default value for flag_cf_protection when flag_cf_protection is
++   initialized to CF_FULL.
++
++   We use a new option (EXTRA_OPTIONS_CF) here to avoid turning
++   this on accidentally for other arches. */
++#ifdef EXTRA_OPTIONS_CF
++#define DEFAULT_FLAG_CF CF_FULL
++#endif
++#ifndef DEFAULT_FLAG_CF
++#define DEFAULT_FLAG_CF CF_NONE
++#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
+diff --git a/gcc/flag-types.h b/gcc/flag-types.h
+index a038c8fb7..61be0b128 100644
+--- a/gcc/flag-types.h
++++ b/gcc/flag-types.h
+@@ -389,6 +389,7 @@ enum gfc_convert
+ /* Control-Flow Protection values.  */
+ enum cf_protection_level
+ {
++  CF_UNSET = -1,
+   CF_NONE = 0,
+   CF_BRANCH = 1 << 0,
+   CF_RETURN = 1 << 1,
+diff --git a/gcc/toplev.c b/gcc/toplev.c
+index ea0a2a1b0..d110c84ee 100644
+--- a/gcc/toplev.c
++++ b/gcc/toplev.c
+@@ -1297,7 +1297,9 @@ process_options (void)
+ 	   "%<-floop-nest-optimize%>, %<-floop-parallelize-all%>)");
+ #endif
+ 
+-  if (flag_cf_protection != CF_NONE
++  /* Gentoo: we add CF_UNSET here just to be safe, but we only patch the default
++     for amd64 + when CET is definitely enabled anyway. */
++  if ((flag_cf_protection != CF_NONE) && (flag_cf_protection != CF_UNSET)
+       && !(flag_cf_protection & CF_SET))
+     {
+       if (flag_cf_protection == CF_FULL)
+-- 
+2.34.1

diff --git a/11.3.0/gentoo/README.history b/11.3.0/gentoo/README.history
index f12e753..2fe9c27 100644
--- a/11.3.0/gentoo/README.history
+++ b/11.3.0/gentoo/README.history
@@ -24,3 +24,4 @@
 	+ 23_all_EXTRA_OPTIONS-fstack-clash-protection.patch
 	+ 24_all_lto-intl-workaround-PR95194.patch
 	+ 25_all_plugin-objdump.patch
+	+ 26_all_enable-cet.patch


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2021-12-02 15:03 David Seifert
  0 siblings, 0 replies; 15+ messages in thread
From: David Seifert @ 2021-12-02 15:03 UTC (permalink / raw
  To: gentoo-commits

commit:     b068b9c6404a525a9f68b6cea8c18a5483f09536
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 27 19:04:20 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Nov 27 19:04:20 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b068b9c6

11.3.0: copy patches from 11.2.0

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 11.3.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.3.0/gentoo/04_all_nossp-on-nostdlib.patch       |  27 +++++
 11.3.0/gentoo/05_all_alpha-mieee-default.patch     |  39 +++++++
 11.3.0/gentoo/06_all_ia64_note.GNU-stack.patch     |  92 ++++++++++++++++
 11.3.0/gentoo/07_all_libiberty-asprintf.patch      |  18 +++
 11.3.0/gentoo/08_all_libiberty-pic.patch           |  10 ++
 11.3.0/gentoo/09_all_nopie-all-flags.patch         |  18 +++
 11.3.0/gentoo/10_all_sh-drop-sysroot-suffix.patch  |  32 ++++++
 11.3.0/gentoo/11_all_ia64-TEXTREL.patch            |  22 ++++
 .../gentoo/12_all_disable-systemtap-switch.patch   | 122 +++++++++++++++++++++
 11.3.0/gentoo/13_all_m68k-textrel-on-libgcc.patch  |  93 ++++++++++++++++
 11.3.0/gentoo/14_all_respect-build-cxxflags.patch  |  39 +++++++
 11.3.0/gentoo/15_all_libgomp-Werror.patch          |  20 ++++
 11.3.0/gentoo/16_all_libitm-Werror.patch           |  19 ++++
 11.3.0/gentoo/17_all_libatomic-Werror.patch        |  19 ++++
 11.3.0/gentoo/18_all_libbacktrace-Werror.patch     |  17 +++
 11.3.0/gentoo/19_all_libsanitizer-Werror.patch     |  17 +++
 11.3.0/gentoo/20_all_libstdcxx-no-vtv.patch        |  61 +++++++++++
 11.3.0/gentoo/21_all_default_ssp-buffer-size.patch |  14 +++
 11.3.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.3.0/gentoo/25_all_plugin-objdump.patch          |  34 ++++++
 11.3.0/gentoo/README.history                       |  26 +++++
 26 files changed, 907 insertions(+)

diff --git a/11.3.0/gentoo/01_all_default-fortify-source.patch b/11.3.0/gentoo/01_all_default-fortify-source.patch
new file mode 100644
index 0000000..d307474
--- /dev/null
+++ b/11.3.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.3.0/gentoo/02_all_default-warn-format-security.patch b/11.3.0/gentoo/02_all_default-warn-format-security.patch
new file mode 100644
index 0000000..f809abd
--- /dev/null
+++ b/11.3.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) 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.
+ 
+ Wignored-qualifiers

diff --git a/11.3.0/gentoo/03_all_default-warn-trampolines.patch b/11.3.0/gentoo/03_all_default-warn-trampolines.patch
new file mode 100644
index 0000000..7a644cb
--- /dev/null
+++ b/11.3.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.3.0/gentoo/04_all_nossp-on-nostdlib.patch b/11.3.0/gentoo/04_all_nossp-on-nostdlib.patch
new file mode 100644
index 0000000..4e581a5
--- /dev/null
+++ b/11.3.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	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" \
+@@ -1131,7 +1148,7 @@ static const char *cc1_options =
+  %{-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.3.0/gentoo/05_all_alpha-mieee-default.patch b/11.3.0/gentoo/05_all_alpha-mieee-default.patch
new file mode 100644
index 0000000..cf33f14
--- /dev/null
+++ b/11.3.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 <vapier@gentoo.org>
+
+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.3.0/gentoo/06_all_ia64_note.GNU-stack.patch b/11.3.0/gentoo/06_all_ia64_note.GNU-stack.patch
new file mode 100644
index 0000000..66a787e
--- /dev/null
+++ b/11.3.0/gentoo/06_all_ia64_note.GNU-stack.patch
@@ -0,0 +1,92 @@
+http://gcc.gnu.org/PR21098
+
+
+2004-09-20  Jakub Jelinek  <jakub@redhat.com>
+
+	* 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  <jakub@redhat.com>
+
+	* 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.3.0/gentoo/07_all_libiberty-asprintf.patch b/11.3.0/gentoo/07_all_libiberty-asprintf.patch
new file mode 100644
index 0000000..bee0c4c
--- /dev/null
+++ b/11.3.0/gentoo/07_all_libiberty-asprintf.patch
@@ -0,0 +1,18 @@
+2008-07-25  Magnus Granberg  <zorry@ume.nu>
+
+	* 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/11.3.0/gentoo/08_all_libiberty-pic.patch b/11.3.0/gentoo/08_all_libiberty-pic.patch
new file mode 100644
index 0000000..b6160a7
--- /dev/null
+++ b/11.3.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.3.0/gentoo/09_all_nopie-all-flags.patch b/11.3.0/gentoo/09_all_nopie-all-flags.patch
new file mode 100644
index 0000000..48536e6
--- /dev/null
+++ b/11.3.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/11.3.0/gentoo/10_all_sh-drop-sysroot-suffix.patch b/11.3.0/gentoo/10_all_sh-drop-sysroot-suffix.patch
new file mode 100644
index 0000000..3dadd4c
--- /dev/null
+++ b/11.3.0/gentoo/10_all_sh-drop-sysroot-suffix.patch
@@ -0,0 +1,32 @@
+From 5eeeff19bb4978a8d3c0d53bc81744bc25d82993 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+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 <slyfox@gentoo.org>
+---
+ 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/11.3.0/gentoo/11_all_ia64-TEXTREL.patch b/11.3.0/gentoo/11_all_ia64-TEXTREL.patch
new file mode 100644
index 0000000..706dbe5
--- /dev/null
+++ b/11.3.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
++++ a/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.3.0/gentoo/12_all_disable-systemtap-switch.patch b/11.3.0/gentoo/12_all_disable-systemtap-switch.patch
new file mode 100644
index 0000000..d5ae8d0
--- /dev/null
+++ b/11.3.0/gentoo/12_all_disable-systemtap-switch.patch
@@ -0,0 +1,122 @@
+From bb510ed7ea82093c924b027489db6f92250a85b3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+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 <slyfox@gentoo.org>
+---
+ gcc/configure    | 34 ++++++++++++++++++++++++++--------
+ gcc/configure.ac | 30 ++++++++++++++++++++++--------
+ 2 files changed, 48 insertions(+), 16 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 3dcf7752b..c2049f117 100755
+--- 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.3.0/gentoo/13_all_m68k-textrel-on-libgcc.patch b/11.3.0/gentoo/13_all_m68k-textrel-on-libgcc.patch
new file mode 100644
index 0000000..a2aa100
--- /dev/null
+++ b/11.3.0/gentoo/13_all_m68k-textrel-on-libgcc.patch
@@ -0,0 +1,93 @@
+https://gcc.gnu.org/PR86224
+
+From 1d89df42bdaf0745fd2a0d294471ac16f0553707 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sat, 28 Jul 2018 11:33:27 +0100
+Subject: [PATCH] libgcc: m68k: avoid absolute relocation in shared library
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ libgcc/config/m68k/lb1sf68.S | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/libgcc/config/m68k/lb1sf68.S b/libgcc/config/m68k/lb1sf68.S
+index 325a7c17d9b..16c6dc3f5a7 100644
+--- 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.3.0/gentoo/14_all_respect-build-cxxflags.patch b/11.3.0/gentoo/14_all_respect-build-cxxflags.patch
new file mode 100644
index 0000000..14139ea
--- /dev/null
+++ b/11.3.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.3.0/gentoo/15_all_libgomp-Werror.patch b/11.3.0/gentoo/15_all_libgomp-Werror.patch
new file mode 100644
index 0000000..416808a
--- /dev/null
+++ b/11.3.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/11.3.0/gentoo/16_all_libitm-Werror.patch b/11.3.0/gentoo/16_all_libitm-Werror.patch
new file mode 100644
index 0000000..27181e0
--- /dev/null
+++ b/11.3.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/11.3.0/gentoo/17_all_libatomic-Werror.patch b/11.3.0/gentoo/17_all_libatomic-Werror.patch
new file mode 100644
index 0000000..0550722
--- /dev/null
+++ b/11.3.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/11.3.0/gentoo/18_all_libbacktrace-Werror.patch b/11.3.0/gentoo/18_all_libbacktrace-Werror.patch
new file mode 100644
index 0000000..57dd284
--- /dev/null
+++ b/11.3.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.3.0/gentoo/19_all_libsanitizer-Werror.patch b/11.3.0/gentoo/19_all_libsanitizer-Werror.patch
new file mode 100644
index 0000000..0e484a4
--- /dev/null
+++ b/11.3.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.3.0/gentoo/20_all_libstdcxx-no-vtv.patch b/11.3.0/gentoo/20_all_libstdcxx-no-vtv.patch
new file mode 100644
index 0000000..68508bd
--- /dev/null
+++ b/11.3.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/11.3.0/gentoo/21_all_default_ssp-buffer-size.patch b/11.3.0/gentoo/21_all_default_ssp-buffer-size.patch
new file mode 100644
index 0000000..ae5a707
--- /dev/null
+++ b/11.3.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.3.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch b/11.3.0/gentoo/22_all_EXTRA_OPTIONS-z-now.patch
new file mode 100644
index 0000000..121dec4
--- /dev/null
+++ b/11.3.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	2016-02-19 23:18:38.000000000 +0100
++++ b/gcc/gcc.c	2016-05-02 22:56:10.185721270 +0200
+@@ -868,6 +868,12 @@ proper position among the other output f
+ #endif
+ #endif
+ 
++#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=*:%<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:%{!nostartfiles:%S}} \

diff --git a/11.3.0/gentoo/23_all_EXTRA_OPTIONS-fstack-clash-protection.patch b/11.3.0/gentoo/23_all_EXTRA_OPTIONS-fstack-clash-protection.patch
new file mode 100644
index 0000000..e836c92
--- /dev/null
+++ b/11.3.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	2018-03-28 16:51:09.000000000 +0200
++++ a/gcc/common.opt	2018-04-30 15:35:55.274096877 +0200
+@@ -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	2018-01-03 11:03:58.000000000 +0100
++++ b/gcc/defaults.h	2018-05-01 12:41:29.522851451 +0200
+@@ -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	2018-02-13 17:18:37.000000000 +0100
++++ b/gcc/toplev.c	2018-04-30 16:46:37.244027303 +0200
+@@ -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	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 -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.3.0/gentoo/24_all_lto-intl-workaround-PR95194.patch b/11.3.0/gentoo/24_all_lto-intl-workaround-PR95194.patch
new file mode 100644
index 0000000..9613216
--- /dev/null
+++ b/11.3.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.3.0/gentoo/25_all_plugin-objdump.patch b/11.3.0/gentoo/25_all_plugin-objdump.patch
new file mode 100644
index 0000000..a9c33fd
--- /dev/null
+++ b/11.3.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.3.0/gentoo/README.history b/11.3.0/gentoo/README.history
new file mode 100644
index 0000000..f12e753
--- /dev/null
+++ b/11.3.0/gentoo/README.history
@@ -0,0 +1,26 @@
+0		27 November 2021
+	+ 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


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2021-12-07 20:06 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2021-12-07 20:06 UTC (permalink / raw
  To: gentoo-commits

commit:     10c0905feadc59bdd449f189df75c9093a27e038
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  7 19:22:40 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Dec  7 20:06:20 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=10c0905f

11.3.0: update CET patch to disable on 32-bit / missing CMOV

Bug: https://bugs.gentoo.org/828081
Bug: https://bugs.gentoo.org/827880
Bug: https://bugs.gentoo.org/827905
Bug: https://bugs.gentoo.org/777117
Signed-off-by: Sam James <sam <AT> gentoo.org>

 11.3.0/gentoo/26_all_enable-cet.patch | 19 ++++++++++---------
 11.3.0/gentoo/README.history          |  2 +-
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/11.3.0/gentoo/26_all_enable-cet.patch b/11.3.0/gentoo/26_all_enable-cet.patch
index 77678a9..a054e62 100644
--- a/11.3.0/gentoo/26_all_enable-cet.patch
+++ b/11.3.0/gentoo/26_all_enable-cet.patch
@@ -1,6 +1,6 @@
-From c1f37f6e3a4fcdefb6b3dfc3d84fc42920a70c00 Mon Sep 17 00:00:00 2001
+From 18c6426f4e0a4fb7ecd1c2dc16d77e85118f9495 Mon Sep 17 00:00:00 2001
 From: Sam James <sam@gentoo.org>
-Date: Sat, 27 Nov 2021 19:16:02 +0000
+Date: Tue, 7 Dec 2021 19:16:15 +0000
 Subject: [PATCH] Enable CET (-fcf-protection=full) by default
 
 Needs:
@@ -18,7 +18,7 @@ Needs:
  5 files changed, 23 insertions(+), 2 deletions(-)
 
 diff --git a/gcc/common.opt b/gcc/common.opt
-index a88778b4e..4993a7ec3 100644
+index a88778b..4993a7e 100644
 --- a/gcc/common.opt
 +++ b/gcc/common.opt
 @@ -1783,7 +1783,7 @@ fcf-protection
@@ -31,14 +31,14 @@ index a88778b4e..4993a7ec3 100644
  instructions have valid targets.
  
 diff --git a/gcc/config/i386/i386-options.c b/gcc/config/i386/i386-options.c
-index 18d2c0b9f..4fb76f2a1 100644
+index 19632b5..3f45d50 100644
 --- a/gcc/config/i386/i386-options.c
 +++ b/gcc/config/i386/i386-options.c
-@@ -3037,6 +3037,11 @@ ix86_option_override_internal (bool main_args_p,
+@@ -3049,6 +3049,11 @@ ix86_option_override_internal (bool main_args_p,
          = build_target_option_node (opts, opts_set);
      }
  
-+  if (flag_cf_protection == CF_UNSET)
++  if ((flag_cf_protection == CF_UNSET) && TARGET_64BIT && TARGET_CMOV)
 +    {
 +      flag_cf_protection = DEFAULT_FLAG_CF;
 +    }
@@ -47,7 +47,7 @@ index 18d2c0b9f..4fb76f2a1 100644
      {
        if ((opts->x_flag_cf_protection & CF_BRANCH) == CF_BRANCH
 diff --git a/gcc/defaults.h b/gcc/defaults.h
-index 0f6cd78c5..5694412b7 100644
+index 0f6cd78..5694412 100644
 --- a/gcc/defaults.h
 +++ b/gcc/defaults.h
 @@ -1463,6 +1463,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
@@ -71,7 +71,7 @@ index 0f6cd78c5..5694412b7 100644
     vtable entries.  Setting this nonzero tells the compiler to use
     function descriptors instead.  The value of this macro says how
 diff --git a/gcc/flag-types.h b/gcc/flag-types.h
-index a038c8fb7..61be0b128 100644
+index a038c8f..61be0b1 100644
 --- a/gcc/flag-types.h
 +++ b/gcc/flag-types.h
 @@ -389,6 +389,7 @@ enum gfc_convert
@@ -83,7 +83,7 @@ index a038c8fb7..61be0b128 100644
    CF_BRANCH = 1 << 0,
    CF_RETURN = 1 << 1,
 diff --git a/gcc/toplev.c b/gcc/toplev.c
-index ea0a2a1b0..d110c84ee 100644
+index ea0a2a1..bac60eb 100644
 --- a/gcc/toplev.c
 +++ b/gcc/toplev.c
 @@ -1297,7 +1297,9 @@ process_options (void)
@@ -99,3 +99,4 @@ index ea0a2a1b0..d110c84ee 100644
        if (flag_cf_protection == CF_FULL)
 -- 
 2.34.1
+

diff --git a/11.3.0/gentoo/README.history b/11.3.0/gentoo/README.history
index 2fe9c27..24c19ac 100644
--- a/11.3.0/gentoo/README.history
+++ b/11.3.0/gentoo/README.history
@@ -1,4 +1,4 @@
-0		27 November 2021
+1		7 December 2021
 	+ 01_all_default-fortify-source.patch
 	+ 02_all_default-warn-format-security.patch
 	+ 03_all_default-warn-trampolines.patch


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2021-12-18 22:00 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2021-12-18 22:00 UTC (permalink / raw
  To: gentoo-commits

commit:     34cc4c2a7c835b5787ab1cd5d22ed72e3be2132b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  9 02:40:05 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 18 22:00:28 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=34cc4c2a

11.3.0: update CET patch to disable on 32-bit / missing CMOV, deux

Bug: https://bugs.gentoo.org/828546
Bug: https://bugs.gentoo.org/828549
Bug: https://bugs.gentoo.org/828081
Bug: https://bugs.gentoo.org/827880
Bug: https://bugs.gentoo.org/827905
Bug: https://bugs.gentoo.org/777117
Signed-off-by: Sam James <sam <AT> gentoo.org>

 11.3.0/gentoo/26_all_enable-cet.patch | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/11.3.0/gentoo/26_all_enable-cet.patch b/11.3.0/gentoo/26_all_enable-cet.patch
index a054e62..f3d189d 100644
--- a/11.3.0/gentoo/26_all_enable-cet.patch
+++ b/11.3.0/gentoo/26_all_enable-cet.patch
@@ -1,6 +1,6 @@
-From 18c6426f4e0a4fb7ecd1c2dc16d77e85118f9495 Mon Sep 17 00:00:00 2001
+From ed1d323dc821e906144f4fc4c39bc16695495f73 Mon Sep 17 00:00:00 2001
 From: Sam James <sam@gentoo.org>
-Date: Tue, 7 Dec 2021 19:16:15 +0000
+Date: Thu, 9 Dec 2021 02:39:19 +0000
 Subject: [PATCH] Enable CET (-fcf-protection=full) by default
 
 Needs:
@@ -11,11 +11,11 @@ Needs:
   Only supported on amd64.
 ---
  gcc/common.opt                 |  2 +-
- gcc/config/i386/i386-options.c |  5 +++++
+ gcc/config/i386/i386-options.c |  8 ++++++++
  gcc/defaults.h                 | 13 +++++++++++++
  gcc/flag-types.h               |  1 +
  gcc/toplev.c                   |  4 +++-
- 5 files changed, 23 insertions(+), 2 deletions(-)
+ 5 files changed, 26 insertions(+), 2 deletions(-)
 
 diff --git a/gcc/common.opt b/gcc/common.opt
 index a88778b..4993a7e 100644
@@ -31,16 +31,19 @@ index a88778b..4993a7e 100644
  instructions have valid targets.
  
 diff --git a/gcc/config/i386/i386-options.c b/gcc/config/i386/i386-options.c
-index 19632b5..3f45d50 100644
+index 19632b5..8ee36fe 100644
 --- a/gcc/config/i386/i386-options.c
 +++ b/gcc/config/i386/i386-options.c
-@@ -3049,6 +3049,11 @@ ix86_option_override_internal (bool main_args_p,
+@@ -3049,6 +3049,14 @@ ix86_option_override_internal (bool main_args_p,
          = build_target_option_node (opts, opts_set);
      }
  
-+  if ((flag_cf_protection == CF_UNSET) && TARGET_64BIT && TARGET_CMOV)
++  if (opts->x_flag_cf_protection == CF_UNSET)
 +    {
-+      flag_cf_protection = DEFAULT_FLAG_CF;
++      if (TARGET_64BIT && TARGET_CMOV)
++	opts->x_flag_cf_protection = DEFAULT_FLAG_CF;
++      else
++	opts->x_flag_cf_protection = CF_NONE;
 +    }
 +
    if (opts->x_flag_cf_protection != CF_NONE)


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2021-12-18 22:00 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2021-12-18 22:00 UTC (permalink / raw
  To: gentoo-commits

commit:     95b03a54532e0a0a925e6d93deb7a66ea8c6f4be
Author:     Calvin Walton <calvin.walton <AT> kepstin <DOT> ca>
AuthorDate: Thu Dec 16 08:28:50 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 18 22:00:28 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=95b03a54

11.3.0: refine backported PR99703 fix (allow disabling CET on i486)

Minimise configure patch to ease future patching.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27397
Bug: https://bugs.gentoo.org/777117
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...=> 75_all_x86_PR99703_12_no-cet-for-i486.patch} | 168 +++------------------
 11.3.0/gentoo/README.history                       |   2 +-
 2 files changed, 25 insertions(+), 145 deletions(-)

diff --git a/11.3.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i586.patch b/11.3.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i486.patch
similarity index 65%
rename from 11.3.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i586.patch
rename to 11.3.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i486.patch
index f3b3a95..5d3afc1 100644
--- a/11.3.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i586.patch
+++ b/11.3.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i486.patch
@@ -1,26 +1,23 @@
 https://bugs.gentoo.org/777117
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99703
 
-From 4183bc474348ffe4c7b5f23f93ee655fcdd2fd79 Mon Sep 17 00:00:00 2001
-From: Calvin Walton <calvin.walton@kepstin.ca>
-Date: Thu, 6 May 2021 14:38:00 -0400
-Subject: [PATCH] GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Fri, 12 Feb 2021 16:30:23 -0800
+Subject: GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs
 
-This is a backport of upstream commits:
-fd7eb4bc94cafa745eba75c64fa483a1689a5aad
-3f570621352970945db657455e0570208ea2d70e
+Backport of fd7eb4bc94cafa745eba75c64fa483a1689a5aad to GCC 11
 
-To GCC 11.1
----
- config/cet.m4          | 19 +++++++++++--
- gcc/configure          | 29 +++++++++++++++++++
- libbacktrace/configure | 29 +++++++++++++++++++
- libcc1/configure       | 45 +++++++++++++++++++++---------
- libcpp/configure       | 29 +++++++++++++++++++
- libdecnumber/configure | 29 +++++++++++++++++++
- libiberty/configure    | 36 +++++++++++++++++++++++-
- lto-plugin/configure   | 63 +++++++++++++++++++++++++++++++-----------
- 8 files changed, 246 insertions(+), 33 deletions(-)
+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.
 
 diff --git a/config/cet.m4 b/config/cet.m4
 index c67fb4f35b6..7718be1afe8 100644
@@ -60,10 +57,10 @@ index c67fb4f35b6..7718be1afe8 100644
        AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
      fi
 diff --git a/gcc/configure b/gcc/configure
-index e8ecb3b0297..405b5df3d75 100755
+index 708328e1670..e6e4d9e270e 100755
 --- a/gcc/configure
 +++ b/gcc/configure
-@@ -31969,6 +31969,34 @@ else
+@@ -32416,6 +32416,34 @@ else
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  /* end confdefs.h.  */
  
@@ -98,7 +95,7 @@ index e8ecb3b0297..405b5df3d75 100755
  static void
  foo (void)
  {
-@@ -32005,6 +32033,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+@@ -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
  
@@ -154,54 +151,10 @@ index 9b66bf5563a..a2f33c0f35d 100755
        as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
      fi
 diff --git a/libcc1/configure b/libcc1/configure
-index 021ec265526..b198b0b9074 100755
+index 600e41cf5ea..b198b0b9074 100755
 --- a/libcc1/configure
 +++ b/libcc1/configure
-@@ -10777,7 +10777,7 @@ else
-   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-   lt_status=$lt_dlunknown
-   cat > conftest.$ac_ext <<_LT_EOF
--#line 10790 "configure"
-+#line 10780 "configure"
- #include "confdefs.h"
- 
- #if HAVE_DLFCN_H
-@@ -10883,7 +10883,7 @@ else
-   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-   lt_status=$lt_dlunknown
-   cat > conftest.$ac_ext <<_LT_EOF
--#line 10896 "configure"
-+#line 10886 "configure"
- #include "confdefs.h"
- 
- #if HAVE_DLFCN_H
-@@ -14028,16 +14028,6 @@ freebsd* | dragonfly*)
-   esac
-   ;;
- 
--gnu*)
--  version_type=linux
--  need_lib_prefix=no
--  need_version=no
--  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
--  soname_spec='${libname}${release}${shared_ext}$major'
--  shlibpath_var=LD_LIBRARY_PATH
--  hardcode_into_libs=yes
--  ;;
--
- haiku*)
-   version_type=linux
-   need_lib_prefix=no
-@@ -14159,7 +14149,7 @@ linux*oldld* | linux*aout* | linux*coff*)
- # project, but have not yet been accepted: they are GCC-local changes
- # for the time being.  (See
- # https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
--linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
-+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | uclinuxfdpiceabi)
-   version_type=linux
-   need_lib_prefix=no
-   need_version=no
-@@ -14663,6 +14653,34 @@ else
+@@ -14653,6 +14653,34 @@ else
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  /* end confdefs.h.  */
  
@@ -236,7 +189,7 @@ index 021ec265526..b198b0b9074 100755
  static void
  foo (void)
  {
-@@ -14699,6 +14717,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+@@ -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
  
@@ -339,7 +292,7 @@ index 6b62f8ba665..da5302f9315 100755
        as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
      fi
 diff --git a/libiberty/configure b/libiberty/configure
-index 2ea7c119809..905bcda7e81 100755
+index 61c62a33b3a..14a555c4ed6 100755
 --- a/libiberty/configure
 +++ b/libiberty/configure
 @@ -5396,6 +5396,34 @@ else
@@ -385,22 +338,8 @@ index 2ea7c119809..905bcda7e81 100755
      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
-@@ -7380,7 +7409,12 @@ if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
-   $as_echo_n "(cached) " >&6
- else
-   if test "$cross_compiling" = yes; then :
--  ac_cv_func_mmap_fixed_mapped=no
-+  case "$host_os" in # ((
-+			  # Guess yes on platforms where we know the result.
-+		  linux*) ac_cv_func_mmap_fixed_mapped=yes ;;
-+			  # If we don't know, assume the worst.
-+		  *)      ac_cv_func_mmap_fixed_mapped=no ;;
-+		esac
- else
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
 diff --git a/lto-plugin/configure b/lto-plugin/configure
-index baa84adbb6c..26aad9dd699 100755
+index 22a4357a58e..26aad9dd699 100755
 --- a/lto-plugin/configure
 +++ b/lto-plugin/configure
 @@ -5791,6 +5791,34 @@ else
@@ -446,64 +385,5 @@ index baa84adbb6c..26aad9dd699 100755
      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
-@@ -8429,23 +8458,25 @@ _LT_EOF
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
- $as_echo "$lt_cv_ld_force_load" >&6; }
--    case $host_os in
--    rhapsody* | darwin1.[012])
-+    # Allow for Darwin 4-7 (macOS 10.0-10.3) although these are not expect to
-+    # build without first building modern cctools / linker.
-+    case $host_cpu-$host_os in
-+    *-rhapsody* | *-darwin1.[012])
-       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
--    darwin1.*)
-+    *-darwin1.*)
-       _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
--    darwin*) # darwin 5.x on
--      # if running on 10.5 or later, the deployment target defaults
--      # to the OS version, if on x86, and 10.4, the deployment
--      # target defaults to 10.4. Don't you love it?
--      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
--	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
--	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-+    *-darwin*)
-+      # darwin 5.x (macOS 10.1) onwards we only need to adjust when the
-+      # deployment target is forced to an earlier version.
-+      case ${MACOSX_DEPLOYMENT_TARGET-UNSET},$host in
-+	UNSET,*-darwin[89]*|UNSET,*-darwin[12][0123456789]*)
-+	  ;;
- 	10.[012][,.]*)
--	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
--	10.*)
--	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
--      esac
-+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-+	  ;;
-+	*)
-+	  ;;
-+     esac
-     ;;
-   esac
-     if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-@@ -11950,7 +11981,7 @@ else
-   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-   lt_status=$lt_dlunknown
-   cat > conftest.$ac_ext <<_LT_EOF
--#line 11963 "configure"
-+#line 11984 "configure"
- #include "confdefs.h"
- 
- #if HAVE_DLFCN_H
-@@ -12056,7 +12087,7 @@ else
-   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-   lt_status=$lt_dlunknown
-   cat > conftest.$ac_ext <<_LT_EOF
--#line 12069 "configure"
-+#line 12090 "configure"
- #include "confdefs.h"
- 
- #if HAVE_DLFCN_H
 -- 
-2.31.1
-
+2.34.1

diff --git a/11.3.0/gentoo/README.history b/11.3.0/gentoo/README.history
index f4d7ae1..bd234ed 100644
--- a/11.3.0/gentoo/README.history
+++ b/11.3.0/gentoo/README.history
@@ -25,4 +25,4 @@
 	+ 24_all_lto-intl-workaround-PR95194.patch
 	+ 25_all_plugin-objdump.patch
 	+ 26_all_enable-cet.patch
-	+ 75_all_x86_PR99703_12_no-cet-for-i586.patch
+	+ 75_all_x86_PR99703_12_no-cet-for-i486.patch


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2021-12-18 22:00 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2021-12-18 22:00 UTC (permalink / raw
  To: gentoo-commits

commit:     f233b7cc729cc0c29da815c8e102f889c1ffe8ea
Author:     Calvin Walton <calvin.walton <AT> kepstin <DOT> ca>
AuthorDate: Thu Dec  9 02:58:04 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 18 22:00:28 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=f233b7cc

11.3.0: backport PR99703 fix (allow disabling CET on i486)

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27397
Bug: https://bugs.gentoo.org/777117
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../75_all_x86_PR99703_12_no-cet-for-i586.patch    | 509 +++++++++++++++++++++
 11.3.0/gentoo/README.history                       |   3 +-
 2 files changed, 511 insertions(+), 1 deletion(-)

diff --git a/11.3.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i586.patch b/11.3.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i586.patch
new file mode 100644
index 0000000..f3b3a95
--- /dev/null
+++ b/11.3.0/gentoo/75_all_x86_PR99703_12_no-cet-for-i586.patch
@@ -0,0 +1,509 @@
+https://bugs.gentoo.org/777117
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99703
+
+From 4183bc474348ffe4c7b5f23f93ee655fcdd2fd79 Mon Sep 17 00:00:00 2001
+From: Calvin Walton <calvin.walton@kepstin.ca>
+Date: Thu, 6 May 2021 14:38:00 -0400
+Subject: [PATCH] GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs
+
+This is a backport of upstream commits:
+fd7eb4bc94cafa745eba75c64fa483a1689a5aad
+3f570621352970945db657455e0570208ea2d70e
+
+To GCC 11.1
+---
+ config/cet.m4          | 19 +++++++++++--
+ gcc/configure          | 29 +++++++++++++++++++
+ libbacktrace/configure | 29 +++++++++++++++++++
+ libcc1/configure       | 45 +++++++++++++++++++++---------
+ libcpp/configure       | 29 +++++++++++++++++++
+ libdecnumber/configure | 29 +++++++++++++++++++
+ libiberty/configure    | 36 +++++++++++++++++++++++-
+ lto-plugin/configure   | 63 +++++++++++++++++++++++++++++++-----------
+ 8 files changed, 246 insertions(+), 33 deletions(-)
+
+diff --git a/config/cet.m4 b/config/cet.m4
+index c67fb4f35b6..7718be1afe8 100644
+--- 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
+diff --git a/gcc/configure b/gcc/configure
+index e8ecb3b0297..405b5df3d75 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -31969,6 +31969,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)
+ {
+@@ -32005,6 +32033,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
+diff --git a/libbacktrace/configure b/libbacktrace/configure
+index 9b66bf5563a..a2f33c0f35d 100755
+--- 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
+diff --git a/libcc1/configure b/libcc1/configure
+index 021ec265526..b198b0b9074 100755
+--- a/libcc1/configure
++++ b/libcc1/configure
+@@ -10777,7 +10777,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 10790 "configure"
++#line 10780 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -10883,7 +10883,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 10896 "configure"
++#line 10886 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -14028,16 +14028,6 @@ freebsd* | dragonfly*)
+   esac
+   ;;
+ 
+-gnu*)
+-  version_type=linux
+-  need_lib_prefix=no
+-  need_version=no
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  hardcode_into_libs=yes
+-  ;;
+-
+ haiku*)
+   version_type=linux
+   need_lib_prefix=no
+@@ -14159,7 +14149,7 @@ linux*oldld* | linux*aout* | linux*coff*)
+ # project, but have not yet been accepted: they are GCC-local changes
+ # for the time being.  (See
+ # https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
+-linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
++linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | uclinuxfdpiceabi)
+   version_type=linux
+   need_lib_prefix=no
+   need_version=no
+@@ -14663,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)
+ {
+@@ -14699,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
+diff --git a/libcpp/configure b/libcpp/configure
+index 7e28606f605..9674cd9c7a7 100755
+--- 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
+diff --git a/libdecnumber/configure b/libdecnumber/configure
+index 6b62f8ba665..da5302f9315 100755
+--- 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
+diff --git a/libiberty/configure b/libiberty/configure
+index 2ea7c119809..905bcda7e81 100755
+--- 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
+@@ -7380,7 +7409,12 @@ if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+   if test "$cross_compiling" = yes; then :
+-  ac_cv_func_mmap_fixed_mapped=no
++  case "$host_os" in # ((
++			  # Guess yes on platforms where we know the result.
++		  linux*) ac_cv_func_mmap_fixed_mapped=yes ;;
++			  # If we don't know, assume the worst.
++		  *)      ac_cv_func_mmap_fixed_mapped=no ;;
++		esac
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+diff --git a/lto-plugin/configure b/lto-plugin/configure
+index baa84adbb6c..26aad9dd699 100755
+--- 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
+@@ -8429,23 +8458,25 @@ _LT_EOF
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+ $as_echo "$lt_cv_ld_force_load" >&6; }
+-    case $host_os in
+-    rhapsody* | darwin1.[012])
++    # Allow for Darwin 4-7 (macOS 10.0-10.3) although these are not expect to
++    # build without first building modern cctools / linker.
++    case $host_cpu-$host_os in
++    *-rhapsody* | *-darwin1.[012])
+       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+-    darwin1.*)
++    *-darwin1.*)
+       _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+-    darwin*) # darwin 5.x on
+-      # if running on 10.5 or later, the deployment target defaults
+-      # to the OS version, if on x86, and 10.4, the deployment
+-      # target defaults to 10.4. Don't you love it?
+-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+-	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
++    *-darwin*)
++      # darwin 5.x (macOS 10.1) onwards we only need to adjust when the
++      # deployment target is forced to an earlier version.
++      case ${MACOSX_DEPLOYMENT_TARGET-UNSET},$host in
++	UNSET,*-darwin[89]*|UNSET,*-darwin[12][0123456789]*)
++	  ;;
+ 	10.[012][,.]*)
+-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+-	10.*)
+-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+-      esac
++	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
++	  ;;
++	*)
++	  ;;
++     esac
+     ;;
+   esac
+     if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+@@ -11950,7 +11981,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 11963 "configure"
++#line 11984 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -12056,7 +12087,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 12069 "configure"
++#line 12090 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+-- 
+2.31.1
+

diff --git a/11.3.0/gentoo/README.history b/11.3.0/gentoo/README.history
index 24c19ac..f4d7ae1 100644
--- a/11.3.0/gentoo/README.history
+++ b/11.3.0/gentoo/README.history
@@ -1,4 +1,4 @@
-1		7 December 2021
+2		7 December 2021
 	+ 01_all_default-fortify-source.patch
 	+ 02_all_default-warn-format-security.patch
 	+ 03_all_default-warn-trampolines.patch
@@ -25,3 +25,4 @@
 	+ 24_all_lto-intl-workaround-PR95194.patch
 	+ 25_all_plugin-objdump.patch
 	+ 26_all_enable-cet.patch
+	+ 75_all_x86_PR99703_12_no-cet-for-i586.patch


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2021-12-28  5:57 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2021-12-28  5:57 UTC (permalink / raw
  To: gentoo-commits

commit:     2b36f3ad2ba0114eae1d32bae5e395e098b3714b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 28 03:44:47 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Dec 28 03:55:44 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=2b36f3ad

11.3.0: fix CET patch

Our patch was causing unhandled state to leak into the LTO metadata writer,
it shouldn't have got that far though. Instead of messing about with GCC's
option handling, use the macro they provide for purposes like this, which
makes things far simpler (and less fragile).

Bug: https://bugs.gentoo.org/828400
Bug: https://bugs.gentoo.org/822036
Thanks-to: Sergei Trofimovich <slyich <AT> gmail.com> (debugging help in #gentoo-toolchain)
Thanks-to: Georgy Yakovlev <gyakovlev <AT> gentoo.org> (debugging)
Reported-by: matoro <matoro <AT> airmail.cc>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 11.3.0/gentoo/26_all_enable-cet.patch | 65 +++++------------------------------
 1 file changed, 9 insertions(+), 56 deletions(-)

diff --git a/11.3.0/gentoo/26_all_enable-cet.patch b/11.3.0/gentoo/26_all_enable-cet.patch
index f3d189d..f6a1dce 100644
--- a/11.3.0/gentoo/26_all_enable-cet.patch
+++ b/11.3.0/gentoo/26_all_enable-cet.patch
@@ -1,6 +1,6 @@
-From ed1d323dc821e906144f4fc4c39bc16695495f73 Mon Sep 17 00:00:00 2001
+From 83efc6ce009021f27b602c1dfcf65338f761b095 Mon Sep 17 00:00:00 2001
 From: Sam James <sam@gentoo.org>
-Date: Thu, 9 Dec 2021 02:39:19 +0000
+Date: Tue, 28 Dec 2021 03:42:53 +0000
 Subject: [PATCH] Enable CET (-fcf-protection=full) by default
 
 Needs:
@@ -9,42 +9,22 @@ Needs:
   for now to avoid accidentally enabling it on other arches.
 
   Only supported on amd64.
+
 ---
- gcc/common.opt                 |  2 +-
- gcc/config/i386/i386-options.c |  8 ++++++++
+ gcc/config/i386/i386-options.c |  3 +++
  gcc/defaults.h                 | 13 +++++++++++++
- gcc/flag-types.h               |  1 +
- gcc/toplev.c                   |  4 +++-
- 5 files changed, 26 insertions(+), 2 deletions(-)
+ 2 files changed, 16 insertions(+)
 
-diff --git a/gcc/common.opt b/gcc/common.opt
-index a88778b..4993a7e 100644
---- a/gcc/common.opt
-+++ b/gcc/common.opt
-@@ -1783,7 +1783,7 @@ fcf-protection
- Common RejectNegative Alias(fcf-protection=,full)
- 
- fcf-protection=
--Common Joined RejectNegative Enum(cf_protection_level) Var(flag_cf_protection) Init(CF_NONE)
-+Common Joined RejectNegative Enum(cf_protection_level) Var(flag_cf_protection) Init(CF_UNSET)
- -fcf-protection=[full|branch|return|none|check]	Instrument functions with checks to verify jump/call/return control-flow transfer
- instructions have valid targets.
- 
 diff --git a/gcc/config/i386/i386-options.c b/gcc/config/i386/i386-options.c
-index 19632b5..8ee36fe 100644
+index 19632b5..fac61af 100644
 --- a/gcc/config/i386/i386-options.c
 +++ b/gcc/config/i386/i386-options.c
-@@ -3049,6 +3049,14 @@ ix86_option_override_internal (bool main_args_p,
+@@ -3049,6 +3049,9 @@ ix86_option_override_internal (bool main_args_p,
          = build_target_option_node (opts, opts_set);
      }
  
-+  if (opts->x_flag_cf_protection == CF_UNSET)
-+    {
-+      if (TARGET_64BIT && TARGET_CMOV)
-+	opts->x_flag_cf_protection = DEFAULT_FLAG_CF;
-+      else
-+	opts->x_flag_cf_protection = CF_NONE;
-+    }
++  if (TARGET_64BIT && TARGET_CMOV)
++    SET_OPTION_IF_UNSET (opts, opts_set, flag_cf_protection, DEFAULT_FLAG_CF);
 +
    if (opts->x_flag_cf_protection != CF_NONE)
      {
@@ -73,33 +53,6 @@ index 0f6cd78..5694412 100644
  /* 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
-diff --git a/gcc/flag-types.h b/gcc/flag-types.h
-index a038c8f..61be0b1 100644
---- a/gcc/flag-types.h
-+++ b/gcc/flag-types.h
-@@ -389,6 +389,7 @@ enum gfc_convert
- /* Control-Flow Protection values.  */
- enum cf_protection_level
- {
-+  CF_UNSET = -1,
-   CF_NONE = 0,
-   CF_BRANCH = 1 << 0,
-   CF_RETURN = 1 << 1,
-diff --git a/gcc/toplev.c b/gcc/toplev.c
-index ea0a2a1..bac60eb 100644
---- a/gcc/toplev.c
-+++ b/gcc/toplev.c
-@@ -1297,7 +1297,9 @@ process_options (void)
- 	   "%<-floop-nest-optimize%>, %<-floop-parallelize-all%>)");
- #endif
- 
--  if (flag_cf_protection != CF_NONE
-+  /* Gentoo: we add CF_UNSET here just to be safe, but we only patch the default
-+     for amd64 + when CET is definitely enabled anyway. */
-+  if ((flag_cf_protection != CF_NONE) && (flag_cf_protection != CF_UNSET)
-       && !(flag_cf_protection & CF_SET))
-     {
-       if (flag_cf_protection == CF_FULL)
 -- 
 2.34.1
 


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2022-01-08  3:49 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2022-01-08  3:49 UTC (permalink / raw
  To: gentoo-commits

commit:     7e2dec9de3d94ad18c2136f9ef8dbd48c1a5bdf4
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  8 03:06:25 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jan  8 03:06:50 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7e2dec9d

11.3.0: add PR103910 backport (OpenJDK ICE with PCH)

Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103910
Bug: https://bugs.gentoo.org/822690
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../gentoo/76_all_all_PR103910_12_ICE-on-PCH.patch | 35 ++++++++++++++++++++++
 11.3.0/gentoo/README.history                       |  3 ++
 2 files changed, 38 insertions(+)

diff --git a/11.3.0/gentoo/76_all_all_PR103910_12_ICE-on-PCH.patch b/11.3.0/gentoo/76_all_all_PR103910_12_ICE-on-PCH.patch
new file mode 100644
index 0000000..358b9b3
--- /dev/null
+++ b/11.3.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 <apinski@marvell.com>
+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.3.0/gentoo/README.history b/11.3.0/gentoo/README.history
index bd234ed..1faa3d6 100644
--- a/11.3.0/gentoo/README.history
+++ b/11.3.0/gentoo/README.history
@@ -1,3 +1,6 @@
+3		8 January 2022
+	+ 76_all_all_PR103910_12_ICE-on-PCH.patch
+
 2		7 December 2021
 	+ 01_all_default-fortify-source.patch
 	+ 02_all_default-warn-format-security.patch


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2022-01-08  3:49 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2022-01-08  3:49 UTC (permalink / raw
  To: gentoo-commits

commit:     e694058c76519b87a4bfda8ec6e8ea41f082323f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  8 03:09:34 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jan  8 03:12:47 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=e694058c

11.3.0: fix README.history

Signed-off-by: Sam James <sam <AT> gentoo.org>

 11.3.0/gentoo/26_all_enable-cet.patch |  3 +--
 11.3.0/gentoo/README.history          | 11 ++++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/11.3.0/gentoo/26_all_enable-cet.patch b/11.3.0/gentoo/26_all_enable-cet.patch
index f6a1dce..38bb34a 100644
--- a/11.3.0/gentoo/26_all_enable-cet.patch
+++ b/11.3.0/gentoo/26_all_enable-cet.patch
@@ -5,8 +5,7 @@ Subject: [PATCH] Enable CET (-fcf-protection=full) by default
 
 Needs:
 - CET to be enabled for GCC
-- -DEXTRA_OPTIONS_CF to be passed during build (via toolchain.eclass)
-  for now to avoid accidentally enabling it on other arches.
+- -DEXTRA_OPTIONS_CF to be passed during build (via toolchain.eclass).
 
   Only supported on amd64.
 

diff --git a/11.3.0/gentoo/README.history b/11.3.0/gentoo/README.history
index 1faa3d6..bb83275 100644
--- a/11.3.0/gentoo/README.history
+++ b/11.3.0/gentoo/README.history
@@ -1,7 +1,13 @@
 3		8 January 2022
-	+ 76_all_all_PR103910_12_ICE-on-PCH.patch
+	U 26_all_enable-cet.patch
 
-2		7 December 2021
+2		18 December 2021
+	+ 75_all_x86_PR99703_12_no-cet-for-i486.patch
+
+1		7 December 2021
+	U 26_all_enable-cet.patch
+
+0		27 November 2021
 	+ 01_all_default-fortify-source.patch
 	+ 02_all_default-warn-format-security.patch
 	+ 03_all_default-warn-trampolines.patch
@@ -28,4 +34,3 @@
 	+ 24_all_lto-intl-workaround-PR95194.patch
 	+ 25_all_plugin-objdump.patch
 	+ 26_all_enable-cet.patch
-	+ 75_all_x86_PR99703_12_no-cet-for-i486.patch


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2022-01-08  4:09 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2022-01-08  4:09 UTC (permalink / raw
  To: gentoo-commits

commit:     3c8a43b56a2b4fdc040055dadb76665ad4fe0a9c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  8 04:08:34 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jan  8 04:08:34 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3c8a43b5

11.3.0: cut patchset 4

Just includes the PCH fix.

Bug: https://bugs.gentoo.org/822690
Signed-off-by: Sam James <sam <AT> gentoo.org>

 11.3.0/gentoo/README.history | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/11.3.0/gentoo/README.history b/11.3.0/gentoo/README.history
index bb83275..850c02b 100644
--- a/11.3.0/gentoo/README.history
+++ b/11.3.0/gentoo/README.history
@@ -1,4 +1,7 @@
-3		8 January 2022
+4		8 January 2022
+	+ 76_all_all_PR103910_12_ICE-on-PCH.patch
+
+3		28 December 2021
 	U 26_all_enable-cet.patch
 
 2		18 December 2021


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2022-08-18 20:03 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2022-08-18 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     97ae6391c543891918047f724b0bddecc5f834bc
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 18 20:03:20 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 18 20:03:40 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=97ae6391

11.3.0: add 77_all_glibc_236.patch

Signed-off-by: Sam James <sam <AT> gentoo.org>

 11.3.0/gentoo/77_all_glibc_236.patch | 39 ++++++++++++++++++++++++++++++++++++
 11.3.0/gentoo/README.history         |  3 +++
 2 files changed, 42 insertions(+)

diff --git a/11.3.0/gentoo/77_all_glibc_236.patch b/11.3.0/gentoo/77_all_glibc_236.patch
new file mode 100644
index 0000000..c74e6ac
--- /dev/null
+++ b/11.3.0/gentoo/77_all_glibc_236.patch
@@ -0,0 +1,39 @@
+https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d2356ebb0084a0d80dbfe33040c9afe938c15d19
+
+Fix build w/ glibc 2.36.
+
+From d2356ebb0084a0d80dbfe33040c9afe938c15d19 Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 11 Jul 2022 22:03:14 +0200
+Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
+
+9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+
+(cherry picked from commit 2701442d0cf6292f6624443c15813d6d1a3562fe)
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -72,7 +72,9 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
++#if SANITIZER_ANDROID
+ #include <linux/fs.h>
++#endif
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -828,10 +830,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+-  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+-  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+-  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+-  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+   unsigned IOCTL_GIO_FONT = GIO_FONT;
+   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;

diff --git a/11.3.0/gentoo/README.history b/11.3.0/gentoo/README.history
index 49c754f..11d3a12 100644
--- a/11.3.0/gentoo/README.history
+++ b/11.3.0/gentoo/README.history
@@ -1,3 +1,6 @@
+6		18 August 2022
+	+ 77_all_glibc_236.patch
+
 5		3 July 2022
 	+ 27_all_msgfmt-libstdc++-link.patch
 


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2022-08-22  1:41 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2022-08-22  1:41 UTC (permalink / raw
  To: gentoo-commits

commit:     776eb259d04acdd0bbc24a606f08b72b61c2c653
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 22 01:17:39 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 22 01:41:31 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=776eb259

11.3.0: fix 20_all_libstdcxx-no-vtv.patch, update 77_all_glibc_236.patch

- fix 20_all_libstdcxx-no-vtv.patch (accidentally copied 11.4.0 patch before)
- update 77_all_glibc_236.patch to contain Go fix too

Bug: https://bugs.gentoo.org/865879
Signed-off-by: Sam James <sam <AT> gentoo.org>

 11.3.0/gentoo/20_all_libstdcxx-no-vtv.patch | 24 ++++++++++++------------
 11.3.0/gentoo/77_all_glibc_236.patch        | 29 +++++++++++++++++++++++++++++
 11.3.0/gentoo/README.history                |  2 +-
 3 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/11.3.0/gentoo/20_all_libstdcxx-no-vtv.patch b/11.3.0/gentoo/20_all_libstdcxx-no-vtv.patch
index 2719e2d..68508bd 100644
--- a/11.3.0/gentoo/20_all_libstdcxx-no-vtv.patch
+++ b/11.3.0/gentoo/20_all_libstdcxx-no-vtv.patch
@@ -5,27 +5,27 @@ Bug: https://bugs.gentoo.org/582524
 Bug: https://gcc.gnu.org/PR85884
 --- a/libstdc++-v3/src/Makefile.am
 +++ b/libstdc++-v3/src/Makefile.am
-@@ -277,7 +277,6 @@ CXXLINK = \
+@@ -217,7 +217,6 @@ CXXLINK = \
  	$(LIBTOOL) --tag CXX \
  	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  	--mode=link $(CXX) \
 -	$(VTV_CXXLINKFLAGS) \
- 	$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) \
- 	$(LTLDFLAGS) $(LTLIBICONV) \
- 	-o $@
+ 	$(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
-@@ -642,7 +642,6 @@ CXXLINK = \
+@@ -511,7 +511,6 @@ CXXLINK = \
  	$(LIBTOOL) --tag CXX \
  	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  	--mode=link $(CXX) \
 -	$(VTV_CXXLINKFLAGS) \
- 	$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) \
- 	$(LTLDFLAGS) $(LTLIBICONV) \
- 	-o $@
+ 	$(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
-@@ -214,5 +214,4 @@ CXXLINK = \
+@@ -204,5 +204,4 @@ CXXLINK = \
  	$(LIBTOOL) --tag CXX --tag disable-shared \
  	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  	--mode=link $(CXX) \
@@ -33,7 +33,7 @@ Bug: https://gcc.gnu.org/PR85884
  	$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
 --- a/libstdc++-v3/src/c++11/Makefile.in
 +++ b/libstdc++-v3/src/c++11/Makefile.in
-@@ -588,7 +588,6 @@ CXXLINK = \
+@@ -496,7 +496,6 @@ CXXLINK = \
  	$(LIBTOOL) --tag CXX --tag disable-shared \
  	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  	--mode=link $(CXX) \
@@ -43,7 +43,7 @@ Bug: https://gcc.gnu.org/PR85884
  all: all-am
 --- a/libstdc++-v3/src/c++98/Makefile.am
 +++ b/libstdc++-v3/src/c++98/Makefile.am
-@@ -268,5 +268,4 @@ CXXLINK = \
+@@ -273,5 +273,4 @@ CXXLINK = \
  	$(LIBTOOL) --tag CXX --tag disable-shared \
  	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  	--mode=link $(CXX) \
@@ -51,7 +51,7 @@ Bug: https://gcc.gnu.org/PR85884
  	$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
 --- a/libstdc++-v3/src/c++98/Makefile.in
 +++ b/libstdc++-v3/src/c++98/Makefile.in
-@@ -590,7 +590,6 @@ CXXLINK = \
+@@ -500,7 +500,6 @@ CXXLINK = \
  	$(LIBTOOL) --tag CXX --tag disable-shared \
  	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  	--mode=link $(CXX) \

diff --git a/11.3.0/gentoo/77_all_glibc_236.patch b/11.3.0/gentoo/77_all_glibc_236.patch
index c74e6ac..b398ec4 100644
--- a/11.3.0/gentoo/77_all_glibc_236.patch
+++ b/11.3.0/gentoo/77_all_glibc_236.patch
@@ -1,4 +1,6 @@
 https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d2356ebb0084a0d80dbfe33040c9afe938c15d19
+https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=a55184ada8e2887ca94c0ab07027617885beafc9
+https://bugs.gentoo.org/865879
 
 Fix build w/ glibc 2.36.
 
@@ -37,3 +39,30 @@ Subject: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
    unsigned IOCTL_GIO_CMAP = GIO_CMAP;
    unsigned IOCTL_GIO_FONT = GIO_FONT;
    unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
+
+From a55184ada8e2887ca94c0ab07027617885beafc9 Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Tue, 12 Jul 2022 19:42:43 -0700
+Subject: [PATCH] libgo: don't include <linux/fs.h> when building
+ gen-sysinfo.go
+
+Removing this doesn't change anything at least with glibc 2.33.
+The include was added in https://go.dev/cl/6100049 but it's not
+clear why.
+
+Fixes PR go/106266
+
+Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
+(cherry picked from commit f35d65517a59565758107c5b1a51a5fa382f8d1a)
+--- a/libgo/sysinfo.c
++++ b/libgo/sysinfo.c
+@@ -158,9 +158,6 @@
+ #if defined(HAVE_LINUX_ETHER_H)
+ #include <linux/ether.h>
+ #endif
+-#if defined(HAVE_LINUX_FS_H)
+-#include <linux/fs.h>
+-#endif
+ #if defined(HAVE_LINUX_REBOOT_H)
+ #include <linux/reboot.h>
+ #endif

diff --git a/11.3.0/gentoo/README.history b/11.3.0/gentoo/README.history
index 11d3a12..44c3d49 100644
--- a/11.3.0/gentoo/README.history
+++ b/11.3.0/gentoo/README.history
@@ -1,4 +1,4 @@
-6		18 August 2022
+6		22 August 2022
 	+ 77_all_glibc_236.patch
 
 5		3 July 2022


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2022-08-22  1:41 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2022-08-22  1:41 UTC (permalink / raw
  To: gentoo-commits

commit:     5c3e52c3e7da07ee3ca18cb60f1e597a2cc0bf6f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 22 01:29:06 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 22 01:41:31 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=5c3e52c3

11.3.0: add another bug ref to glibc 2.36 patch

Bug: https://bugs.gentoo.org/864717
Signed-off-by: Sam James <sam <AT> gentoo.org>

 11.3.0/gentoo/77_all_glibc_236.patch | 1 +
 1 file changed, 1 insertion(+)

diff --git a/11.3.0/gentoo/77_all_glibc_236.patch b/11.3.0/gentoo/77_all_glibc_236.patch
index b398ec4..b9704e7 100644
--- a/11.3.0/gentoo/77_all_glibc_236.patch
+++ b/11.3.0/gentoo/77_all_glibc_236.patch
@@ -1,6 +1,7 @@
 https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d2356ebb0084a0d80dbfe33040c9afe938c15d19
 https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=a55184ada8e2887ca94c0ab07027617885beafc9
 https://bugs.gentoo.org/865879
+https://bugs.gentoo.org/864717
 
 Fix build w/ glibc 2.36.
 


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/
@ 2022-08-22  2:14 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2022-08-22  2:14 UTC (permalink / raw
  To: gentoo-commits

commit:     5214684ada542a7615215a731f2912b258f4824d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 22 02:07:36 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 22 02:14:11 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=5214684a

11.3.0: add 28_all_drop_CFLAGS_sed.patch

Previously was just for 12.

Bug: https://bugs.gentoo.org/849722
Signed-off-by: Sam James <sam <AT> gentoo.org>

 11.3.0/gentoo/28_all_drop_CFLAGS_sed.patch | 35 ++++++++++++++++++++++++++++++
 11.3.0/gentoo/README.history               |  3 +++
 2 files changed, 38 insertions(+)

diff --git a/11.3.0/gentoo/28_all_drop_CFLAGS_sed.patch b/11.3.0/gentoo/28_all_drop_CFLAGS_sed.patch
new file mode 100644
index 0000000..0a9fa13
--- /dev/null
+++ b/11.3.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.3.0/gentoo/README.history b/11.3.0/gentoo/README.history
index 44c3d49..c62f0cb 100644
--- a/11.3.0/gentoo/README.history
+++ b/11.3.0/gentoo/README.history
@@ -1,3 +1,6 @@
+7		22 August 2022
+	+ 28_all_drop_CFLAGS_sed.patch
+
 6		22 August 2022
 	+ 77_all_glibc_236.patch
 


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-08-22  2:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-07 20:06 [gentoo-commits] proj/gcc-patches:master commit in: 11.3.0/gentoo/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2022-08-22  2:14 Sam James
2022-08-22  1:41 Sam James
2022-08-22  1:41 Sam James
2022-08-18 20:03 Sam James
2022-01-08  4:09 Sam James
2022-01-08  3:49 Sam James
2022-01-08  3:49 Sam James
2021-12-28  5:57 Sam James
2021-12-18 22:00 Sam James
2021-12-18 22:00 Sam James
2021-12-18 22:00 Sam James
2021-12-02 15:03 David Seifert
2021-12-02 15:03 David Seifert
2021-12-02 15:03 David Seifert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox