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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E3A16158041 for ; Sat, 9 Mar 2024 17:54:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2D40FE2A23; Sat, 9 Mar 2024 17:54:38 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 08A56E2A23 for ; Sat, 9 Mar 2024 17:54:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EC45C33BDF5 for ; Sat, 9 Mar 2024 17:54:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3F0701108 for ; Sat, 9 Mar 2024 17:54:35 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1710006809.33056c4e55b76cfdcee02c206acbfd770d7ae378.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/binutils/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/binutils/binutils-9999.ebuild X-VCS-Directories: sys-devel/binutils/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 33056c4e55b76cfdcee02c206acbfd770d7ae378 X-VCS-Branch: master Date: Sat, 9 Mar 2024 17:54:35 +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: bd15dd73-b116-4b1c-882a-3ff0abea288a X-Archives-Hash: c5503188915352567dc478e049fe22fc commit: 33056c4e55b76cfdcee02c206acbfd770d7ae378 Author: Sam James gentoo org> AuthorDate: Sat Mar 9 02:51:47 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sat Mar 9 17:53:29 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33056c4e sys-devel/binutils: rework LTO handling Get tests passing when LTO is used and rework USE=pgo handling while at it, as it's interlinked with LTO b/c of the upstream infra for it. This follows on from: * 1764651a4f7daf8d622db7fddeea891809cab2fb * f900949be85e2b2b21cd68b7f5163208d0429028 * f900949be85e2b2b21cd68b7f5163208d0429028 where I kept hitting misc issues where the build for the live ebuild failed with LTO or otherwise. With this, I only needed one patch to libctf's tests [0] which I've now pinged upstream. (I also had an odd single gprofng failure I haven't looked at yet.) * For LTO + (tests || pgo), always filter '-Wa,*'. This is an unfortunate one, but the bootstrap test fails with it. * USE=pgo no longer implies LTO. If -flto is being used, then we pass --enable-pgo-build=lto. If not, we pass --enable-pgo-build=yes. * For USE=pgo, filter out LTO after we applied the build system configuration, because otherwise there's a risk we're going to break the tests used for profiling. * In src_test, use a subshell to localise the filtering of flags we do. * For tests, pass {C,CXX,LD}FLAGS_FOR_TARGET to make, as otherwise it'll use what it found from configure (and e.g. pick up LTO again -> many tests fail as they're not intended to be used with it). [0] https://inbox.sourceware.org/binutils/87sf2evr35.fsf esperi.org.uk/ Signed-off-by: Sam James gentoo.org> sys-devel/binutils/binutils-9999.ebuild | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/sys-devel/binutils/binutils-9999.ebuild b/sys-devel/binutils/binutils-9999.ebuild index 9169e3ca712c..9b30843ce94f 100644 --- a/sys-devel/binutils/binutils-9999.ebuild +++ b/sys-devel/binutils/binutils-9999.ebuild @@ -333,10 +333,20 @@ src_configure() { ) fi + if use test || { use pgo && tc-is-lto ; } ; then + # -Wa,* needs to be consistent everywhere or lto-wrapper will complain + filter-flags '-Wa,*' + fi + if ! is_cross ; then - myconf+=( $(use_enable pgo pgo-build lto) ) + myconf+=( $(use_enable pgo pgo-build $(tc-is-lto && echo "lto" || echo "yes")) ) if use pgo ; then + # We let configure handle it for us because it has to run + # the testsuite later on for profiling, and LTO isn't compatible + # with the testsuite. + filter-lto + export BUILD_CFLAGS="${CFLAGS}" fi fi @@ -378,10 +388,24 @@ src_test() { local -x XZ_OPT="-T1" local -x XZ_DEFAULTS="-T1" - # bug #637066 - filter-flags -Wall -Wreturn-type + ( + # Tests don't expect LTO + filter-lto - emake -k check + # lto-wrapper warnings which confuse tests + filter-flags '-Wa,*' + + # bug #637066 + filter-flags -Wall -Wreturn-type + + emake -k check \ + CFLAGS_FOR_TARGET="${CFLAGS_FOR_TARGET:-${CFLAGS}}" \ + CXXFLAGS_FOR_TARGET="${CXXFLAGS_FOR_TARGET:-${CXXFLAGS}}" \ + LDFLAGS_FOR_TARGET="${LDFLAGS_FOR_TARGET:-${LDFLAGS}}" \ + CFLAGS="${CFLAGS}" \ + CXXFLAGS="${CXXFLAGS}" \ + LDFLAGS="${LDFLAGS}" + ) } src_install() {