From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 24E0C138350 for ; Thu, 26 Mar 2020 07:51:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5DB1FE0B9D; Thu, 26 Mar 2020 07:51:14 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 34576E0B9D for ; Thu, 26 Mar 2020 07:51:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 60ED334F751 for ; Thu, 26 Mar 2020 07:51:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7835D172 for ; Thu, 26 Mar 2020 07:51:08 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1585209041.a5003d48705fa9b501022d4e6326c8f516a2eec0.slyfox@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/tests/, eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/flag-o-matic.eclass eclass/tests/flag-o-matic.sh X-VCS-Directories: eclass/tests/ eclass/ X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: a5003d48705fa9b501022d4e6326c8f516a2eec0 X-VCS-Branch: master Date: Thu, 26 Mar 2020 07:51:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 2ade2b84-a910-46af-8342-d1a19b9a930d X-Archives-Hash: 15eceb764945daaa3da6e182100be972 commit: a5003d48705fa9b501022d4e6326c8f516a2eec0 Author: Sergei Trofimovich gentoo org> AuthorDate: Thu Mar 26 07:49:07 2020 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Thu Mar 26 07:50:41 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5003d48 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 gentoo.org> eclass/flag-o-matic.eclass | 19 +++++++++++-------- eclass/tests/flag-o-matic.sh | 10 ++++------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index d8111fb9e38..9ef9ac3685e 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 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 diff --git a/eclass/tests/flag-o-matic.sh b/eclass/tests/flag-o-matic.sh index 6dfacb04c07..229dff52af9 100755 --- a/eclass/tests/flag-o-matic.sh +++ b/eclass/tests/flag-o-matic.sh @@ -161,12 +161,10 @@ out=$(CC=clang test-flags-CC -finvalid-flag) [[ $? -ne 0 && -z ${out} ]] ftend -### '-finline-limit=1200' is 'ignored' flag, not invalid. -### We don't filter out ignored flags currently, bug #712488 -#tbegin "test-flags-CC (gcc-valid but clang-invalid flags)" -#out=$(CC=clang test-flags-CC -finline-limit=1200) -#[[ $? -ne 0 && -z ${out} ]] -#ftend +tbegin "test-flags-CC (gcc-valid but clang-invalid flags)" +out=$(CC=clang test-flags-CC -finline-limit=1200) +[[ $? -ne 0 && -z ${out} ]] +ftend tbegin "test-flags-CC (unused flags w/clang)" out=$(CC=clang test-flags-CC -Wl,-O1)