Summary: | [guru] net-misc/moonlight-4.3.1 fails to compile (lto): /usr/include/SDL2/SDL_syswm.h:248:9: error: type ‘struct <anon>’ violates the C++ One Definition Rule [-Werror=odr] | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Kostadin Shishmanov <kocelfc> |
Component: | Current packages | Assignee: | Andrew Athalye <andrewathalye> |
Status: | RESOLVED CANTFIX | ||
Severity: | normal | CC: | ceamac |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | emerge --info and build log |
This looks like an issue in SDL that isn't directly related to Moonlight, unless there is something I'm missing. The code is also C, not C++, so odr really shouldn't be applied to it imo. If it's built with a c++ compiler, c++ rules apply. (In reply to Sam James from comment #2) > If it's built with a c++ compiler, c++ rules apply. Ah, I see. Is there any solution besides stripping -Werror=odr from the build flags? I don't think modifying SDL and Qt would be a good fix, but if we want to honour the user's build flags idk what is best. |
Created attachment 858073 [details] emerge --info and build log net-misc/moonlight-4.3.1 fails to compile with CFLAGS=-flto -Werror=odr and LDFLAGS=-Werror=odr /usr/include/SDL2/SDL_syswm.h:248:9: error: type ‘struct <anon>’ violates the C++ One Definition Rule [-Werror=odr] 248 | { | ^ /usr/include/SDL2/SDL_syswm.h:294:9: note: a different type is defined in another translation unit 294 | { | ^ /usr/include/SDL2/SDL_syswm.h:249:22: note: the first difference of corresponding definitions is field ‘display’ 249 | Display *display; /**< The X11 display */ | ^ /usr/include/SDL2/SDL_syswm.h:295:32: note: a field of same name but different type is defined in another translation unit 295 | struct wl_display *display; /**< Wayland display */ | ^ /usr/include/SDL2/SDL_syswm.h:248:9: note: type name ‘_XDisplay’ should match type name ‘wl_display’ 248 | { | ^ /usr/include/wayland-client-core.h:110:8: note: the incompatible type is defined here 110 | struct wl_display; | ^ /usr/include/SDL2/SDL_syswm.h:294:9: error: type ‘struct <anon>’ violates the C++ One Definition Rule [-Werror=odr] 294 | { | ^ /usr/include/SDL2/SDL_syswm.h:339:9: note: a different type is defined in another translation unit 339 | { | ^ /usr/include/SDL2/SDL_syswm.h:295:32: note: the first difference of corresponding definitions is field ‘display’ 295 | struct wl_display *display; /**< Wayland display */ | ^ /usr/include/SDL2/SDL_syswm.h:340:17: note: a field with different name is defined in another translation unit 340 | int dev_index; /**< Device index (ex: the X in /dev/dri/cardX) */ | ^ /usr/include/SDL2/SDL_syswm.h:231:5: error: type ‘union <anon>’ violates the C++ One Definition Rule [-Werror=odr] 231 | { | ^ /usr/include/SDL2/SDL_syswm.h:231:5: note: a different type is defined in another translation unit 231 | { | ^ /usr/include/SDL2/SDL_syswm.h:251:11: note: the first difference of corresponding definitions is field ‘x11’ 251 | } x11; | ^ /usr/include/SDL2/SDL_syswm.h:303:11: note: a field with different name is defined in another translation unit 303 | } wl; | ^ /usr/include/SDL2/SDL_syswm.h:226:8: error: type ‘struct SDL_SysWMinfo’ violates the C++ One Definition Rule [-Werror=odr] 226 | struct SDL_SysWMinfo | ^ /usr/include/SDL2/SDL_syswm.h:226:8: note: a different type is defined in another translation unit 226 | struct SDL_SysWMinfo | ^ /usr/include/SDL2/SDL_syswm.h:349:7: note: the first difference of corresponding definitions is field ‘info’ 349 | } info; | ^ /usr/include/SDL2/SDL_syswm.h:349:7: note: a field of same name but different type is defined in another translation unit 349 | } info; | ^ /usr/include/SDL2/SDL_syswm.h:231:5: note: type ‘union <anon>’ itself violates the C++ One Definition Rule 231 | { | ^ /usr/include/qt5/QtCore/qnamespace.h:1275:10: error: type ‘Qt::DateFormat’ violates the C++ One Definition Rule [-Werror=odr] 1275 | enum DateFormat { | ^ /usr/include/qt5/QtCore/qnamespace.h:1275:10: note: an enum with different value name is defined in another translation unit 1275 | enum DateFormat { | ^ /usr/include/qt5/QtCore/qnamespace.h:1287:9: note: name ‘RFC2822Date’ differs from name ‘SystemLocaleDate’ defined in another translation unit 1287 | RFC2822Date = 8, // RFC 2822 (+ 850 and 1036 during parsing) | ^ /usr/include/qt5/QtCore/qnamespace.h:1279:9: note: mismatching definition 1279 | SystemLocaleDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"), | ^ lto1: some warnings being treated as errors lto-wrapper: fatal error: x86_64-pc-linux-gnu-g++ returned 1 exit status