aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '14.2.0/gentoo/04_all_nossp-on-nostdlib.patch')
-rw-r--r--14.2.0/gentoo/04_all_nossp-on-nostdlib.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/14.2.0/gentoo/04_all_nossp-on-nostdlib.patch b/14.2.0/gentoo/04_all_nossp-on-nostdlib.patch
new file mode 100644
index 0000000..30c5825
--- /dev/null
+++ b/14.2.0/gentoo/04_all_nossp-on-nostdlib.patch
@@ -0,0 +1,28 @@
+│Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
+https://bugs.gentoo.org/484714
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -984,6 +984,12 @@ proper position among the other output files. */
+ #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
+ #endif
+
++#ifdef ENABLE_DEFAULT_SSP
++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
++#else
++#define NO_SSP_SPEC ""
++#endif
++
+ #ifndef LINK_SSP_SPEC
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+@@ -1286,7 +1292,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|fcondition-coverage|fprofile-generate*|coverage:\
+ %{!fprofile-update=single:\
+--
+2.44.0