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

qtdiag cannot be executed in static builds

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.4.2, 6.7.0 RC
    • Build System: CMake
    • None
    • Linux/X11

    Description

      I am building Qt statically. For debugging, I needed to run qtdiag. Running qtdiag failed with:

      qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
      This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Aborted (core dumped)
      

      This happens because the platform plugins are built statically but have not been linked statically into qtdiag.

      I did grep for qt_import_plugins in order to see whether at least some of the tools are linked correctly during static builds. I found that qhelpgenerator does call it. I have copy-pasted the code from qt-everywhere-src-6.4.2/qttools/src/assistant/qhelpgenerator/CMakeLists.txt into qt-everywhere-src-6.4.2/qttools/src/qtdiag/CMakeLists.txt and adjusted it as required.

      I have attached a patch created with diff -u. I have also attached the EasyBuild recipe that I am currently working on. It contains all configure options.

      Imho, this large chunk of code should be a CMake macro and then should be called for all executable targets to make them work when Qt is compiled with -static.

      Attachments

        1. Qt6.eb
          4 kB
        2. qtdiag-static.patch
          2 kB
        For Gerrit Dashboard: QTBUG-111988
        # Subject Branch Project Status CR V

        Activity

          People

            semlanik Alexey Edelev
            lqbnfiwbe Maximilian Knespel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change