Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 895580

Summary: kde-frameworks/networkmanager-qt-5.103.0 fails to compile (lto): src/settings/connectionsettings.cpp:57:12: error: type of ‘checkVersion’ does not match original declaration [-Werror=lto-type-mismatch]
Product: Gentoo Linux Reporter: Kostadin Shishmanov <kocelfc>
Component: Current packagesAssignee: Gentoo KDE team <kde>
Status: RESOLVED UPSTREAM    
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
See Also: https://invent.kde.org/frameworks/networkmanager-qt/-/merge_requests/36
Whiteboard: fixed in 5.104.0
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550    
Attachments: emerge --info and build log

Description Kostadin Shishmanov 2023-02-20 18:23:34 UTC
Created attachment 853358 [details]
emerge --info and build log

kde-frameworks/networkmanager-qt fails to compile with CFLAGS=-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing


/var/tmp/portage/kde-frameworks/networkmanager-qt-5.103.0/work/networkmanager-qt-5.103.0/src/settings/connectionsettings.cpp:57:12: error: type of ‘checkVersion’ does not match original declaration [-Werror=lto-type-mismatch]
   57 | extern int checkVersion(const int x, const int y, const int z);
      |            ^
/var/tmp/portage/kde-frameworks/networkmanager-qt-5.103.0/work/networkmanager-qt-5.103.0/src/manager.cpp:966:6: note: return value type mismatch
  966 | bool NetworkManager::checkVersion(const int x, const int y, const int z)
      |      ^
/var/tmp/portage/kde-frameworks/networkmanager-qt-5.103.0/work/networkmanager-qt-5.103.0/src/manager.cpp:966:6: note: type ‘bool’ should match type ‘int’
/var/tmp/portage/kde-frameworks/networkmanager-qt-5.103.0/work/networkmanager-qt-5.103.0/src/manager.cpp:966:6: note: ‘checkVersion’ was previously declared here
/var/tmp/portage/kde-frameworks/networkmanager-qt-5.103.0/work/networkmanager-qt-5.103.0/src/manager.cpp:966:6: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
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.
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
Comment 1 Andreas Sturmlechner gentoo-dev 2023-02-24 11:38:40 UTC
Cherry-picked to kf5 branch in https://invent.kde.org/frameworks/networkmanager-qt/-/commit/794fff02b08d15bc5fffd9dee54abc909b53a44a, thanks.