Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.12, 6.4.2, 6.5
-
None
-
Linux with LLVM 16.0
-
-
8f8be55c1 (dev), bc85390dc (dev), be7d9022c (6.5), c31edaaff (tqtc/lts-6.2), d68dbd8b7 (dev), 08f3aa32b (dev), c9c94a201 (6.5), 03306d1d9 (6.5), f2055fa43 (tqtc/lts-5.15)
Description
Trying to build Qt with clang 16.0 (about to be released) and linking it with lld 16.0 results in
ld.lld: error: src/corelib/CMakeFiles/Core.dir/global/qversiontagging.cpp.o: symbol qt_version_tag@Qt_6.3 has undefined version Qt_6.3
ld.lld: error: src/corelib/CMakeFiles/Core.dir/global/qversiontagging.cpp.o: symbol qt_version_tag@Qt_6.4 has undefined version Qt_6.4
ld.lld: error: src/corelib/CMakeFiles/Core.dir/global/qversiontagging.cpp.o: symbol qt_version_tag@@Qt_6.5 has undefined version Qt_6.5
ld.lld: error: src/corelib/CMakeFiles/Core.dir/global/qversiontagging.cpp.o: symbol qt_version_tag@Qt_6.0 has undefined version Qt_6.0
ld.lld: error: src/corelib/CMakeFiles/Core.dir/global/qversiontagging.cpp.o: symbol qt_version_tag@Qt_6.1 has undefined version Qt_6.1
ld.lld: error: src/corelib/CMakeFiles/Core.dir/global/qversiontagging.cpp.o: symbol qt_version_tag@Qt_6.2 has undefined version Qt_6.2
ld.lld: error: lto.tmp: symbol qt_version_tag@@Qt_6.5 has undefined version Qt_6.5
for 6.x, and
ld.lld: error: version script assignment of 'Qt_5.15' to symbol 'qt_version_tag' failed: symbol not defined
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
for 5.x.
Part of the problem in 6.x is that the cmake check for ld version scripts is broken – it sets versions for the symbol sym and then tries to use that version script on a file providing only the symbol main. ld.bfd, ld.gold and older versions of lld swallow this, but lld 16.0 errors out saying it can't find the symbol sym.
After fixing that (patch attached), the build still fails because libQt6Concurrent.so.6.5.0's version script wants to assign version Qt_6.5 to qt_version_tag, but qt_version_tag is exported by libQt6Core rather than libQt6Concurrent.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-111514 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
480691,1 | Fix version script test | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |
462832,2 | CMake: provide the symbol "sym" which we're setting ELF versions for | dev | qt/qtbase | Status: ABANDONED | +2 | 0 |
462833,5 | CMake: Fix linkage with lld 16.0 | dev | qt/qtbase | Status: MERGED | +2 | 0 |
464936,1 | CMake: Fix linkage with lld 16.0 | 6.5.0 | qt/qtbase | Status: ABANDONED | 0 | 0 |
477684,6 | Fix version script test | dev | qt/qtbase | Status: MERGED | +2 | 0 |
478825,2 | Don't run version script test when its result won't be used | dev | qt/qtbase | Status: MERGED | +2 | 0 |
479125,2 | Don't run version script test when its result won't be used | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
479126,2 | Don't run version script test when its result won't be used | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
480191,5 | CMake: Add version tagging sources only if the linker supports it | dev | qt/qtbase | Status: MERGED | +2 | 0 |
480687,2 | Fix version script test | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
500709,2 | CMake: Fix linkage with lld 16.0 | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
501055,4 | Fix undefined symbol qt_version_tag with lld(16.0) for non core lib | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |