diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-05-06 07:04:53 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-05-06 07:04:53 +0000 |
commit | ccb1b28d8a4d4e5b8114d4d6ef032e42b99f60d3 (patch) | |
tree | 5ce69a2cff4803bfaa96fa45d9777427f5821fd2 /eclass/flag-o-matic.eclass | |
parent | Fix file collision, bug #547890; drop old (diff) | |
download | gentoo-2-ccb1b28d8a4d4e5b8114d4d6ef032e42b99f60d3.tar.gz gentoo-2-ccb1b28d8a4d4e5b8114d4d6ef032e42b99f60d3.tar.bz2 gentoo-2-ccb1b28d8a4d4e5b8114d4d6ef032e42b99f60d3.zip |
make flag testing work for clang too crbug.com/474652
Diffstat (limited to 'eclass/flag-o-matic.eclass')
-rw-r--r-- | eclass/flag-o-matic.eclass | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 5ede6bf8c50a..f5919cccf2bd 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.204 2014/12/31 08:26:48 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.205 2015/05/06 07:04:53 vapier Exp $ # @ECLASS: flag-o-matic.eclass # @MAINTAINER: @@ -415,13 +415,18 @@ test-flag-PROG() { [[ -z ${comp} || -z ${flag} ]] && return 1 - # use -c so we can test the assembler as well - local PROG=$(tc-get${comp}) - if ${PROG} -c -o /dev/null -x${lang} - < /dev/null > /dev/null 2>&1 ; then - ${PROG} "${flag}" -c -o /dev/null -x${lang} - < /dev/null \ - > /dev/null 2>&1 + local cmdline=( + $(tc-get${comp}) + # Clang will warn about unknown gcc flags but exit 0. + # Need -Werror to force it to exit non-zero. + -Werror + # Use -c so we can test the assembler as well. + -c -o /dev/null + ) + if "${cmdline[@]}" -x${lang} - </dev/null >/dev/null 2>&1 ; then + "${cmdline[@]}" "${flag}" -x${lang} - </dev/null >/dev/null 2>&1 else - ${PROG} "${flag}" -c -o /dev/null /dev/null > /dev/null 2>&1 + "${cmdline[@]}" "${flag}" -c -o /dev/null /dev/null >/dev/null 2>&1 fi } |