Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Thu, 10 Aug 2017 21:56:53
Message-Id: 1502402143.5f2d4eb56a6eba177bdf7134fe8e5f749ea67b90.slyfox@gentoo
1 commit: 5f2d4eb56a6eba177bdf7134fe8e5f749ea67b90
2 Author: Luke Dashjr <luke-jr+git <AT> utopios <DOT> org>
3 AuthorDate: Tue Aug 8 16:33:09 2017 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 10 21:55:43 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f2d4eb5
7
8 toolchain.eclass: fix tc-enables-* with -ggdb3
9
10 -ggdb3 builds debug information for macros into binaries. For this reason,
11 the C preprocessor includes all #defines as-is in the output. The check
12 in tc-enables-* expects only a fixed output of "true", which fails in this
13 scenario.
14
15 To fix this, `grep` is used to look specifically for "true" in the output
16 from the preprocessor.
17
18 Closes: https://github.com/gentoo/gentoo/pull/5359
19 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
20 Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>
21
22 eclass/toolchain-funcs.eclass | 8 ++++----
23 1 file changed, 4 insertions(+), 4 deletions(-)
24
25 diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
26 index 777fce905f3..aeb6f7c7029 100644
27 --- a/eclass/toolchain-funcs.eclass
28 +++ b/eclass/toolchain-funcs.eclass
29 @@ -798,7 +798,7 @@ gcc-specs-stack-check() {
30 # Return truth if the current compiler generates position-independent code (PIC)
31 # which can be linked into executables.
32 tc-enables-pie() {
33 - local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null
34 + local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null | grep '^true$'
35 #if defined(__PIE__)
36 true
37 #endif
38 @@ -816,7 +816,7 @@ tc-enables-pie() {
39 # -fstack-protector-strong
40 # -fstack-protector-all
41 tc-enables-ssp() {
42 - local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null
43 + local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null | grep '^true$'
44 #if defined(__SSP__) || defined(__SSP_STRONG__) || defined(__SSP_ALL__)
45 true
46 #endif
47 @@ -833,7 +833,7 @@ tc-enables-ssp() {
48 # -fstack-protector-strong
49 # -fstack-protector-all
50 tc-enables-ssp-strong() {
51 - local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null
52 + local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null | grep '^true$'
53 #if defined(__SSP_STRONG__) || defined(__SSP_ALL__)
54 true
55 #endif
56 @@ -849,7 +849,7 @@ tc-enables-ssp-strong() {
57 # on level corresponding to any of the following options:
58 # -fstack-protector-all
59 tc-enables-ssp-all() {
60 - local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null
61 + local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null | grep '^true$'
62 #if defined(__SSP_ALL__)
63 true
64 #endif