diff options
author | Sam James <sam@gentoo.org> | 2024-03-09 21:54:27 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-03-09 21:55:18 +0000 |
commit | 68466c8b5bda1cbf82e364763c42c7c9df1dfff0 (patch) | |
tree | 890742854bba8b06bc8b984cbfa7a8c05b629d58 /sys-devel | |
parent | media-libs/pulseaudio-qt: Add missing media-libs/libpulse[glib] USEdep (diff) | |
download | gentoo-68466c8b5bda1cbf82e364763c42c7c9df1dfff0.tar.gz gentoo-68466c8b5bda1cbf82e364763c42c7c9df1dfff0.tar.bz2 gentoo-68466c8b5bda1cbf82e364763c42c7c9df1dfff0.zip |
sys-devel/binutils: backport LTO fixes to 2.42-r1
From 33056c4e55b76cfdcee02c206acbfd770d7ae378.
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/binutils/binutils-2.42-r1.ebuild | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/sys-devel/binutils/binutils-2.42-r1.ebuild b/sys-devel/binutils/binutils-2.42-r1.ebuild index 247aaaa1fa03..a7bca7df85af 100644 --- a/sys-devel/binutils/binutils-2.42-r1.ebuild +++ b/sys-devel/binutils/binutils-2.42-r1.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() { |