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

gold-linked qt is incompatible with bfd ld

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.10.0
    • Fix Version/s: 5.13.0 Alpha 1
    • Component/s: Build System
    • Labels:
      None
    • Environment:
      g++ (SUSE Linux) 7.2.1 20171005 [gcc-7-branch revision 253439]

      GNU gold (GNU Binutils; openSUSE Leap 42.3 2.29.1) 1.14

       
    • Commits:
      7910dd0a548cdd9e7c5716d4f6704b3185fa34fb

      Description

      Compiling the wearable example is an easy way to reproduce triggering the following:

      g++ -Wl,-rpath,<...>/qt-5.10.0/install/lib -Wl,-rpath-link,<...>/qt-5.10.0/install/lib -o wearable wearable.o qrc_wearable.o   -L<...>/qt-5.10.0/install/lib -lQt5QuickControls2 -L<...>/sqlite-3.21.00.00/install/lib64 -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGL -lpthread 
      
      <...>/qt-5.10.0/install/lib/libQt5QuickTemplates2.so.5:(*IND*+0x0): multiple definition of `_edata'
      
      <...>/qt-5.10.0/install/lib/libQt5QuickTemplates2.so.5:(*IND*+0x0): multiple definition of `__bss_start'
      Makefile:251: recipe for target 'wearable' failed

      though we also run into the same issue with our own projects (where Qt v5.9.3 is working fine)

      see also closed ---QTBUG-63083--- ("This is most likely caused by use of gold linker with qt5 libs")

      readelf --syms qt-5.10.0/install/lib/libQt5QuickTemplates2.so | grep bss_start
       3385: 000000000012e468 0 NOTYPE GLOBAL DEFAULT 18 __bss_start@@Qt_5_PRIVATE_API
       3387: 000000000012e468 0 NOTYPE GLOBAL DEFAULT 18 __bss_start@Qt_5_PRIVATE_API
       5624: 000000000012e468 0 NOTYPE GLOBAL DEFAULT 18 __bss_start
       5626: 000000000012e468 0 NOTYPE GLOBAL DEFAULT 18 __bss_start
      
      readelf --syms qt-5.10.0/install/lib/libQt5QuickTemplates2.so | grep edata
       3384: 000000000012e468 0 NOTYPE GLOBAL DEFAULT 18 _edata@@Qt_5_PRIVATE_API
       3386: 000000000012e468 0 NOTYPE GLOBAL DEFAULT 18 _edata@Qt_5_PRIVATE_API
       5623: 000000000012e468 0 NOTYPE GLOBAL DEFAULT 18 _edata
       5625: 000000000012e468 0 NOTYPE GLOBAL DEFAULT 18 _edata
      

      it looks like not only QtQuickTemplate has this issue, I see the same in Core, DesignerComponents, EglFsKmsSupport, MultimediaGstTools, MultimediaQuick, QuickParticles, QuickTemplates2, XcbQpa)

      though it seems to be known issue with the gold linker (see also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852035), I can't help wondering why the qt v5.9.3 I rebuild as recent as two weeks ago (so 'most likely' using the same environment) shows these symbols as "NOTYPE GLOBAL DEFAULT ABS", so not relocatable, which is probably why the regular linker had no issues with that

      Compiling v5.10.0 with the option '-no-use-gold-linker' results in

      readelf --syms qt-5.10.0/install/lib/libQt5QuickTemplates2.so | grep bss_start
       2587: 000000000032f148 0 NOTYPE GLOBAL DEFAULT 27 __bss_start@@Qt_5_PRIVATE_API
       4251: 000000000032f148 0 NOTYPE GLOBAL DEFAULT 27 __bss_start

      The mentioned earlier qtbug focuses on yocto,

      We verified that for Qt libs built using the gold linker, both our own projects as well as the wearable example link fine when enforcing use of the gold linker by adding "QMAKE_LFLAGS += -fuse-ld=gold" to the project.

      I'm unsure whether the above is Qt's problem at all, though.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kkohne Kai Köhne
            Reporter:
            mr.gadgets Frank van Vugt
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes