<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>480520</bug_id>
          
          <creation_ts>2024-01-30 06:48:32 +0000</creation_ts>
          <short_desc>Krita does not compile with LTO enabled</short_desc>
          <delta_ts>2024-01-30 14:33:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>General</component>
          <version>5.1.5</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Erik Quaeghebeur">bugs.kde.org</reporter>
          <assigned_to name="Krita Bugs">krita-bugs-null</assigned_to>
          <cc>dimula73</cc>
    
    <cc>sam</cc>
          
          <cf_commitlink>https://invent.kde.org/graphics/krita/-/commit/2c4dd042df1518d67c117ced08c5a2f3729c3193</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2284300</commentid>
    <comment_count>0</comment_count>
    <who name="Erik Quaeghebeur">bugs.kde.org</who>
    <bug_when>2024-01-30 06:48:32 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2284301</commentid>
    <comment_count>1</comment_count>
    <who name="Erik Quaeghebeur">bugs.kde.org</who>
    <bug_when>2024-01-30 06:49:54 +0000</bug_when>
    <thetext>Downstream bug: https://bugs.gentoo.org/922520</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2284303</commentid>
    <comment_count>2</comment_count>
    <who name="Sam James">sam</who>
    <bug_when>2024-01-30 06:51:08 +0000</bug_when>
    <thetext>(Note that it may build with just -flto, but -Wodr warnings indicate it&apos;s unsafe, so we tell people downstream to use -Werror=odr with LTO.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2284330</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2024-01-30 09:21:22 +0000</bug_when>
    <thetext>Thank you for the report! It sounds as a nice isseu :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2284416</commentid>
    <comment_count>4</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2024-01-30 14:32:31 +0000</bug_when>
    <thetext>Git commit e33c7d7d533d5289c3a37007f8cf574af5bc7102 by Dmitry Kazakov.
Committed on 30/01/2024 at 14:31.
Pushed by dkazakov into branch &apos;master&apos;.

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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2284417</commentid>
    <comment_count>5</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2024-01-30 14:33:00 +0000</bug_when>
    <thetext>Git commit 2c4dd042df1518d67c117ced08c5a2f3729c3193 by Dmitry Kazakov.
Committed on 30/01/2024 at 14:32.
Pushed by dkazakov into branch &apos;krita/5.2&apos;.

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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>