2023-05-21 19:12:02 +00:00
|
|
|
From 547ed1d35f0fa8c04cefb8708c4a148f86ed3397 Mon Sep 17 00:00:00 2001
|
2020-08-21 10:18:02 +00:00
|
|
|
From: Ariadne Conill <ariadne@dereferenced.org>
|
|
|
|
Date: Fri, 21 Aug 2020 06:49:40 +0000
|
2023-05-21 19:12:02 +00:00
|
|
|
Subject: [PATCH 08/32] Disable ssp on -nostdlib, -nodefaultlibs and
|
2023-05-15 08:15:31 +00:00
|
|
|
-ffreestanding Change the buffer size.
|
2020-08-21 10:18:02 +00:00
|
|
|
|
|
|
|
---
|
2022-08-13 15:17:36 +00:00
|
|
|
gcc/gcc.cc | 8 +++++++-
|
2020-08-21 10:18:02 +00:00
|
|
|
gcc/params.opt | 2 +-
|
|
|
|
2 files changed, 8 insertions(+), 2 deletions(-)
|
|
|
|
|
2022-08-13 15:17:36 +00:00
|
|
|
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
2023-05-15 08:15:31 +00:00
|
|
|
index da6417dd0d1..b5a6f200635 100644
|
2022-08-13 15:17:36 +00:00
|
|
|
--- a/gcc/gcc.cc
|
|
|
|
+++ b/gcc/gcc.cc
|
2023-05-15 08:15:31 +00:00
|
|
|
@@ -983,6 +983,12 @@ proper position among the other output files. */
|
2020-08-21 10:18:02 +00:00
|
|
|
#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" \
|
2023-05-15 08:15:31 +00:00
|
|
|
@@ -1282,7 +1288,7 @@ static const char *cc1_options =
|
2020-08-21 10:18:02 +00:00
|
|
|
%{-version:--version}\
|
|
|
|
%{-help=*:--help=%*}\
|
2021-11-25 09:09:10 +00:00
|
|
|
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
|
2020-08-21 10:18:02 +00:00
|
|
|
- %{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
|
2023-05-15 08:15:31 +00:00
|
|
|
index 823cdb2ff85..5b096899b40 100644
|
2020-08-21 10:18:02 +00:00
|
|
|
--- a/gcc/params.opt
|
|
|
|
+++ b/gcc/params.opt
|
2023-05-15 08:15:31 +00:00
|
|
|
@@ -1006,7 +1006,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
|
2020-08-21 10:18:02 +00:00
|
|
|
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=
|
2023-05-15 08:15:31 +00:00
|
|
|
--
|
|
|
|
2.40.1
|
|
|
|
|