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

QPA static plugin fails to load when built with LTO as part of KWin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Out of scope
    • Affects Version/s: 5.15.2
    • Fix Version/s: None
    • Component/s: Core: Plugins, QPA: Wayland
    • Labels:
      None
    • Environment:
      Linux/KDE Plasma: Arch Linux / KDE 5.22.5
      (available in About System)
      KDE Plasma Version: 5.22.5
      KDE Frameworks Version: 5.86.0
      Qt Version: 5.15.2
      Compiler: Clang
      Linker: LLD
    • Platform/s:
      Linux/Wayland

      Description

      When KWin is built with LTO and Clang (I don't know if GCC or ThinLTO also has this issue, I didn't test them), when attempting to start KWin or Plasma (kwin_wayland, startplasma-wayland etc.) the QPA static plugin will fail to load with an error message like this:

      qt.qta.plugin: could not load the Qt platform plugin "wayland-org.kde.kwin.qpa" in "" even though it was found.
      
      This application failed to start because no Qt platform plugin could be initialized. reinstalling the application may fix this problem
      

      This issue doesn't happen, with the exact same software, hardware and compiler/compiler flags, if KWin is built without LTO, and KWin starts without any errors or issues.

      Steps to reproduce:
      1. Compile KWin with Clang and -flto=full
      2. Attempt to start it
      3. Watch as it fails to load the required QT Plugin

       

      Compiler flags:

      -march=native -O3 --ld-path=/usr/bin/ld.lld -feliminate-unused-debug-types -pipe -fexceptions -w -mbranches-within-32B-boundaries -lmimalloc --param=ssp-buffer-size=32 -m64 -D_FORTIFY_SOURCE=2 -fno-semantic-interposition -flto=full -fvirtual-function-elimination -fwhole-program-vtables

      (Note that the extra flags aren't the issue, a very short list of flags of only "-O2 -flto=full" will fail in the exact same way.)

      Configuration command:

      cmake -B build -S kwin-5.22.5 \
       -DCMAKE_INSTALL_LIBEXECDIR=lib \
       -DBUILD_TESTING=OFF

      Compilation command:

      cmake --build build

      Packaging command:

      DESTDIR="$pkgdir" cmake --install build

        Attachments

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

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            sattaxt Sat Taxt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes