aboutsummaryrefslogtreecommitdiffstats
path: root/musl/patches-in-mcm/gcc-13.2.0/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-09-07 14:55:46 +0000
committerLaurent Bercot <ska@appnovation.com>2024-09-07 14:55:46 +0000
commit1559cbe1ebcea1dac3f5c3a40a51efedd7766ffc (patch)
tree8a8d1e0c31e3328c9897c3727a555c693ef8a2fc /musl/patches-in-mcm/gcc-13.2.0/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
downloadToolchainFactory-1559cbe1ebcea1dac3f5c3a40a51efedd7766ffc.tar.gz
Initial commit
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'musl/patches-in-mcm/gcc-13.2.0/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch')
-rw-r--r--musl/patches-in-mcm/gcc-13.2.0/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/musl/patches-in-mcm/gcc-13.2.0/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch b/musl/patches-in-mcm/gcc-13.2.0/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
new file mode 100644
index 0000000..69c1bf7
--- /dev/null
+++ b/musl/patches-in-mcm/gcc-13.2.0/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
@@ -0,0 +1,53 @@
+From 32f24560d0602f7735d5e9efd92fe3151bd72cea Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:49:40 +0000
+Subject: [PATCH 08/35] Disable ssp on -nostdlib, -nodefaultlibs and
+ -ffreestanding Change the buffer size.
+
+---
+ gcc/gcc.cc | 8 +++++++-
+ gcc/params.opt | 2 +-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/gcc.cc b/gcc/gcc.cc
+index da6417dd0d1..b5a6f200635 100644
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -983,6 +983,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" \
+@@ -1282,7 +1288,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/gcc/params.opt b/gcc/params.opt
+index 823cdb2ff85..5b096899b40 100644
+--- a/gcc/params.opt
++++ b/gcc/params.opt
+@@ -1006,7 +1006,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=
+--
+2.41.0
+