commit:     6cbc18ad615fd39e765d114db4ed13d801e79f14
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 29 08:22:41 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jan 29 08:50:26 2023 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6cbc18ad

12.2.0: shift libssp patch out of nocross

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

 12.2.0/musl/50_all_libssp_unconditionally.patch | 24 ++++++++++++++++++++++++
 12.2.0/musl/README.history                      |  3 +++
 2 files changed, 27 insertions(+)

diff --git a/12.2.0/musl/50_all_libssp_unconditionally.patch 
b/12.2.0/musl/50_all_libssp_unconditionally.patch
new file mode 100644
index 0000000..a3b5984
--- /dev/null
+++ b/12.2.0/musl/50_all_libssp_unconditionally.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/706210
+https://bugs.gentoo.org/747346
+
+Author: Timo Teräs <[email protected]>
+
+"Alpine musl package provides libssp_nonshared.a. We link to it 
unconditionally,
+as otherwise we get link failures if some objects are -fstack-protector built
+and final link happens with -fno-stack-protector. This seems to be the common
+case when bootstrapping gcc, the piepatches do not seem to fully fix the
+crosstoolchain and  bootstrap sequence wrt. stack-protector flag usage."
+
+(We do the same in Gentoo.)
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -870,8 +870,7 @@
+ 
+ #ifndef LINK_SSP_SPEC
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+-                     "|fstack-protector-strong|fstack-protector-explicit:}"
++#define LINK_SSP_SPEC "-lssp_nonshared"
+ #else
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+                      "|fstack-protector-strong|fstack-protector-explicit" \

diff --git a/12.2.0/musl/README.history b/12.2.0/musl/README.history
index 0999249..56093c5 100644
--- a/12.2.0/musl/README.history
+++ b/12.2.0/musl/README.history
@@ -1,3 +1,6 @@
+7              29 Jan 2022
+       U 50_all_libssp_unconditionally.patch   
+
 6              03 Jul 2022
        - 50_all_calloc_libgccjit.patch
 

Reply via email to