summaryrefslogtreecommitdiff
path: root/eclass/flag-o-matic.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-08-24 08:47:16 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-08-24 08:47:16 +0100
commit7405d8a728a9553d7b8eccb67737c5193c9f13ba (patch)
treeb724a0d3f660dce5eb1a6a7aedb3e83f983c4dfd /eclass/flag-o-matic.eclass
parent2d51a70c0ec989cfc28d2d9a140206a601378c58 (diff)
gentoo auto-resync : 24:08:2022 - 08:47:15
Diffstat (limited to 'eclass/flag-o-matic.eclass')
-rw-r--r--eclass/flag-o-matic.eclass22
1 files changed, 11 insertions, 11 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 7319326c7ad8..365741a6dddf 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -601,11 +601,20 @@ _test-flag-PROG() {
#
# We can add more selective detection of no-op flags via
# '-Werror=ignored-optimization-argument' and similar error options
- # similar to what we are doing with '-Qunused-arguments'.
+ # or accept unused flags with '-Qunused-arguments' like we
+ # used to for bug #627474. Since we now invoke the linker
+ # for testing linker flags, unused argument warnings aren't
+ # ignored; linker flags may no longer be accepted in CFLAGS.
+ #
+ # However, warnings emitted by a compiler for a clean source
+ # can break feature detection by CMake or autoconf since
+ # many checks use -Werror internally. See e.g. bug #714742.
local cmdline=(
"${comp[@]}"
# Clang will warn about unknown gcc flags but exit 0.
# Need -Werror to force it to exit non-zero.
+ #
+ # See also bug #712488 and bug #714742.
-Werror
"$@"
# -x<lang> options need to go before first source file
@@ -614,16 +623,7 @@ _test-flag-PROG() {
"${test_in}" -o "${test_out}"
)
- 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.
- #
- # See also bug #712488 and bug #714742.
- cmdline+=( -Qunused-arguments )
- "${cmdline[@]}" &>/dev/null
- fi
+ "${cmdline[@]}" &>/dev/null
}
# @FUNCTION: test-flag-CC