Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 915203

Summary: dev-qt/*-5.15.10: fails to link with clang-17: ld.lld: error: version script assignment of 'Qt_5.15' to symbol 'qt_version_tag' failed: symbol not defined
Product: Gentoo Linux Reporter: ppw0
Component: Current packagesAssignee: Qt Bug Alias <qt>
Status: RESOLVED FIXED    
Severity: normal CC: ajak, asturm, marc_heimann, sam, toralf
Priority: Normal Keywords: PullRequest, UPSTREAM
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://bugreports.qt.io/browse/QTBUG-111514
See Also: https://bugs.gentoo.org/show_bug.cgi?id=914460
https://github.com/gentoo/gentoo/pull/33302
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 912821    
Attachments: build log
emerge --info

Description ppw0 2023-10-05 10:46:06 UTC
Created attachment 872160 [details]
build log

In a clang-17[default-libcxx] environment, dev-qt/qtgui-5.15.10-r2 will fail to link during emerge with the following error message:
```
ld.lld: error: version script assignment of 'Qt_5.15' to symbol 'qt_version_tag' failed: symbol not defined
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:1292: ../../lib/libQt5Gui.so.5.15.10] Error 1
```

This can be avoided by passing "-Wl,--undefined-version" to LDFLAGS.

Attaching logs.
Comment 1 ppw0 2023-10-05 10:46:25 UTC
Created attachment 872161 [details]
emerge --info
Comment 2 Andreas Sturmlechner gentoo-dev 2023-10-07 15:08:35 UTC
*** Bug 915201 has been marked as a duplicate of this bug. ***
Comment 3 Andreas Sturmlechner gentoo-dev 2023-10-07 15:08:44 UTC
*** Bug 915204 has been marked as a duplicate of this bug. ***
Comment 4 Andreas Sturmlechner gentoo-dev 2023-10-07 15:08:52 UTC
*** Bug 915206 has been marked as a duplicate of this bug. ***
Comment 5 Andreas Sturmlechner gentoo-dev 2023-10-07 15:09:05 UTC
*** Bug 915202 has been marked as a duplicate of this bug. ***
Comment 6 Andreas Sturmlechner gentoo-dev 2023-10-07 15:09:14 UTC
*** Bug 915091 has been marked as a duplicate of this bug. ***
Comment 7 Andreas Sturmlechner gentoo-dev 2023-10-07 15:09:24 UTC
*** Bug 915089 has been marked as a duplicate of this bug. ***
Comment 8 Andreas Sturmlechner gentoo-dev 2023-10-07 15:11:09 UTC
(In reply to Mark Wright from bug 915201)
> (In reply to ppw0)
> 
> Thanks for reporting.
> 
> > This can be avoided by passing "-Wl,--undefined-version" to LDFLAGS.
> 
> Thanks, creating a file in /etc/portage/env with those flags:
> 
> # cat /etc/portage/env/Wl--undefined-version 
> LDFLAGS="${LDFLAGS} -Wl,--undefined-version"
> # 
> 
> and adding a line to /etc/portage/package.env to use this file:
> 
> dev-qt/* Wl--undefined-version
> 
> allows dev-qt/qtdbus-5.15.10 to build with sys-devel/clang-17.0.2 and
> sys-devel/lld-17.0.1.
> 
> FreeBSD has a workaround here:
> 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273992
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-08 03:25:25 UTC
I suspect we should add that workaround into the eclass. I don't imagine any proper fix is coming any time soon and I don't plan on working on it myself (other than perhaps the workaround).
Comment 10 sineer 2023-10-10 14:13:59 UTC
Thanks for the work-around!

I had same issue building qtnetworking with clang-17 and "-Wl,--undefined-version" fixed it.
Comment 11 Larry the Git Cow gentoo-dev 2023-10-15 15:23:25 UTC
The bug has been referenced in the following commit(s):

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

commit adb049350a5d4b15b5ee19739d9f2baed83f6acf
Author:     Alfred Wingate <parona@protonmail.com>
AuthorDate: 2023-10-11 12:30:44 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-10-15 15:22:41 +0000

    qt5-build.eclass: workaround undefined qt_version_tag (LLD 17)
    
    Bug: https://bugreports.qt.io/browse/QTBUG-111514
    Bug: https://bugs.gentoo.org/915203
    Signed-off-by: Alfred Wingate <parona@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/33302
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/qt5-build.eclass | 6 ++++++
 1 file changed, 6 insertions(+)
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-15 15:24:59 UTC
I don't really see the point in keeping this open so closing as fixed (applied workaround). In a year or so, we'll get the Qt 5 fix and it'll propagate down into Qt5PatchCollection naturally.
Comment 13 Larry the Git Cow gentoo-dev 2023-10-15 20:00:59 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/qt.git/commit/?id=8138d7bc836b35dd42df44f829dcd518f03a4e64

commit 8138d7bc836b35dd42df44f829dcd518f03a4e64
Author:     Alfred Wingate <parona@protonmail.com>
AuthorDate: 2023-10-11 12:30:44 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2023-10-15 20:00:37 +0000

    qt5-build.eclass: workaround undefined qt_version_tag (LLD 17)
    
    Bug: https://bugreports.qt.io/browse/QTBUG-111514
    Bug: https://bugs.gentoo.org/915203
    Signed-off-by: Alfred Wingate <parona@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/33302
    Signed-off-by: Sam James <sam@gentoo.org>
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 eclass/qt5-build.eclass | 6 ++++++
 1 file changed, 6 insertions(+)
Comment 14 Larry the Git Cow gentoo-dev 2023-10-18 06:44:48 UTC
The bug has been referenced in the following commit(s):

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

commit a18de479c55e6a3f1a2400a1ddebef3eaad1ab30
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-10-18 06:43:45 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-10-18 06:44:13 +0000

    qt5-build.eclass: guard -Wl,--undefined-version with tc-ld-is-lld
    
    Older binutils doesn't support this flag, so just guard it to make life
    easier for people.
    
    Bug: https://bugs.gentoo.org/915203
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/qt5-build.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 15 Andreas Sturmlechner gentoo-dev 2023-10-20 12:24:21 UTC
Fix was merged in Qt Company 5.15 upstream branch. Now we've got to wait just for 1 year...
Comment 16 Andreas Sturmlechner gentoo-dev 2023-11-12 23:04:54 UTC
*** Bug 914861 has been marked as a duplicate of this bug. ***
Comment 17 Andreas Sturmlechner gentoo-dev 2023-11-12 23:06:34 UTC
*** Bug 914858 has been marked as a duplicate of this bug. ***