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

LTO causing QObject::connect to not find signals

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.5.1
    • Build System: CMake
    • None
    • gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9)
      Rocky Linux 8
    • Linux/X11

    Description

      While trying to fix the apitrace port to Qt6, I am encountering an issue with signal connections.

      QObject::connect is reporting that the signal cannot be found, for any connections made in the executable:

      qt.core.qobject.connect: QObject::connect: signal not found in QTimer
      

      I boiled down the issue to an interaction between a library which seems to have nothing in common with Qt - a small image library, which I removed almost all code from, and Qt.
      However, it only occurs if the following is set:

      set (CMAKE_INTERPROCEDURAL_OPTIMIZATION True)
      

      This enables link time optimization in the compiler if it is supported.
      If I remove this, signals work properly. 

      Attached is a minimal example reproducing the issue.
      I have tested it on Rocky Linux 8, with GCC 11.2.1.

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            kkyzivat Keith Kyzivat
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes