flag-o-matic.eclass: fix test-flag-PROG() for CC="gcc -m64"
authorSergei Trofimovich <slyfox@gentoo.org>
Mon, 30 Sep 2019 08:52:04 +0000 (09:52 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Mon, 30 Sep 2019 09:00:31 +0000 (10:00 +0100)
commit60328373651331a8d1beab33f4a499e0b3ad61d7
treef80c0382569cfde75fb29908e5dc15cc85b84e85
parentbc089c6d2f06d388390857f33fcfc536fc241612
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>
eclass/flag-o-matic.eclass