summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2019-09-30 09:52:04 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2019-09-30 10:00:31 +0100
commit60328373651331a8d1beab33f4a499e0b3ad61d7 (patch)
treef80c0382569cfde75fb29908e5dc15cc85b84e85 /eclass
parentprofiles/thirdpartymirrors: Update nongnu mirrors (diff)
downloadgentoo-60328373651331a8d1beab33f4a499e0b3ad61d7.tar.gz
gentoo-60328373651331a8d1beab33f4a499e0b3ad61d7.tar.bz2
gentoo-60328373651331a8d1beab33f4a499e0b3ad61d7.zip
flag-o-matic.eclass: fix test-flag-PROG() for CC="gcc -m64"
bug #695706 added compiler validation via 'type -p ${CC}', but that does not take into account possible options present in ${CC} itself: $ type -P x86_64-pc-linux-gnu-gcc -m64; echo $? /usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc 1 $ type -P x86_64-pc-linux-gnu-gcc ; echo $? /usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc 0 The change picks first argument (binary name) and validates only that. Reported-by: Pavol Cupka Closes: https://bugs.gentoo.org/695888 Bug: https://bugs.gentoo.org/show_bug.cgi?id=695706 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/flag-o-matic.eclass8
1 files changed, 5 insertions, 3 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 89b259cc222f..f882b09d6219 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -436,11 +436,13 @@ test-flag-PROG() {
[[ -z ${comp} || -z $1 ]] && return 1
# verify selected compiler exists before using it
- comp=$(tc-get${comp})
- type -p ${comp} >/dev/null || return 1
+ comp=($(tc-get${comp}))
+ # 'comp' can already contain compiler options.
+ # 'type' needs a binary name
+ type -p ${comp[0]} >/dev/null || return 1
local cmdline=(
- ${comp}
+ "${comp[@]}"
# Clang will warn about unknown gcc flags but exit 0.
# Need -Werror to force it to exit non-zero.
-Werror