aboutsummaryrefslogtreecommitdiffstats
path: root/main/gcc/013_all_default-ssp-fix.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-09-26 07:13:06 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-09-26 12:55:51 +0000
commita1879bd58982c8ed4b39e08e17942462027ef447 (patch)
treea68063da2c9941223060eff709454462b72004e6 /main/gcc/013_all_default-ssp-fix.patch
parentf2204f50d09189657c86ab78592289d75aef21e1 (diff)
downloadaports-a1879bd58982c8ed4b39e08e17942462027ef447.tar.bz2
aports-a1879bd58982c8ed4b39e08e17942462027ef447.tar.xz
main/gcc: upgrade to 8.2.0
Diffstat (limited to 'main/gcc/013_all_default-ssp-fix.patch')
-rw-r--r--main/gcc/013_all_default-ssp-fix.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/main/gcc/013_all_default-ssp-fix.patch b/main/gcc/013_all_default-ssp-fix.patch
new file mode 100644
index 0000000000..d2deac760b
--- /dev/null
+++ b/main/gcc/013_all_default-ssp-fix.patch
@@ -0,0 +1,38 @@
+Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
+Change the buffer size.
+
+--- a/gcc/gcc.c 2017-07-04 09:15:57.740793000 +0200
++++ b/gcc/gcc.c 2018-03-02 13:58:44.387741114 +0100
+@@ -857,6 +857,12 @@ proper position among the other output f
+ #define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G"
+ #endif
+
++#ifdef ENABLE_DEFAULT_SSP
++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
++#else
++#define NO_SSP_SPEC ""
++#endif
++
+ #ifndef LINK_SSP_SPEC
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+@@ -1131,7 +1148,7 @@ static const char *cc1_options =
+ %{-version:--version}\
+ %{-help=*:--help=%*}\
+ %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %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=singel:\
+--- a/gcc/params.def 2016-03-30 09:47:40.000000000 +0200
++++ b/gcc/params.def 2016-09-19 12:56:58.443179039 +0200
+@@ -673,7 +673,7 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT,
+ DEFPARAM (PARAM_SSP_BUFFER_SIZE,
+ "ssp-buffer-size",
+ "The lower bound for a buffer to be considered for stack smashing protection.",
+- 8, 1, 0)
++ 4, 1, 0)
+
+ DEFPARAM (PARAM_MIN_SIZE_FOR_STACK_SHARING,
+ "min-size-for-stack-sharing",