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

Crash on mac with Qt 5.x static linking

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.0
    • 5.0.0, 5.1.0 , 5.1.1
    • Quick: Controls 1
    • None
    • Mac OS X 10.9 GM
    • macOS
    • 4ce2c0310c55c78b783b79c1f3fa2e0aa40fe6a2

    Description

      We have been struggling to make qt run with static linking on mac machines and figured out that there is a name clash in qt quick core. Namely, two objects are named QQuickAction, which causes confusion for the clang compiler in a way that it uses the wrong destructor for these objects, hence the crash.
      One way to reproduce would be:
      Make a simple one page qml application and use QtQuick Action in the qml

      Files that need to be checked are:
      qtdeclarative/src/quick/util/qquickstate.cpp
      qtquickcontrols/src/controls/qquickaction.cpp

      After trying to figure out what the issue was, we added a destructor for one of the QQuickAction classes, now we have the following linker output:

      duplicate symbol __ZN12QQuickActionD1Ev in:
          /Users/vid/.islcc/qt-5.1.1-1-debug-static-a793f3504532ac5d383c13a208127eae/qml/QtQuick/Controls/libqtquickcontrolsplugin_debug.a(qquickaction.o)
          /Users/vid/.islcc/qt-5.1.1-1-debug-static-a793f3504532ac5d383c13a208127eae/lib/libQt5Quick_debug.a(qquickstate.o)
      duplicate symbol __ZN12QQuickActionD2Ev in:
          /Users/vid/.islcc/qt-5.1.1-1-debug-static-a793f3504532ac5d383c13a208127eae/qml/QtQuick/Controls/libqtquickcontrolsplugin_debug.a(qquickaction.o)
          /Users/vid/.islcc/qt-5.1.1-1-debug-static-a793f3504532ac5d383c13a208127eae/lib/libQt5Quick_debug.a(qquickstate.o)
      ld: 2 duplicate symbols for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      

      Attachments

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

        Activity

          People

            bachewii Jens
            tadelv Vid
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes