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 966661396D1 for ; Fri, 25 Aug 2017 13:53:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F2D5F1FC04A; Fri, 25 Aug 2017 13:53:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 D48A71FC04A for ; Fri, 25 Aug 2017 13:53:24 +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 EC09E3416AB for ; Fri, 25 Aug 2017 13:53:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9510F8230 for ; Fri, 25 Aug 2017 13:53:22 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1503669198.6f0e2e53c401a01ee8015e356699bbfb9d246e35.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/, eclass/tests/ 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: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 6f0e2e53c401a01ee8015e356699bbfb9d246e35 X-VCS-Branch: master Date: Fri, 25 Aug 2017 13:53:22 +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-Archives-Salt: 1d0382be-d40f-4ad5-9b16-d50a3eb8a739 X-Archives-Hash: fce0696879585c84b90525baa5dea26b commit: 6f0e2e53c401a01ee8015e356699bbfb9d246e35 Author: Michał Górny gentoo org> AuthorDate: Sat Jul 1 16:14:44 2017 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Aug 25 13:53:18 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f0e2e53 flag-o-matic.eclass: Strip LDFLAGS unsupported by the C compiler, #621274 Include LDFLAGS in the variables stripped by strip-unsupported-flags. The code reuses the current functions for testing CC, and so only remove LDFLAGS that are rejected by the C compiler and not the linker. This solves the case of bug #621274 where LDFLAGS contained GCC-specific -flto flag. eclass/flag-o-matic.eclass | 3 +++ eclass/tests/flag-o-matic.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 79866e04a48..4e3cfff5afd 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -546,6 +546,9 @@ strip-unsupported-flags() { export CXXFLAGS=$(test-flags-CXX ${CXXFLAGS}) export FFLAGS=$(test-flags-F77 ${FFLAGS}) export FCFLAGS=$(test-flags-FC ${FCFLAGS}) + # note: this does not verify the linker flags but it is enough + # to strip invalid C flags which are much more likely, #621274 + export LDFLAGS=$(test-flags-CC ${LDFLAGS}) } # @FUNCTION: get-flag diff --git a/eclass/tests/flag-o-matic.sh b/eclass/tests/flag-o-matic.sh index 5e7ee354bf3..53af9f862c4 100755 --- a/eclass/tests/flag-o-matic.sh +++ b/eclass/tests/flag-o-matic.sh @@ -55,7 +55,7 @@ done <<<" tbegin "strip-unsupported-flags" strip-unsupported-flags -[[ ${CFLAGS} == "" ]] && [[ ${CXXFLAGS} == "-z=2" ]] +[[ ${CFLAGS} == "" ]] && [[ ${CXXFLAGS} == "-z=2" ]] && [[ ${LDFLAGS} == "" ]] ftend for var in $(all-flag-vars) ; do