summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2017-08-08 16:33:09 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2017-08-10 22:55:43 +0100
commit5f2d4eb56a6eba177bdf7134fe8e5f749ea67b90 (patch)
tree319bf3fb7df92816409732e8ea1bb36f39eb22a5
parentapp-i18n/canna: keyworded 3.7_p3-r3 for ppc64, bug #624226 (diff)
downloadgentoo-5f2d4eb5.tar.gz
gentoo-5f2d4eb5.tar.bz2
gentoo-5f2d4eb5.zip
toolchain.eclass: fix tc-enables-* with -ggdb3
-ggdb3 builds debug information for macros into binaries. For this reason, the C preprocessor includes all #defines as-is in the output. The check in tc-enables-* expects only a fixed output of "true", which fails in this scenario. To fix this, `grep` is used to look specifically for "true" in the output from the preprocessor. Closes: https://github.com/gentoo/gentoo/pull/5359 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Matthias Maier <tamiko@gentoo.org>
-rw-r--r--eclass/toolchain-funcs.eclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 777fce905f3e..aeb6f7c70299 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -798,7 +798,7 @@ gcc-specs-stack-check() {
# Return truth if the current compiler generates position-independent code (PIC)
# which can be linked into executables.
tc-enables-pie() {
- local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null
+ local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null | grep '^true$'
#if defined(__PIE__)
true
#endif
@@ -816,7 +816,7 @@ tc-enables-pie() {
# -fstack-protector-strong
# -fstack-protector-all
tc-enables-ssp() {
- local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null
+ local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null | grep '^true$'
#if defined(__SSP__) || defined(__SSP_STRONG__) || defined(__SSP_ALL__)
true
#endif
@@ -833,7 +833,7 @@ tc-enables-ssp() {
# -fstack-protector-strong
# -fstack-protector-all
tc-enables-ssp-strong() {
- local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null
+ local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null | grep '^true$'
#if defined(__SSP_STRONG__) || defined(__SSP_ALL__)
true
#endif
@@ -849,7 +849,7 @@ tc-enables-ssp-strong() {
# on level corresponding to any of the following options:
# -fstack-protector-all
tc-enables-ssp-all() {
- local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null
+ local ret="$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null | grep '^true$'
#if defined(__SSP_ALL__)
true
#endif