Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 957446 - media-radio/unixcw-3.6.1-r1: fails to build (copy relocation against non-copyable protected symbol `_ZN16QCoreApplication4selfE@@Qt_6' in /usr/lib/gcc/x86_64-pc-linux-gnu/16/../../../../lib64/libQt6Core.so)
Summary: media-radio/unixcw-3.6.1-r1: fails to build (copy relocation against non-copy...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Thomas Beierlein
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto qt-6.9
  Show dependency tree
 
Reported: 2025-06-07 10:07 UTC by Toralf Förster
Modified: 2025-06-28 03:28 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,20.30 KB, text/plain)
2025-06-07 10:07 UTC, Toralf Förster
Details
emerge-history.txt.xz (emerge-history.txt.xz,59.27 KB, application/x-xz)
2025-06-07 10:07 UTC, Toralf Förster
Details
environment (environment,54.53 KB, text/plain)
2025-06-07 10:07 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,1.63 KB, application/x-xz)
2025-06-07 10:07 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,28.91 KB, application/x-xz)
2025-06-07 10:07 UTC, Toralf Förster
Details
logs.tar.xz (logs.tar.xz,11.54 KB, application/x-xz)
2025-06-07 10:07 UTC, Toralf Förster
Details
media-radio:unixcw-3.6.1-r1:20250607-100430.log (media-radio:unixcw-3.6.1-r1:20250607-100430.log,80.09 KB, text/plain)
2025-06-07 10:07 UTC, Toralf Förster
Details
qlist-info.txt.xz (qlist-info.txt.xz,69.26 KB, application/x-xz)
2025-06-07 10:07 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,16.72 KB, application/x-xz)
2025-06-07 10:08 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2025-06-07 10:07:51 UTC
    inlined from 'cw_getline' at ../cwutils/cw_common.c:322:23,
    inlined from 'cw_dictionaries_create_from_stream' at ../cwutils/dictionary.c:476:9:
/usr/include/bits/stdio2.h:316:12: warning: call to '__fgets_chk_warn' declared with attribute warning: fgets called with bigger size than length of destination buffer [-Wattribute-warning]
  316 |     return __fgets_chk_warn (__s, __sz, __n, __stream);
      |            ^
/usr/lib/gcc/x86_64-pc-linux-gnu/16/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/media-radio/unixcw-3.6.1-r1/temp/ccqdZGkc.ltrans0.ltrans.o: copy relocation against non-copyable protected symbol `_ZN16QCoreApplication4selfE@@Qt_6' in /usr/lib/gcc/x86_64-pc-linux-gnu/16/../../../../lib64/libQt6Core.so
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:514: xcwcp] Error 1 shuffle=3664312369
make[3]: Leaving directory '/var/tmp/portage/media-radio/unixcw-3.6.1-r1/work/unixcw-3.6.1/src/xcwcp'

  -------------------------------------------------------------------
  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 23.0_desktop_systemd-20250602-160530

  KEYWORDED/UNMASKED

  
  <sys-devel/gcc-16.0.9999:16

  Block bug #351559 if this looks like a parallel build issue.
  Possible reproducer: MAKEOPTS='...  shuffle=3664312369'

  The attached etc.portage.tar.xz has all details.
  -------------------------------------------------------------------

GNUMAKEFLAGS="$GNUMAKEFLAGS --shuffle"
gcc-config -l:
 [1] x86_64-pc-linux-gnu-16 *
clang version 20.1.6
llvm-config: 20.1.6
Python 3.13.4
go version go1.24.3 linux/amd64
  [1]   php8.2
  [2]   php8.4 *
Available Ruby profiles:
  [1]   ruby32 (with Rubygems)
  [2]   ruby33 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.77.1
  [2]   rust-bin-1.86.0
  [3]   rust-bin-1.87.0 *
The following VMs are available for generation-2:
1)	Eclipse Temurin JDK 11.0.27_p6 [openjdk-bin-11]
2)	Eclipse Temurin JDK 17.0.15_p6 [openjdk-bin-17]
*)	Eclipse Temurin JDK 21.0.7_p6 [openjdk-bin-21]
4)	Eclipse Temurin JDK 8.452_p09 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8 
  [2]   openjdk-bin-11 
  [3]   openjdk-bin-17 
  [4]   openjdk-bin-21  system-vm

  HEAD of ::gentoo
commit 08a7b22b5680070d126208a344bae2898a7c477c
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Sat Jun 7 09:39:24 2025 +0000

    2025-06-07 09:39:23 UTC

The tinderbox task was: media-radio/unixcw

emerge -qpvO =media-radio/unixcw-3.6.1-r1
[ebuild  N    ] media-radio/unixcw-3.6.1-r1  USE="alsa pulseaudio qt6 -ncurses -suid -test"
Comment 1 Toralf Förster gentoo-dev 2025-06-07 10:07:52 UTC
Created attachment 931298 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2025-06-07 10:07:53 UTC
Created attachment 931299 [details]
emerge-history.txt.xz
Comment 3 Toralf Förster gentoo-dev 2025-06-07 10:07:54 UTC
Created attachment 931300 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2025-06-07 10:07:55 UTC
Created attachment 931301 [details]
etc.clang.tar.xz
Comment 5 Toralf Förster gentoo-dev 2025-06-07 10:07:56 UTC
Created attachment 931302 [details]
etc.portage.tar.xz
Comment 6 Toralf Förster gentoo-dev 2025-06-07 10:07:57 UTC
Created attachment 931303 [details]
logs.tar.xz
Comment 7 Toralf Förster gentoo-dev 2025-06-07 10:07:58 UTC
Created attachment 931304 [details]
media-radio:unixcw-3.6.1-r1:20250607-100430.log
Comment 8 Toralf Förster gentoo-dev 2025-06-07 10:07:59 UTC
Created attachment 931305 [details]
qlist-info.txt.xz
Comment 9 Toralf Förster gentoo-dev 2025-06-07 10:08:00 UTC
Created attachment 931306 [details]
temp.tar.xz
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-06-08 03:33:16 UTC
```
/bin/sh ../../libtool  --tag=CXX   --mode=link x86_64-pc-linux-gnu-g++  -O2 -pipe -march=native -fno-diagnostics-color -Werror=lto-type-mismatch -Werror=strict-aliasing -Werror=odr -flto  -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--defsym=__gentoo_check_ldflags__=0 -Werror=lto-type-mismatch -Werror=strict-aliasing -Werror=odr -flto -o xcwcp xcwcp-application.o xcwcp-textarea.o xcwcp-main.o xcwcp-modeset.o xcwcp-receiver.o xcwcp-sender.o xcwcp-moc_application.o ../../src/cwutils/lib_xcwcp.a -L../../src/libcw/.libs -lcw -lQt6Widgets -lQt6Gui -lQt6Core -lpthread   -lpthread -lm 
libtool: link: x86_64-pc-linux-gnu-g++ -O2 -pipe -march=native -fno-diagnostics-color -Werror=lto-type-mismatch -Werror=strict-aliasing -Werror=odr -flto -Wl,-O1 -Wl,-z -Wl,pack-relative-relocs -Wl,--defsym=__gentoo_check_ldflags__=0 -Werror=lto-type-mismatch -Werror=strict-aliasing -Werror=odr -flto -o .libs/xcwcp xcwcp-application.o xcwcp-textarea.o xcwcp-main.o xcwcp-modeset.o xcwcp-receiver.o xcwcp-sender.o xcwcp-moc_application.o  -Wl,--as-needed ../../src/cwutils/lib_xcwcp.a -L../../src/libcw/.libs /var/tmp/portage/media-radio/unixcw-3.6.1-r1/work/unixcw-3.6.1/src/libcw/.libs/libcw.so -ldl -lQt6Widgets -lQt6Gui -lQt6Core -lpthread -lm
In function 'fgets',
    inlined from 'cw_getline' at ../cwutils/cw_common.c:322:23,
    inlined from 'cw_dictionaries_create_from_stream' at ../cwutils/dictionary.c:476:9:
/usr/include/bits/stdio2.h:313:12: warning: '__fgets_alias' writing 8193 bytes into a region of size 8192 overflows the destination [-Wstringop-overflow=]
  313 |     return __fgets_alias (__s, __n, __stream);
      |            ^
In function 'safe_malloc',
    inlined from 'cw_dictionaries_create_from_stream' at ../cwutils/dictionary.c:468:15:
../cwutils/memory.c:52:13: note: destination object of size 8192 allocated by 'malloc'
   52 |   pointer = malloc (size);
      |             ^
/usr/include/bits/stdio2-decl.h: In function 'cw_dictionaries_create_from_stream':
/usr/include/bits/stdio2-decl.h:96:14: note: in a call to function '__fgets_alias' declared with attribute 'access (write_only, 1, 2)'
   96 | extern char *__REDIRECT (__fgets_alias,
      |              ^
In function 'fgets',
    inlined from 'cw_getline' at ../cwutils/cw_common.c:322:23,
    inlined from 'cw_dictionaries_create_from_stream' at ../cwutils/dictionary.c:476:9:
/usr/include/bits/stdio2.h:318:10: warning: '__fgets_chk' writing 8193 bytes into a region of size 8192 overflows the destination [-Wstringop-overflow=]
  318 |   return __fgets_chk (__s, __sz, __n, __stream);
      |          ^
In function 'safe_malloc',
    inlined from 'cw_dictionaries_create_from_stream' at ../cwutils/dictionary.c:468:15:
../cwutils/memory.c:52:13: note: destination object of size 8192 allocated by 'malloc'
   52 |   pointer = malloc (size);
      |             ^
/usr/include/bits/stdio2-decl.h: In function 'cw_dictionaries_create_from_stream':
/usr/include/bits/stdio2-decl.h:106:14: note: in a call to function '__fgets_chk' declared with attribute 'access (write_only, 1, 3)'
  106 | extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
      |              ^
In function 'fgets',
    inlined from 'cw_getline' at ../cwutils/cw_common.c:322:23,
    inlined from 'cw_dictionaries_create_from_stream' at ../cwutils/dictionary.c:476:9:
/usr/include/bits/stdio2.h:316:12: warning: call to '__fgets_chk_warn' declared with attribute warning: fgets called with bigger size than length of destination buffer [-Wattribute-warning]
  316 |     return __fgets_chk_warn (__s, __sz, __n, __stream);
      |            ^
/usr/lib/gcc/x86_64-pc-linux-gnu/16/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/media-radio/unixcw-3.6.1-r1/temp/ccqdZGkc.ltrans0.ltrans.o: copy relocation against non-copyable protected symbol `_ZN16QCoreApplication4selfE@@Qt_6' in /usr/lib/gcc/x86_64-pc-linux-gnu/16/../../../../lib64/libQt6Core.so
collect2: error: ld returned 1 exit status
```

Interesting.
Comment 11 Larry the Git Cow gentoo-dev 2025-06-08 03:43:24 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa0f913f7ea47a69bddbcba472b4e4023113de1d

commit fa0f913f7ea47a69bddbcba472b4e4023113de1d
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-06-08 03:41:54 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-06-08 03:42:54 +0000

    media-radio/unixcw: fix build w/ non-bash
    
    += is a bashism so if configure is run w/ non-bash, we end up adding
    no include paths. Noticed when looking at the linked bug.
    
    Bug: https://bugs.gentoo.org/957446
    Signed-off-by: Sam James <sam@gentoo.org>

 media-radio/unixcw/files/unixcw-3.6.1-qt6-build.patch | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-06-08 03:43:44 UTC
Looking into the actual toralf issue now. I think it's because it's partly built as -fPIC but not sure yet.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-06-08 03:47:28 UTC
(In reply to Sam James from comment #12)
> Looking into the actual toralf issue now. I think it's because it's partly
> built as -fPIC but not sure yet.

Qt's pkgconfig files don't include -mno-direct-extern-access :(
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-06-08 03:52:12 UTC
(In reply to Sam James from comment #13)
> (In reply to Sam James from comment #12)
> > Looking into the actual toralf issue now. I think it's because it's partly
> > built as -fPIC but not sure yet.
> 
> Qt's pkgconfig files don't include -mno-direct-extern-access :(

The problem is that Clang doesn't support that option (they use -fno-direct-access-external-data instead).
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-06-08 03:53:24 UTC
Not sure if we want to have some helper in an eclass for this, or if there's some trick that would allow us to do something in .pc files. Or maybe we just have to take the same approach gpgme did.
Comment 17 Ionen Wolkens gentoo-dev 2025-06-08 05:10:49 UTC
fwiw I'd imagine it's not that widespread, I don't think that many packages use Qt with pkgconf, it's almost all either qmake or cmake.
Comment 18 Ionen Wolkens gentoo-dev 2025-06-08 05:15:11 UTC
(In reply to Ionen Wolkens from comment #17)
> fwiw I'd imagine it's not that widespread, I don't think that many packages
> use Qt with pkgconf, it's almost all either qmake or cmake.

...but if we want this to be simpler downstream, eclass helper would sound nice to me.

Can't think of .pc-only solution without breaking things.
Comment 19 Thomas Beierlein gentoo-dev 2025-06-14 17:01:40 UTC
Sorry, cannot reproduce it here. Any idea how to provoke it?
Comment 20 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-06-14 17:04:38 UTC
(In reply to Thomas Beierlein from comment #19)
> Sorry, cannot reproduce it here. Any idea how to provoke it?

You'll need Qt 6.9 (only in ~arch) and _maybe_ LTO. Make sure to build with GCC and bfd (standard binutils linker) as well.
Comment 21 Thomas Beierlein gentoo-dev 2025-06-15 13:16:49 UTC
(In reply to Sam James from comment #20)
> (In reply to Thomas Beierlein from comment #19)
> > Sorry, cannot reproduce it here. Any idea how to provoke it?
> 
> You'll need Qt 6.9 (only in ~arch) and _maybe_ LTO. Make sure to build with
> GCC and bfd (standard binutils linker) as well.

Thanks. -flto was missing.
Comment 22 Larry the Git Cow gentoo-dev 2025-06-15 13:29:18 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cebf7ed59e24ea1b6aa9b1d9bd7dee3d72ee56fb

commit cebf7ed59e24ea1b6aa9b1d9bd7dee3d72ee56fb
Author:     Thomas Beierlein <tomjbe@gentoo.org>
AuthorDate: 2025-06-15 13:27:56 +0000
Commit:     Thomas Beierlein <tomjbe@gentoo.org>
CommitDate: 2025-06-15 13:29:00 +0000

    media-radio/unixcw: Add filter-lto to forbid link time optimization
    
    Closes: https://bugs.gentoo.org/957446
    Signed-off-by: Thomas Beierlein <tomjbe@gentoo.org>

 media-radio/unixcw/{unixcw-3.6.1-r1.ebuild => unixcw-3.6.1-r2.ebuild} | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 23 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-06-20 06:32:56 UTC
It's a workaround but not a fix. It could happen even w/o LTO. We need to figure out some nice way of handling this for projects not using CMake w/ Qt. We already have bug 957962 as another example.

To be clear though: I don't expect you as the maintainer to do anything more here unless you want to.
Comment 24 Larry the Git Cow gentoo-dev 2025-06-28 03:28:50 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d92f25030a8fad58d6472bb5a7a1661d07abfdc7

commit d92f25030a8fad58d6472bb5a7a1661d07abfdc7
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-06-28 03:26:51 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-06-28 03:26:51 +0000

    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@gentoo.org>

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

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72b156d25cbdc0b86d2c937368e722ad420f6ac1

commit 72b156d25cbdc0b86d2c937368e722ad420f6ac1
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-06-28 03:20:38 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-06-28 03:21:36 +0000

    x11-misc/spnavcfg: fix build w/ qt-6.9 (with LTO, at least)
    
    Workaround for bug #957962 (and 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.
    
    Bug: https://bugs.gentoo.org/957446
    Closes: https://bugs.gentoo.org/957962
    Signed-off-by: Sam James <sam@gentoo.org>

 x11-misc/spnavcfg/spnavcfg-1.3.ebuild | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)