| Summary: | dolphin svn plugin: ODR violations when building with LTO | ||
|---|---|---|---|
| Product: | [Applications] dolphin | Reporter: | Erik Quaeghebeur <bugs.kde.org> |
| Component: | plugins: svn | Assignee: | Sebastian Dörner <sebastian> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | ab4bd, dolphin-bugs-null |
| Priority: | NOR | ||
| Version First Reported In: | 23.08.5 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/sdk/dolphin-plugins/-/commit/772a4d712abcf1c6c86f25bd306785815132d886 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
A possibly relevant merge request was started @ https://invent.kde.org/sdk/dolphin-plugins/-/merge_requests/56 Git commit 772a4d712abcf1c6c86f25bd306785815132d886 by Nikolai Krasheninnikov. Committed on 02/04/2024 at 09:07. Pushed by nikolaik into branch 'master'. svn: Fix gcc-13 One Definition Rule compilation error with LTO enabled columns_t enum defined multiple times in different translation units. Although this should not be an error, we move the definition to a separate unnamed namespace. M +5 -5 svn/svncommitdialog.cpp M +7 -7 svn/svnlogdialog.cpp https://invent.kde.org/sdk/dolphin-plugins/-/commit/772a4d712abcf1c6c86f25bd306785815132d886 |
SUMMARY When compiling the dolphin svn plugin with LTO enabled (compiler flag: -flto=auto) and treating some LTO-problematic warnings as errors (compiler flags: -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing), the build fails as follows: ``` /var/tmp/portage/kde-apps/dolphin-plugins-subversion-23.08.5/work/dolphin-plugins-23.08.5/svn/svncommitdialog.cpp:70:6: error: type ‘columns_t’ violates the C++ One Definition Rule [-Werror=odr] 70 | enum columns_t { | ^ /var/tmp/portage/kde-apps/dolphin-plugins-subversion-23.08.5/work/dolphin-plugins-23.08.5/svn/svnlogdialog.cpp:67:6: note: an enum with different value name is defined in another translation unit 67 | enum columns_t { | ^ /var/tmp/portage/kde-apps/dolphin-plugins-subversion-23.08.5/work/dolphin-plugins-23.08.5/svn/svncommitdialog.cpp:71:5: note: name ‘columnPath’ differs from name ‘columnRevision’ defined in another translation unit 71 | columnPath, | ^ /var/tmp/portage/kde-apps/dolphin-plugins-subversion-23.08.5/work/dolphin-plugins-23.08.5/svn/svnlogdialog.cpp:68:5: note: mismatching definition 68 | columnRevision, | ^ 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. ``` SOFTWARE/OS VERSIONS Linux: 6.6.13-gentoo-a #1 SMP KDE Plasma Version: 5.27.10 KDE Frameworks Version: 5.115.0 Qt Version: 5.15.12 GCC: 13.2.1_p20240113 ADDITIONAL INFORMATION Downstream bug: https://bugs.gentoo.org/926233