Gentoo Archives: gentoo-commits

From: Jory Pratt <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: sys-devel/gcc/files/, sys-devel/gcc/
Date: Mon, 13 Sep 2021 02:01:45
Message-Id: 1631498495.e5b037865b4a7264c27c7fc64466de1012d4b29c.anarchy@gentoo
1 commit: e5b037865b4a7264c27c7fc64466de1012d4b29c
2 Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 13 02:01:35 2021 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 13 02:01:35 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=e5b03786
7
8 sys-devel/gcc: use libssp_nonshared.a for ssp
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>
12
13 sys-devel/gcc/files/gcc-6.1-musl-libssp.patch | 20 ++++++++++++++++++++
14 sys-devel/gcc/gcc-10.3.0-r2.ebuild | 4 ++++
15 sys-devel/gcc/gcc-11.1.0-r1.ebuild | 4 ++++
16 sys-devel/gcc/gcc-11.2.0.ebuild | 4 ++++
17 4 files changed, 32 insertions(+)
18
19 diff --git a/sys-devel/gcc/files/gcc-6.1-musl-libssp.patch b/sys-devel/gcc/files/gcc-6.1-musl-libssp.patch
20 new file mode 100644
21 index 0000000..fe5c614
22 --- /dev/null
23 +++ b/sys-devel/gcc/files/gcc-6.1-musl-libssp.patch
24 @@ -0,0 +1,20 @@
25 +Author: Timo Teräs <timo.teras@×××.fi>
26 +
27 +Alpine musl package provides libssp_nonshared.a. We link to it unconditionally,
28 +as otherwise we get link failures if some objects are -fstack-protector built
29 +and final link happens with -fno-stack-protector. This seems to be the common
30 +case when bootstrapping gcc, the piepatches do not seem to fully fix the
31 +crosstoolchain and bootstrap sequence wrt. stack-protector flag usage.
32 +
33 +--- gcc-6.1.0/gcc/gcc.c.orig
34 ++++ gcc-6.1.0/gcc/gcc.c
35 +@@ -870,8 +870,7 @@
36 +
37 + #ifndef LINK_SSP_SPEC
38 + #ifdef TARGET_LIBC_PROVIDES_SSP
39 +-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
40 +- "|fstack-protector-strong|fstack-protector-explicit:}"
41 ++#define LINK_SSP_SPEC "-lssp_nonshared"
42 + #else
43 + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
44 + "|fstack-protector-strong|fstack-protector-explicit" \
45
46 diff --git a/sys-devel/gcc/gcc-10.3.0-r2.ebuild b/sys-devel/gcc/gcc-10.3.0-r2.ebuild
47 index 52430b9..7dec59f 100644
48 --- a/sys-devel/gcc/gcc-10.3.0-r2.ebuild
49 +++ b/sys-devel/gcc/gcc-10.3.0-r2.ebuild
50 @@ -23,5 +23,9 @@ src_prepare() {
51 esac
52 fi
53
54 + if [[ ${CATEGORY} != cross-* ]] ; then
55 + eapply "${FILESDIR}"/gcc-6.1-musl-libssp.patch
56 + fi
57 +
58 eapply_user
59 }
60
61 diff --git a/sys-devel/gcc/gcc-11.1.0-r1.ebuild b/sys-devel/gcc/gcc-11.1.0-r1.ebuild
62 index f60c567..5b6db15 100644
63 --- a/sys-devel/gcc/gcc-11.1.0-r1.ebuild
64 +++ b/sys-devel/gcc/gcc-11.1.0-r1.ebuild
65 @@ -27,5 +27,9 @@ src_prepare() {
66 esac
67 fi
68
69 + if [[ ${CATEGORY} != cross-* ]] ; then
70 + eapply "${FILESDIR}"/gcc-6.1-musl-libssp.patch
71 + fi
72 +
73 eapply_user
74 }
75
76 diff --git a/sys-devel/gcc/gcc-11.2.0.ebuild b/sys-devel/gcc/gcc-11.2.0.ebuild
77 index 3f91080..ccb6c1c 100644
78 --- a/sys-devel/gcc/gcc-11.2.0.ebuild
79 +++ b/sys-devel/gcc/gcc-11.2.0.ebuild
80 @@ -23,5 +23,9 @@ src_prepare() {
81 esac
82 fi
83
84 + if [[ ${CATEGORY} != cross-* ]] ; then
85 + eapply "${FILESDIR}"/gcc-6.1-musl-libssp.patch
86 + fi
87 +
88 eapply_user
89 }
90 \ No newline at end of file