Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-111514

QtCore fails to link with lld 16.0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.12, 6.4.2, 6.5
    • Core: Other
    • None
    • Linux with LLVM 16.0
    • Linux/Wayland, Linux/X11, Linux/Yocto, Linux/Other display system
    • 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

        For Gerrit Dashboard: QTBUG-111514
        # Subject Branch Project Status CR V

        Activity

          People

            Unassigned Unassigned
            bero Bernhard Rosenkränzer
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: