summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2020-03-26 07:49:07 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2020-03-26 07:50:41 +0000
commita5003d48705fa9b501022d4e6326c8f516a2eec0 (patch)
treed7a89c88f09e874851c6b22c39dfd5e31bd10b0f /eclass/flag-o-matic.eclass
parentdev-ruby/rrdtool-bindings: add ruby27 (diff)
downloadgentoo-a5003d48705fa9b501022d4e6326c8f516a2eec0.tar.gz
gentoo-a5003d48705fa9b501022d4e6326c8f516a2eec0.tar.bz2
gentoo-a5003d48705fa9b501022d4e6326c8f516a2eec0.zip
flag-o-matic.eclass: revert "don't use -Werror in test-flag-PROG(), bug #712488"
This reverts commit ab8fe14ae2e9110faa85ca1c4528b470c0be1535. Triggers build failures on sys-libs/compiler-rt-sanitizers. Reported-by: Craig Andrews Bug: https://bugs.gentoo.org/714742 Bug: https://bugs.gentoo.org/712488 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'eclass/flag-o-matic.eclass')
-rw-r--r--eclass/flag-o-matic.eclass19
1 files changed, 11 insertions, 8 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index d8111fb9e38f..9ef9ac3685e0 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -487,15 +487,11 @@ test-flag-PROG() {
printf "%s\n" "${in_src}" > "${test_in}" || die "Failed to create '${test_in}'"
- # Don't set -Werror as there are cases when benign
- # always-on warnings filter out all flags like bug #712488.
- # We'll have to live with potential '-Wunused-command-line-argument'.
- # flags.
- #
- # We can add more selective detection of no-op flags via
- # '-Werror=ignored-optimization-argument' and similar error options.
local cmdline=(
"${comp[@]}"
+ # Clang will warn about unknown gcc flags but exit 0.
+ # Need -Werror to force it to exit non-zero.
+ -Werror
"$@"
# -x<lang> options need to go before first source file
"${cmdline_extra[@]}"
@@ -503,7 +499,14 @@ test-flag-PROG() {
"${test_in}" -o "${test_out}"
)
- "${cmdline[@]}" &>/dev/null
+ if ! "${cmdline[@]}" &>/dev/null; then
+ # -Werror makes clang bail out on unused arguments as well;
+ # try to add -Qunused-arguments to work-around that
+ # other compilers don't support it but then, it's failure like
+ # any other
+ cmdline+=( -Qunused-arguments )
+ "${cmdline[@]}" &>/dev/null
+ fi
}
# @FUNCTION: test-flag-CC