Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915203 - 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
Summary: dev-qt/*-5.15.10: fails to link with clang-17: ld.lld: error: version script ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL: https://bugreports.qt.io/browse/QTBUG...
Whiteboard:
Keywords: PullRequest, UPSTREAM
: 914858 914861 915089 915091 915201 915202 915204 915206 (view as bug list)
Depends on:
Blocks: 912821
  Show dependency tree
 
Reported: 2023-10-05 10:46 UTC by ppw0
Modified: 2023-11-12 23:06 UTC (History)
5 users (show)

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


Attachments
build log (dev-qt:qtgui-5.15.10-r2:20231005-102650.log.gz,30.60 KB, application/gzip)
2023-10-05 10:46 UTC, ppw0
Details
emerge --info (emerge_info.log,7.38 KB, text/x-log)
2023-10-05 10:46 UTC, ppw0
Details

Note You need to log in before you can comment on or make changes to this bug.
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. ***