Bug 480522 - kdeconnect plasmoid fails to compile with LTO enabled
Summary: kdeconnect plasmoid fails to compile with LTO enabled
Status: REPORTED
Alias: None
Product: kdeconnect
Classification: Applications
Component: plasmoid (show other bugs)
Version: 23.08.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-30 07:08 UTC by Erik Quaeghebeur
Modified: 2024-01-30 07:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Quaeghebeur 2024-01-30 07:08:59 UTC
SUMMARY
kdeconnect does not compile with LTO enabled [lto-type-mismatch warnings as errors]:

---
/var/tmp/portage/kde-misc/kdeconnect-23.08.4/work/kdeconnect-kde-23.08.4/smsapp/gsmasciimap.h:10:13: error: type of ‘gsm_ascii_map’ does not match original declaration [-Werror=lto-type-mismatch]                                         
   10 | extern bool gsm_ascii_map[128];                                                                                                                                                                                                     
      |             ^                                                                                                                                                                                                                       
/var/tmp/portage/kde-misc/kdeconnect-23.08.4/work/kdeconnect-kde-23.08.4/smsapp/gsmasciimap.cpp:12:6: note: array types have different bounds                                                                                               
   12 | bool gsm_ascii_map[] = {                                                                                                                                                                                                            
      |      ^                                                                                                                                                                                                                              
/var/tmp/portage/kde-misc/kdeconnect-23.08.4/work/kdeconnect-kde-23.08.4/smsapp/gsmasciimap.cpp:12:6: note: ‘gsm_ascii_map’ was previously declared here                                                                                    
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 and warnings that indicate LTO-unsafe constructs promoted to errors (see at end of report)

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

ADDITIONAL INFORMATION
Downstream bug report: https://bugs.gentoo.org/921648

GCC flags used:
WARNING_FLAGS="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
COMMON_FLAGS="-march=native -O2 -pipe -flto=auto ${WARNING_FLAGS}"