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

Bug 921558

Summary: kde-plasma/kwin-5.91.0 fails to compile (lto): src/input_event.h:21:7: error: type ‘struct MouseEvent’ violates the C++ One Definition Rule [-Werror=odr]
Product: Gentoo Linux Reporter: Kostadin Shishmanov <kocelfc>
Component: Current packagesAssignee: Gentoo KDE team <kde>
Status: RESOLVED UPSTREAM    
Severity: normal CC: johannesp
Priority: Normal Keywords: UPSTREAM
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://invent.kde.org/plasma/kwin/-/merge_requests/5339
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550    
Attachments: build log compressed with xz

Description Kostadin Shishmanov 2024-01-07 12:27:12 UTC
Created attachment 881592 [details]
build log compressed with xz

FAILED: bin/kwin_x11 
: && /usr/bin/x86_64-pc-linux-gnu-g++ -march=raptorlake -O2 -pipe -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -fno-operator-names -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Werror=init-self -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -fdiagnostics-color=always -Wl,--enable-new-dtags -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--compress-debug-sections=zstd -Werror=strict-aliasing src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/KWinX11Platform_autogen/mocs_compilation.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_backend.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_cursor.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_edge.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_effects.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_effects_keyboard_interception_filter.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_effects_mouse_interception_filter.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_egl_backend.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_keyboard.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_logging.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_non_composited_outline.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_output.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_overlaywindow.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_placeholderoutput.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_screenedges_filter.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_windowselector.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_xfixes_cursor_event_filter.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_xinputintegration.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/glxcontext.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_glx_backend.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_glx_context_attribute_builder.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_glxconvenience.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_omlsynccontrolvsyncmonitor.cpp.o src/backends/x11/standalone/CMakeFiles/KWinX11Platform.dir/x11_standalone_sgivideosyncvsyncmonitor.cpp.o src/CMakeFiles/kwin_x11.dir/kwin_x11_autogen/mocs_compilation.cpp.o src/CMakeFiles/kwin_x11.dir/main_x11.cpp.o src/CMakeFiles/kwin_x11.dir/kcoreaddons_static_kwin_effects_plugins_plugins.cpp.o -o bin/kwin_x11  -Wl,-rpath,/var/tmp/portage/kde-plasma/kwin-5.91.0/work/kwin-5.91.0_build/bin:  src/plugins/overview/CMakeFiles/overview_resources_1.dir/./.rcc/qrc_qmake_overview.cpp.o  src/plugins/overview/CMakeFiles/overview_qmlcache.dir/./.rcc/qmlcache/overview_qmlcache_loader.cpp.o  src/plugins/overview/CMakeFiles/overview_resources_2.dir/./.rcc/qrc_overview_raw_qml_0.cpp.o  lib/libcontrast.a  lib/libblendchanges.a  lib/libblur.a  lib/libcolorblindnesscorrection.a  lib/libcolorpicker.a  lib/libdiminactive.a  lib/libfallapart.a  lib/libglide.a  lib/libhighlightwindow.a  lib/libinvert.a  lib/libkscreen.a  lib/libmagiclamp.a  lib/libmagnifier.a  lib/libmouseclick.a  lib/libmousemark.a  lib/liboutputlocator.a  lib/liboverview.a  lib/libscreenedge.a  lib/libscreenshot.a  lib/libscreentransform.a  lib/libshakecursor.a  lib/libsheet.a  lib/libshowfps.a  lib/libshowpaint.a  lib/libslide.a  lib/libslideback.a  lib/libslidingpopups.a  lib/libsnaphelper.a  lib/libstartupfeedback.a  lib/libthumbnailaside.a  lib/libtileseditor.a  lib/libtouchpoints.a  lib/libtrackmouse.a  lib/libwindowview.a  lib/libwobblywindows.a  lib/libzoom.a  /usr/lib64/libxcb-xkb.so  /usr/lib64/libxkbcommon-x11.so  /usr/lib64/libxkbcommon.so  /usr/lib64/libdrm.so  /usr/lib64/libxcb-composite.so  /usr/lib64/libxcb-xfixes.so  /usr/lib64/libxcb-render.so  /usr/lib64/libxcb-shape.so  /usr/lib64/libxcb-keysyms.so  /usr/lib64/libxcb-randr.so  /usr/lib64/libxcb.so  /usr/lib64/libXi.so  /usr/lib64/libXext.so  /usr/lib64/libdl.a  /usr/lib64/libKF6Svg.so.5.247.0  bin/libkwin.so.5.91.0  /usr/lib64/libKF6Crash.so.5.247.0  /usr/lib64/libQt6Quick.so.6.6.1  /usr/lib64/libQt6QmlModels.so.6.6.1  /usr/lib64/libQt6OpenGL.so.6.6.1  /usr/lib64/libwayland-server.so  /usr/lib64/libepoxy.so  /usr/lib64/libkdecorations2.so.5.91.0  /usr/lib64/libQt6Qml.so.6.6.1  /usr/lib64/libQt6Network.so.6.6.1  /usr/lib64/libKF6Service.so.5.247.0  /usr/lib64/libxkbcommon.so  /usr/lib64/libKF6WindowSystem.so.5.247.0  /usr/lib64/libX11.so  /usr/lib64/libKF6GlobalAccel.so.5.247.0  /usr/lib64/libKF6ConfigWidgets.so.5.247.0  /usr/lib64/libKF6CoreAddons.so.5.247.0  /usr/lib64/libKF6WidgetsAddons.so.5.247.0  /usr/lib64/libQt6Widgets.so.6.6.1  /usr/lib64/libKF6ColorScheme.so.5.247.0  /usr/lib64/libKF6I18n.so.5.247.0  /usr/lib64/libKF6ConfigGui.so.5.247.0  /usr/lib64/libKF6ConfigCore.so.5.247.0  /usr/lib64/libQt6Gui.so.6.6.1  /usr/lib64/libQt6DBus.so.6.6.1  /usr/lib64/libGLX.so  /usr/lib64/libOpenGL.so  /usr/lib64/libQt6Core.so.6.6.1 && :
/var/tmp/portage/kde-plasma/kwin-5.91.0/work/kwin-5.91.0/src/input_event.h:21:7: error: type ‘struct MouseEvent’ violates the C++ One Definition Rule [-Werror=odr]
   21 | class MouseEvent : public QMouseEvent
      |       ^
/var/tmp/portage/kde-plasma/kwin-5.91.0/work/kwin-5.91.0/src/plugins/mouseclick/mouseclick.h:27:7: note: a type with different bases is defined in another translation unit
   27 | class MouseEvent
      |       ^
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/14/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
Comment 1 Kostadin Shishmanov 2024-01-07 12:27:26 UTC
Portage 3.0.61 (python 3.11.7-final-0, default/linux/amd64/23.0/desktop/plasma, gcc-14, glibc-2.38-r9, 6.6.10-gentoo x86_64)
=================================================================
System uname: Linux-6.6.10-gentoo-x86_64-13th_Gen_Intel-R-_Core-TM-_i5-13600KF-with-glibc2.38
KiB Mem:    16243484 total,   8966480 free
KiB Swap:   16383996 total,  16383996 free
Timestamp of repository gentoo: Sun, 07 Jan 2024 10:17:58 +0000
Head commit of repository gentoo: 0ae38ff601fd461f042bfec239d6f8b26b68a69f

Timestamp of repository guru: Fri, 05 Jan 2024 20:35:33 +0000
Head commit of repository guru: 6bf6356ec93a51c8447d8b7d4fc77683742fd844

Timestamp of repository kde: Sat, 06 Jan 2024 12:32:52 +0000
Head commit of repository kde: e8e26601226db26372e681e8a9e91d362466cb69

Timestamp of repository steam-overlay: Fri, 05 Jan 2024 20:35:25 +0000
Head commit of repository steam-overlay: 6b8fa7d624601c46d2352c69068b5ebfa5267f38

sh bash 5.2_p21-r1
ld GNU ld (Gentoo 2.41 p4) 2.41.0
ccache version 4.9 [disabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p21-r1::gentoo
dev-lang/perl:             5.38.2-r1::gentoo
dev-lang/python:           3.11.7::gentoo, 3.12.1_p1::gentoo
dev-lang/rust:             1.74.1::gentoo
dev-util/ccache:           4.9::gentoo
dev-util/cmake:            3.28.1-r1::gentoo
dev-util/meson:            1.3.1::gentoo
sys-apps/baselayout:       2.14-r1::gentoo
sys-apps/openrc:           0.52.1::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.13-r8::gentoo, 2.72-r1::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.41-r4::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo
sys-devel/gcc:             13.2.1_p20231230::gentoo, 14.0.0_pre20231231::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             17.0.6::gentoo
sys-devel/llvm:            17.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.6::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r9::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: False

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: False

kde
    location: /var/db/repos/kde
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/kde.git
    masters: gentoo
    volatile: False

local
    location: /var/db/repos/local
    masters: gentoo
    volatile: False

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo
    volatile: False

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://gentoo.osuosl.org/releases/amd64/binpackages/17.1/x86-64

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=raptorlake -O2 -pipe -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-march=raptorlake -O2 -pipe -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=raptorlake -O2 -pipe -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=raptorlake -O2 -pipe -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
GENTOO_MIRRORS="     https://mirror.telepoint.bg/gentoo      http://tux.rainside.sk/gentoo/     http://gentoo.mirror.root.lu/     ftp://tux.rainside.sk/gentoo/     http://ftp.vectranet.pl/gentoo/ "
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--compress-debug-sections=zstd -Werror=strict-aliasing"
LEX="flex"
MAKEOPTS="-j20"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RUSTFLAGS="-C target-cpu=raptorlake -C opt-level=3 -C link-arg=-Wl,-z,relro -C link-arg=-Wl,-z,now -C link-arg=-Wl,-z,pack-relative-relocs -C link-arg=-Wl,--compress-debug-sections=zstd"
SHELL="/bin/bash"
USE="X aac acl acpi activities amd64 branding bzip2 cairo cdr crypt dbus declarative dri dvdr elogind encode exif flac flatpak gdbm gif gtk gui hardened iconv icu jpeg kde kf6compat kwallet lcms libnotify libtirpc lzma mad minimal mng mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opengl pam pango pcre pdf pipewire plasma png policykit ppds pulseaudio qml qt5 readline screencast sdl seccomp sound ssl startup-notification svg test-rust tiff truetype udev udisks unicode upower usb vaapi vulkan wayland widgets wxwidgets x264 xattr xcb xft xml xv zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby33" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 2 Johannes Penßel 2024-01-16 18:34:32 UTC
For anyone interested, a workaround for this issue is to disable building of the mouseclick effect plugin. (it is more of a gimmick anyways, you can normally enable/disable it in Settings->Window Management->Desktop Effects->Mouse Click Animation)

I use this ebuild hook at /etc/portage/env/kde-plasma/kwin:

function pre_src_prepare() {
  echo "Disabling mouseclick plugin for LTO compatibility"
  sed -i -e '/mouseclick/d' src/plugins/CMakeLists.txt || die
}
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-03 23:20:01 UTC
This has now landed upstream. Not going to worry about backporting.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-03 23:20:15 UTC
(In reply to Sam James from comment #3)
> This has now landed upstream. Not going to worry about backporting.

For versions in ::gentoo, I will add filter-lto to avoid dupes.
Comment 5 Larry the Git Cow gentoo-dev 2024-03-03 23:22:13 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=021f9c635289129f4161b96ff07f6ae6ac133520

commit 021f9c635289129f4161b96ff07f6ae6ac133520
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-03-03 23:21:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-03-03 23:21:21 +0000

    kde-plasma/kwin: filter LTO for older versions
    
    This is fixed upstream in git and will be cherry-picked to 6.0 branch. But
    not going to bother backporting it in Gentoo for <=6, so filter for older versions.
    
    See https://invent.kde.org/plasma/kwin/-/merge_requests/5339.
    
    Bug: https://bugs.gentoo.org/921558
    Signed-off-by: Sam James <sam@gentoo.org>

 kde-plasma/kwin/kwin-5.27.10-r2.ebuild | 5 ++++-
 kde-plasma/kwin/kwin-6.0.0.ebuild      | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)