SUMMARY Krita does not compile with LTO enabled: --- /var/tmp/portage/media-gfx/krita-5.1.5/work/krita-5.1.5/plugins/tools/tool_transform2/kis_free_transform_strategy.cpp:26:6: error: type ‘StrokeFunction’ violates the C++ One Definition Rule [-Werror=odr] 26 | enum StrokeFunction { | ^ /var/tmp/portage/media-gfx/krita-5.1.5/work/krita-5.1.5/plugins/tools/tool_transform2/kis_perspective_transform_strategy.cpp:27:6: note: an enum with different value name is defined in another translation unit 27 | enum StrokeFunction { | ^ /var/tmp/portage/media-gfx/krita-5.1.5/work/krita-5.1.5/plugins/tools/tool_transform2/kis_free_transform_strategy.cpp:27:5: note: name ‘ROTATE’ differs from name ‘DRAG_HANDLE’ defined in another translation unit 27 | ROTATE = 0, | ^ /var/tmp/portage/media-gfx/krita-5.1.5/work/krita-5.1.5/plugins/tools/tool_transform2/kis_perspective_transform_strategy.cpp:28:5: note: mismatching definition 28 | DRAG_HANDLE = 0, | ^ lto1: some warnings being treated as errors lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ returned 1 exit status compilation terminated. --- STEPS TO REPRODUCE 1. compile with LTO enabled OBSERVED RESULT Compile fails EXPECTED RESULT Compile succeeds SOFTWARE/OS VERSIONS GCC: 13.2.1_p20240113 KDE Plasma Version: 5.27.10 KDE Frameworks Version: 5.113.0 Qt Version: 5.15.12
Downstream bug: https://bugs.gentoo.org/922520
(Note that it may build with just -flto, but -Wodr warnings indicate it's unsafe, so we tell people downstream to use -Werror=odr with LTO.)
Thank you for the report! It sounds as a nice isseu :)
Git commit e33c7d7d533d5289c3a37007f8cf574af5bc7102 by Dmitry Kazakov. Committed on 30/01/2024 at 14:31. Pushed by dkazakov into branch 'master'. Possibly fix ODR violation in the transform tool strategies M +2 -0 plugins/tools/tool_transform2/kis_free_transform_strategy.cpp M +2 -1 plugins/tools/tool_transform2/kis_perspective_transform_strategy.cpp https://invent.kde.org/graphics/krita/-/commit/e33c7d7d533d5289c3a37007f8cf574af5bc7102
Git commit 2c4dd042df1518d67c117ced08c5a2f3729c3193 by Dmitry Kazakov. Committed on 30/01/2024 at 14:32. Pushed by dkazakov into branch 'krita/5.2'. Possibly fix ODR violation in the transform tool strategies (cherry picked from commit e33c7d7d533d5289c3a37007f8cf574af5bc7102) M +2 -0 plugins/tools/tool_transform2/kis_free_transform_strategy.cpp M +2 -1 plugins/tools/tool_transform2/kis_perspective_transform_strategy.cpp https://invent.kde.org/graphics/krita/-/commit/2c4dd042df1518d67c117ced08c5a2f3729c3193