Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.15.2
-
None
-
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
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