commit:     d92f25030a8fad58d6472bb5a7a1661d07abfdc7
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 28 03:26:51 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 28 03:26:51 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d92f2503

media-radio/unixcw: fix build w/ qt-6.9 + LTO

Workaround for bug #957446#c16). Building via autotools requires a macro
like bitcoin or gpgme used in the past to ensure that -mno-direct-extern-access
is used if Qt itself was built with it.

The flag isn't in Qt's .pc files. It's easiest to just workaround this
with -fPIC, but in future, we might either have an eclass helper for this,
or just encourage people to use the m4 macro.

This refines the workaround from cebf7ed59e24ea1b6aa9b1d9bd7dee3d72ee56fb
as filtering LTO is a heavy hammer that we can avoid here. I hope to
come back to the ideas I mention above, though the priority of that depends
on how many others of these show up.

Closes: https://bugs.gentoo.org/957446
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-radio/unixcw/unixcw-3.6.1-r2.ebuild | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/media-radio/unixcw/unixcw-3.6.1-r2.ebuild 
b/media-radio/unixcw/unixcw-3.6.1-r2.ebuild
index 6024e2349eec..935375544d24 100644
--- a/media-radio/unixcw/unixcw-3.6.1-r2.ebuild
+++ b/media-radio/unixcw/unixcw-3.6.1-r2.ebuild
@@ -37,8 +37,15 @@ src_prepare() {
 }
 
 src_configure() {
-       # fails with -flto (see bug #957446)
-       filter-lto
+       # Workaround for bug #957446#c16. Building via autotools requires a
+       # macro like bitcoin or gpgme used in the past to ensure that
+       # -mno-direct-extern-access is used if Qt itself was built with it.
+       # The flag isn't in Qt's .pc files. It's easiest to just workaround
+       # this with -fPIC, but in future, we might either have an eclass helper
+       # for this, or just encourage people to use the m4 macro.
+       append-flags -fPIC
+       append-ldflags -fPIC
+
        econf --libdir="${EPREFIX}/usr/$(get_libdir)" \
                $(use_enable pulseaudio ) \
                $(use_enable alsa ) \

Reply via email to