1 |
commit: 604495b43aa4a5b7aed2044b84ca0d88e600d1df |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 10 09:45:39 2017 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 10 10:12:18 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=604495b4 |
7 |
|
8 |
glibc: disable stack protector on ARCH=ppc |
9 |
|
10 |
Currently gcc on powerpc32 generates invalid code for |
11 |
__builtin_return_address(0) calls. Normally programs |
12 |
don't do that but malloc() hooks in glibc do: |
13 |
|
14 |
Bug: https://gcc.gnu.org/PR81996 |
15 |
Bug: https://bugs.gentoo.org/629054 |
16 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
17 |
|
18 |
eclass/toolchain-glibc.eclass | 14 +++++++++++++- |
19 |
sys-libs/glibc/glibc-2.26-r1.ebuild | 14 +++++++++++++- |
20 |
2 files changed, 26 insertions(+), 2 deletions(-) |
21 |
|
22 |
diff --git a/eclass/toolchain-glibc.eclass b/eclass/toolchain-glibc.eclass |
23 |
index 33f27ccf46e..98e394659cf 100644 |
24 |
--- a/eclass/toolchain-glibc.eclass |
25 |
+++ b/eclass/toolchain-glibc.eclass |
26 |
@@ -795,7 +795,19 @@ glibc_do_configure() { |
27 |
fi |
28 |
|
29 |
if version_is_at_least 2.25 ; then |
30 |
- myconf+=( --enable-stack-protector=all ) |
31 |
+ case ${CTARGET} in |
32 |
+ powerpc-*) |
33 |
+ # Currently gcc on powerpc32 generates invalid code for |
34 |
+ # __builtin_return_address(0) calls. Normally programs |
35 |
+ # don't do that but malloc hooks in glibc do: |
36 |
+ # https://gcc.gnu.org/PR81996 |
37 |
+ # https://bugs.gentoo.org/629054 |
38 |
+ myconf+=( --enable-stack-protector=no ) |
39 |
+ ;; |
40 |
+ *) |
41 |
+ myconf+=( --enable-stack-protector=all ) |
42 |
+ ;; |
43 |
+ esac |
44 |
fi |
45 |
|
46 |
if version_is_at_least 2.25 ; then |
47 |
|
48 |
diff --git a/sys-libs/glibc/glibc-2.26-r1.ebuild b/sys-libs/glibc/glibc-2.26-r1.ebuild |
49 |
index fbe7444f948..b852aba96bc 100644 |
50 |
--- a/sys-libs/glibc/glibc-2.26-r1.ebuild |
51 |
+++ b/sys-libs/glibc/glibc-2.26-r1.ebuild |
52 |
@@ -315,7 +315,19 @@ glibc_do_configure() { |
53 |
[[ -d ports ]] && addons+=",ports" |
54 |
popd > /dev/null |
55 |
|
56 |
- myconf+=( --enable-stack-protector=all ) |
57 |
+ case ${CTARGET} in |
58 |
+ powerpc-*) |
59 |
+ # Currently gcc on powerpc32 generates invalid code for |
60 |
+ # __builtin_return_address(0) calls. Normally programs |
61 |
+ # don't do that but malloc hooks in glibc do: |
62 |
+ # https://gcc.gnu.org/PR81996 |
63 |
+ # https://bugs.gentoo.org/629054 |
64 |
+ myconf+=( --enable-stack-protector=no ) |
65 |
+ ;; |
66 |
+ *) |
67 |
+ myconf+=( --enable-stack-protector=all ) |
68 |
+ ;; |
69 |
+ esac |
70 |
myconf+=( --enable-stackguard-randomization ) |
71 |
|
72 |
[[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp ) |