Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 921017 - dev-games/godot-4.2.1: error: type ‘VkFormat’ violates the C++ One Definition Rule [-Werror=odr]
Summary: dev-games/godot-4.2.1: error: type ‘VkFormat’ violates the C++ One Definition...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ionen Wolkens
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2023-12-30 06:02 UTC by Alfred Wingate
Modified: 2024-03-26 17:30 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge--info.txt,21.80 KB, text/plain)
2023-12-30 06:02 UTC, Alfred Wingate
Details
dev-games/godot-4.2.1 build.log (xz compressed) (godot-4.2.1:20231230-045005.log.xz,24.11 KB, application/x-xz)
2023-12-30 06:02 UTC, Alfred Wingate
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alfred Wingate 2023-12-30 06:02:30 UTC
Created attachment 880972 [details]
emerge --info

x86_64-pc-linux-gnu-g++ -o bin/godot.linuxbsd.template_release.x86_64.runner -Wl,-O1 -Wl,--as-needed -O3 -march=znver2 -
pipe -flto=auto -fuse-linker-plugin -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -pthread -T platform/l
inuxbsd/pck_embed.legacy.ld platform/linuxbsd/godot_linuxbsd.linuxbsd.template_release.x86_64.runner.o platform/linuxbsd
/crash_handler_linuxbsd.linuxbsd.template_release.x86_64.runner.o platform/linuxbsd/os_linuxbsd.linuxbsd.template_releas
e.x86_64.runner.o platform/linuxbsd/joypad_linux.linuxbsd.template_release.x86_64.runner.o platform/linuxbsd/freedesktop
_portal_desktop.linuxbsd.template_release.x86_64.runner.o platform/linuxbsd/freedesktop_screensaver.linuxbsd.template_re
lease.x86_64.runner.o platform/linuxbsd/x11/display_server_x11.linuxbsd.template_release.x86_64.runner.o platform/linuxb
sd/x11/key_mapping_x11.linuxbsd.template_release.x86_64.runner.o platform/linuxbsd/x11/vulkan_context_x11.linuxbsd.templ
ate_release.x86_64.runner.o platform/linuxbsd/x11/gl_manager_x11_egl.linuxbsd.template_release.x86_64.runner.o platform/
linuxbsd/x11/gl_manager_x11.linuxbsd.template_release.x86_64.runner.o platform/linuxbsd/x11/detect_prime_x11.linuxbsd.te
mplate_release.x86_64.runner.o thirdparty/glad/glx.linuxbsd.template_release.x86_64.runner.o main/libmain.linuxbsd.templ
ate_release.x86_64.runner.a modules/libmodules.linuxbsd.template_release.x86_64.runner.a modules/libmodule_ktx.linuxbsd.
template_release.x86_64.runner.a modules/libmodule_msdfgen.linuxbsd.template_release.x86_64.runner.a modules/libmodule_t
heora.linuxbsd.template_release.x86_64.runner.a modules/libmodule_vorbis.linuxbsd.template_release.x86_64.runner.a modul
es/libmodule_basis_universal.linuxbsd.template_release.x86_64.runner.a modules/libmodule_bmp.linuxbsd.template_release.x
86_64.runner.a modules/libmodule_csg.linuxbsd.template_release.x86_64.runner.a modules/libmodule_dds.linuxbsd.template_r
elease.x86_64.runner.a modules/libmodule_enet.linuxbsd.template_release.x86_64.runner.a modules/libmodule_freetype.linux
bsd.template_release.x86_64.runner.a modules/libmodule_gdscript.linuxbsd.template_release.x86_64.runner.a modules/libmod
ule_glslang.linuxbsd.template_release.x86_64.runner.a modules/libmodule_gltf.linuxbsd.template_release.x86_64.runner.a m
odules/libmodule_gridmap.linuxbsd.template_release.x86_64.runner.a modules/libmodule_hdr.linuxbsd.template_release.x86_6
4.runner.a modules/libmodule_jpg.linuxbsd.template_release.x86_64.runner.a modules/libmodule_jsonrpc.linuxbsd.template_r
elease.x86_64.runner.a modules/libmodule_mbedtls.linuxbsd.template_release.x86_64.runner.a modules/libmodule_meshoptimiz
er.linuxbsd.template_release.x86_64.runner.a modules/libmodule_minimp3.linuxbsd.template_release.x86_64.runner.a modules
/libmodule_mobile_vr.linuxbsd.template_release.x86_64.runner.a modules/libmodule_multiplayer.linuxbsd.template_release.x
86_64.runner.a modules/libmodule_navigation.linuxbsd.template_release.x86_64.runner.a modules/libmodule_noise.linuxbsd.t
emplate_release.x86_64.runner.a modules/libmodule_ogg.linuxbsd.template_release.x86_64.runner.a modules/libmodule_openxr
.linuxbsd.template_release.x86_64.runner.a modules/libmodule_regex.linuxbsd.template_release.x86_64.runner.a modules/lib
module_squish.linuxbsd.template_release.x86_64.runner.a modules/libmodule_svg.linuxbsd.template_release.x86_64.runner.a 
modules/libmodule_text_server_adv.linuxbsd.template_release.x86_64.runner.a modules/libmodule_tga.linuxbsd.template_rele
ase.x86_64.runner.a modules/libmodule_upnp.linuxbsd.template_release.x86_64.runner.a modules/libmodule_vhacd.linuxbsd.te
mplate_release.x86_64.runner.a modules/libmodule_webp.linuxbsd.template_release.x86_64.runner.a modules/libmodule_webrtc
.linuxbsd.template_release.x86_64.runner.a modules/libmodule_websocket.linuxbsd.template_release.x86_64.runner.a modules
/libmodule_webxr.linuxbsd.template_release.x86_64.runner.a modules/libmodule_zip.linuxbsd.template_release.x86_64.runner.a platform/libplatform.linuxbsd.template_release.x86_64.runner.a drivers/libdrivers.linuxbsd.template_release.x86_64.runner.a scene/libscene.linuxbsd.template_release.x86_64.runner.a servers/libservers.linuxbsd.template_release.x86_64.runner.a core/libcore.linuxbsd.template_release.x86_64.runner.a modules/msdfgen/libmsdfgen_builtin.linuxbsd.template_release.x86_64.runner.a -lgraphite2 -licui18n -licuuc -licudata -lharfbuzz-icu -lharfbuzz -lpng16 -lzstd -lbrotlicommon -lbrotlidec -ltheora -ltheoradec -lvorbis -lvorbisfile -logg -lwebp -lmbedtls -lmbedcrypto -lmbedx509 -lwslay -lminiupnpc -lpcre2-32 -lRecast -lfontconfig -lfreetype -lasound -lpulse -ldbus-1 -lxkbcommon -ludev -lz -lXcursor -lXinerama -lXext -lXrandr -lXrender -lX11 -lXi -lvulkan -lpthread -ldl
thirdparty/vulkan/include/vulkan/vulkan_core.h:1429: error: type ‘VkFormat’ violates the C++ One Definition Rule [-Werror=odr]
 1429 | typedef enum VkFormat {
      | 
thirdparty/libktx/lib/vkformat_enum.h:21: note: an enum with different value name is defined in another translation unit
   21 | typedef enum VkFormat {
      | 
thirdparty/vulkan/include/vulkan/vulkan_core.h:1649: note: name ‘VK_FORMAT_G8_B8R8_2PLANE_444_UNORM’ differs from name ‘VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG’ defined in another translation unit
 1649 |     VK_FORMAT_G8_B8R8_2PLANE_444_UNORM = 1000330000,
      | 
thirdparty/libktx/lib/vkformat_enum.h:241: note: mismatching definition
  241 |     VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
      | 
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
Comment 1 Alfred Wingate 2023-12-30 06:02:48 UTC
Created attachment 880973 [details]
dev-games/godot-4.2.1 build.log (xz compressed)
Comment 2 Ionen Wolkens gentoo-dev 2023-12-30 15:06:15 UTC
Odd, I always build this one with lto and the same odr/mismatch warnings.

That may be gcc14-only which I didn't try.
Comment 3 Ionen Wolkens gentoo-dev 2023-12-30 15:08:13 UTC
(In reply to Ionen Wolkens from comment #2)
> Odd, I always build this one with lto and the same odr/mismatch warnings.
> 
> That may be gcc14-only which I didn't try.
Or nevermind, I thought it was being used when I seen it in the emerge --info, but gcc-13 is selected.
Comment 4 Ionen Wolkens gentoo-dev 2023-12-30 15:47:21 UTC
(In reply to Ionen Wolkens from comment #2)
> Odd, I always build this one with lto and the same odr/mismatch warnings.
Well, gave it another build using my usual "-march=native -O2 -pipe -frecord-gcc-switches -flto=6 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" and same USE but it doesn't fail for me.

Maybe it's hitting some unusual code path but I didn't look too closely.

(on a side-note, recall upstream uses LTO for their official releases and it should in general not be broken)
Comment 5 Alfred Wingate 2023-12-30 16:10:09 UTC
That's weird as the mismatch does appear to be real.

vkFormat has differences between thirdparty/vulkan/include/vulkan/vulkan_core.h and thirdparty/libktx/lib/vkformat_enum.h.

Like it appears thirdparty/libktx/lib/vkformat_enum.h was generated from vulkan 1.2 meaning it misses VK_FORMAT_G8_B8R8_2PLANE_444_UNORM and the rest which were added in 1.3.
Comment 6 Ionen Wolkens gentoo-dev 2023-12-30 16:55:32 UTC
(In reply to Alfred Wingate from comment #5)
> That's weird as the mismatch does appear to be real.
> 
> vkFormat has differences between
> thirdparty/vulkan/include/vulkan/vulkan_core.h and
> thirdparty/libktx/lib/vkformat_enum.h.
> 
> Like it appears thirdparty/libktx/lib/vkformat_enum.h was generated from
> vulkan 1.2 meaning it misses VK_FORMAT_G8_B8R8_2PLANE_444_UNORM and the rest
> which were added in 1.3.
You're right, looking more closely I think something else went on. Looking at my build.log I definitely do see the -Werror=odr.. but at the end there's a non-aborting:

thirdparty/vulkan/include/vulkan/vulkan_core.h:1429: warning: type 'VkFormat' violates the C++ One Definition Rule [-Wodr]

Not sure what went on there, but it's real anyway.
Comment 7 Larry the Git Cow gentoo-dev 2024-03-26 17:30:51 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1335d04368c7653fdaecbdab19e50a6ae4a4c8f4

commit 1335d04368c7653fdaecbdab19e50a6ae4a4c8f4
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2024-03-26 17:02:38 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2024-03-26 17:16:59 +0000

    dev-games/godot: mark as LTO unsafe for now
    
    Would rather not have to worry about this, esp when generated
    bits are involved. May reconsider eventually.
    
    Closes: https://bugs.gentoo.org/921017
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 dev-games/godot/godot-4.2.1.ebuild | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)