Bug 374588 - kwin 5.8.5 compilation fails with lto enabled gcc-5.4.0
Summary: kwin 5.8.5 compilation fails with lto enabled gcc-5.4.0
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.8.5
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-05 11:41 UTC by Fabio Coatti
Modified: 2017-01-05 20:11 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Coatti 2017-01-05 11:41:09 UTC
Hi all, 
I'm compiling kwin-5.8.5 on a gentoo system with gcc-5.4.0. Without LTO flag enabled the compilation is successful; however with lto enabled the compilation/linking fails with this error:
[ 52%] Linking CXX shared module kwin5_aurorae.so
cd /var/tmp/portage/kde-plasma/kwin-5.8.5/work/kwin-5.8.5_build/plugins/kdecorations/aurorae/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/kwin5_aurorae.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-g++  -fPIC -O2 -fpie -fpic -pipe -march=native -fstack-protector-strong -flto=4 -fuse-linker-plugin -std=c++0x -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Wl,--no-undefined -Wl,--fatal-warnings -Wl,--enable-new-dtags -Wl,-O1 -Wl,--as-needed -O2 -fpie -fpic -pipe -march=native -fstack-protector-strong -flto=4 -fuse-linker-plugin -shared  -o kwin5_aurorae.so CMakeFiles/kwin5_aurorae.dir/aurorae.cpp.o CMakeFiles/kwin5_aurorae.dir/decorationoptions.cpp.o CMakeFiles/kwin5_aurorae.dir/lib/auroraetheme.cpp.o CMakeFiles/kwin5_aurorae.dir/lib/themeconfig.cpp.o CMakeFiles/kwin5_aurorae.dir/kwin5_aurorae_automoc.cpp.o /usr/lib64/libkdecorations2.so.5.8.5 /usr/lib64/libKF5ConfigWidgets.so.5.29.0 /usr/lib64/libKF5Package.so.5.29.0 /usr/lib64/libKF5WindowSystem.so.5.29.0 /usr/lib64/libQt5Quick.so.5.7.1 /usr/lib64/libQt5UiTools.a /usr/lib64/libKF5Codecs.so.5.29.0 /usr/lib64/libKF5WidgetsAddons.so.5.29.0 /usr/lib64/libKF5ConfigGui.so.5.29.0 /usr/lib64/libQt5Xml.so.5.7.1 /usr/lib64/libKF5ConfigCore.so.5.29.0 /usr/lib64/libKF5Auth.so.5.29.0 /usr/lib64/libKF5I18n.so.5.29.0 /usr/lib64/libKF5CoreAddons.so.5.29.0 /usr/lib64/libQt5Qml.so.5.7.1 /usr/lib64/libQt5Network.so.5.7.1 /usr/lib64/libQt5Widgets.so.5.7.1 /usr/lib64/libQt5Gui.so.5.7.1 /usr/lib64/libQt5Core.so.5.7.1 
x86_64-pc-linux-gnu-g++: warning: ‘-mpcommit’ was deprecated
lto1: warning: ‘-mpcommit’ was deprecated
x86_64-pc-linux-gnu-g++: warning: ‘-mpcommit’ was deprecated
x86_64-pc-linux-gnu-g++: warning: ‘-mpcommit’ was deprecated
x86_64-pc-linux-gnu-g++: warning: ‘-mpcommit’ was deprecated
x86_64-pc-linux-gnu-g++: warning: ‘-mpcommit’ was deprecated
lto1: warning: ‘-mpcommit’ was deprecated
lto1: warning: ‘-mpcommit’ was deprecated
lto1: warning: ‘-mpcommit’ was deprecated
lto1: warning: ‘-mpcommit’ was deprecated
x86_64-pc-linux-gnu-g++: warning: ‘-mpcommit’ was deprecated
x86_64-pc-linux-gnu-g++: warning: ‘-mpcommit’ was deprecated
lto1: warning: ‘-mpcommit’ was deprecated
lto1: warning: ‘-mpcommit’ was deprecated
x86_64-pc-linux-gnu-g++: warning: ‘-mpcommit’ was deprecated
lto1: warning: ‘-mpcommit’ was deprecated
../lib/uilib/abstractformbuilder.cpp: In member function ‘saveBrush’:
../lib/uilib/abstractformbuilder.cpp:1150:11: error: SSE register return with SSE disabled
make[3]: *** [/var/tmp/portage/kde-plasma/kwin-5.8.5/temp/ccK7ZyaG.mk:17: /var/tmp/portage/kde-plasma/kwin-5.8.5/temp/ccwi8lP6.ltrans5.ltrans.o] Error 1
make[3]: *** Waiting for unfinished jobs....
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.


Not really a showstopper as the packages compiles fine without LTO, however this could be interesting to know for developers.

Cheers,
Fabio.
Comment 1 Martin Flöser 2017-01-05 12:47:42 UTC
> ../lib/uilib/abstractformbuilder.cpp: In member function
> ‘saveBrush’:
> ../lib/uilib/abstractformbuilder.cpp:1150:11: error: SSE register
> return with
> SSE disabled

This is not a file from KWin, but I think Qt. You might want to forward 
the problem to Qt devs.
Comment 2 Fabio Coatti 2017-01-05 12:49:18 UTC
Fair enough :)
Will do that, thanks.
Comment 3 Fabio Coatti 2017-01-05 15:37:49 UTC
Just an additional info:using clang the LTO compilation works just fine.
Comment 4 Martin Flöser 2017-01-05 20:11:08 UTC
Maybe also a gcc error?

I'm setting to RESOLVED UPSTREAM as from our side there is not much to do. I do not even see which are in KWin seems to be responsible for it.