SUMMARY When KWin is compiled with Clang and Full LTO (I don't know if ThinLTO or GCC doesn't exhibit this issue, I didn't test it), kwin_wayland or any other attemps to start Plasma will fail with an error message something 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 doesn't happen on the exact same machine, with the exact same software versions, if KWin is built without LTO (other optimizations such as -O3 or -march doesn't seem to affect this issue at all), it works perfectly. 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 OBSERVED RESULT Error message inserted above when starting KWin EXPECTED RESULT Kwin starting without errors SOFTWARE/OS VERSIONS 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 ADDITIONAL INFORMATION I selected 5.22.4 on the Component section because there is no option for 5.22.5
Please remove KWinQpaPlugin.so in your filesystem.
If the bug is still reproducible, please re-open the bug report.
(In reply to Vlad Zahorodnii from comment #2) > If the bug is still reproducible, please re-open the bug report. I do not seem to have this file in my system, as "fd --glob "KWinQpaPlugin.so*" /usr /lib /home /etc /dev /boot /var /lib64" returns no results. Reopening.
Okay. does plasma start if kwin is compiled without LTO?
argh, nvm "if KWin is built without LTO". this seems like a bug worth reporting to Qt developers
"wayland-org.kde.kwin.qpa" is a static plugin, i.e. it's compiled into kwin binary. If static plugins don't work with LTO, it's probably worth reporting to Qt developers.
Alright, I'll do that. By QT developers, I'm assuming you mean upstream QT?
Yeah, but it will help a lot to move the bug report progress forward if a minimal demo app is provided. Saying that kwin's qpa static plugin can't be loaded when kwin is compiled with LTO is fine, but it's more convenient to have a demo app.
Can you provide some more precise information and your command to build kwin that exhibits the issue?
(In reply to David Edmundson from comment #9) > Can you provide some more precise information and your command to build kwin > that exhibits the issue? I will provide my compiler flags and the command to actually build KWin below: 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" Pre-build command: cmake -B build -S kwin-5.22.5 \ -DCMAKE_INSTALL_LIBEXECDIR=lib \ -DBUILD_TESTING=OFF Build command: cmake --build build Packaging command: DESTDIR="$pkgdir" cmake --install build My long list of flags may seem suspect, but it's worth stressing they're not causing the issue. To test this, I tried a build of KWin *only* with -O2 and LTO (without any of the more advanced LTO optimizations such as virtual-function-elimination), and this issue still happened. That's about the only additional information I can think of. There are no compiler errors, it builds just fine, but fails to start with the error message in the OP. If you need specific information, I can provide it.
Linking the QT bug report here for reference: https://bugreports.qt.io/browse/QTBUG-96738
Thanks!