https://bugs.kde.org/show_bug.cgi?id=486486
Bug ID: 486486
Summary: Build fails with LTO
Classification: Applications
Product: kmymoney
Version: 5.1.3
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: buildsystem
Assignee: kmymoney-devel@kde.org
Reporter: eschwart...@gmail.com
Target Milestone: ---
Created attachment 169124
--> https://bugs.kde.org/attachment.cgi?id=169124&action=edit
build.log
I tried to build with the following *FLAGS to optimize the build: `-flto=4
-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing`
Note the -Werror=* flags are used to help detect cases where the compiler tries
to optimize by assuming UB cannot exist in the source code -- if it does exist,
ordinarily the code would be miscompiled, and this says to make the
miscompilation a fatal error.
I got this error:
```
FAILED: bin/kmymoney
: && /usr/bin/x86_64-pc-linux-gnu-g++ -march=native -fstack-protector-all -O2
-pipe -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr
-Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat
-Werror=format-security -Wall -Wextra -Wcast-align -Wchar-subscripts
-Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor
-Woverloaded-virtual -Werror=return-type -Werror=init-self -Wvla -Wdate-time
-Wsuggest-override -Wlogical-op -fdiagnostics-color=always -fexceptions -Wall
-Wextra -Wlogical-op -Wno-null-dereference -Wshadow -Wunused
-Wno-misleading-indentation -Wsuggest-override -Wcast-qual -Wformat=2
-fno-common -Wl,--enable-new-dtags -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr
-Werror=lto-type-mismatch -Werror=strict-aliasing
-Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,--as-needed
-Wl,--allow-multiple-definition-Wl,--no-undefined
kmymoney/CMakeFiles/kmymoney.dir/kmymoney_autogen/mocs_compilation.cpp.o
kmymoney/CMakeFiles/kmymoney.dir/main.cpp.o
kmymoney/CMakeFiles/kmymoney.dir/kmymoney.cpp.o
kmymoney/CMakeFiles/kmymoney.dir/pluginloader.cpp.o
kmymoney/CMakeFiles/kmymoney.dir/kmymoneyadaptor.cpp.o
kmymoney/CMakeFiles/kmymoney.dir/qrc_kmymoney.cpp.o -o bin/kmymoney
-Wl,-rpath,/var/tmp/portage/app-office/kmymoney-5.1.3/work/kmymoney-5.1.3_build/lib:
lib/libviews.a lib/libkmymoney_base.a lib/libkmymoney_common.a
lib/libnewuserwizard.a lib/libnewaccountwizard.a lib/libnewinvestmentwizard.a
lib/libnewloanwizard.a lib/libendingbalancedlg.a lib/libwizardpages.a
lib/libdialogs.a lib/libwidgets.a lib/libsettings.a lib/libconverter.a
lib/libkmm_menus.so.5.1.3 lib/libkmm_widgets.so.5.1.3 lib/libinterfaces.a
/usr/lib64/libQt5WebEngineWidgets.so.5.15.13
/usr/lib64/libQt5WebEngineCore.so.5.15.13
/usr/lib64/libQt5WebChannel.so.5.15.13 lib/libkmm_printer.so.5.1.3
lib/libkmm_models.so.5.1.3 /usr/lib64/libKF5ItemModels.so.5.115.0
/usr/lib64/libKF5Notifications.so.5.115.0 lib/libonlinetask_interfaces.a
lib/libkmymoney_base.a lib/libkmymoney_common.a lib/libkmm_settings.so.5.1.3
/usr/lib64/libKF5KIOFileWidgets.so.5.115.0
/usr/lib64/libKF5Bookmarks.so.5.115.0 /usr/lib64/libKF5KIONTLM.so.5.115.0
lib/libkmm_utils_webconnect.a lib/libkmm_utils_platformtools.a
lib/libnewaccountwizard.a lib/libkmymoneywizard.a
lib/libkmm_csvimportercore.so.5.1.3 lib/libkmm_mymoney.so.5.1.3
lib/libkmm_plugin.so.5.1.3 lib/libkmm_icons.so.5.1.3
lib/libkmm_payeeidentifier.so.5.1.3 /usr/lib64/libKF5KCMUtils.so.5.115.0
/usr/lib64/libQt5Quick.so.5.15.13 /usr/lib64/libQt5QmlModels.so.5.15.13
/usr/lib64/libQt5Qml.so.5.15.13 /usr/lib64/libKF5XmlGui.so.5.115.0
/usr/lib64/libQt5PrintSupport.so.5.15.13 /usr/lib64/libKF5ItemViews.so.5.115.0
/usr/lib64/libalkimia5.so.8.1.2 /usr/lib64/libKF5TextWidgets.so.5.115.0
/usr/lib64/libKF5SonnetUi.so.5.115.0 /usr/lib64/libKF5KIOWidgets.so.5.115.0
/usr/lib64/libKF5IconThemes.so.5.115.0
/usr/lib64/libKF5ConfigWidgets.so.5.115.0 /usr/lib64/libKF5Codecs.so.5.115.0
/usr/lib64/libKF5Auth.so.5.115.0 /usr/lib64/libKF5Completion.so.5.115.0
/usr/lib64/libKF5ConfigGui.so.5.115.0 /usr/lib64/libKF5KIOGui.so.5.115.0
/usr/lib64/libKF5KIOCore.so.5.115.0 /usr/lib64/libKF5Service.so.5.115.0
/usr/lib64/libKF5I18n.so.5.115.0 /usr/lib64/libKF5ConfigCore.so.5.115.0
/usr/lib64/libKF5AuthCore.so.5.115.0 /usr/lib64/libQt5Network.so.5.15.13
/usr/lib64/libKF5Solid.so.5.115.0 /usr/lib64/libQt5Xml.so.5.15.13
/usr/lib64/libKF5JobWidgets.so.5.115.0
/usr/lib64/libKF5WidgetsAddons.so.5.115.0
/usr/lib64/libKF5CoreAddons.so.5.115.0 /usr/lib64/libQt5Widgets.so.5.15.13
/usr/lib64/libKF5WindowSystem.so.5.115.0 /usr/lib64/libQt5Gui.so.5.15.13
/usr/lib64/libX11.so /usr/lib64/libQt5DBus.so.5.15.13
/usr/lib64/libQt5Core.so.5.15.13 /usr/lib64/libgmp.so
/usr/lib64/libsqlcipher.so && cd
/var/tmp/portage/app-office/kmymoney-5.1.3/work/kmymoney-5.1.3_build/lib &&
/usr/bin/cmake -E create_symlink . kmymoney
/var/tmp/portage/app-office/kmymoney-5.1.3/work/km