-
-
Notifications
You must be signed in to change notification settings - Fork 23.5k
Open
Description
Tested versions
- Reproducible in 4.4.rc (0e3dbba)
- Should be reproducible in earlier versions, I don't think it was ever meant to work.
System information
Fedora 41, Clang 19.1.7
Issue description
Cross-compiling Godot on Linux for another Linux arch with Clang doesn't work out of the box. No --target or --sysroot arguments are passed, and no check if performed to confirm that the toolchain is properly setup.
This was initially noticed while trying to cross-compile for arm32 from x86_64, where some x86_64 code gets compiled in zstd:
scons platform=linuxbsd target=editor tests=false verbose=yes warnings=no progress=no module_mono_enabled=yes arch=arm32 use_llvm=yes lto=none
Fails with:
clang -o thirdparty/zstd/decompress/huf_decompress.linuxbsd.editor.arm32.llvm.o -c -std=gnu17 -ffp-contract=off -pipe -fno-color-diagnostics -O2 -w -DTOOLS_ENABLED -DDEBUG_ENABLED -DNDEBUG -DENGINE_UPDATE_CHECK_ENABLED -DNO_EDITOR_SPLASH -DSOWRAP_ENABLED -DTOUCH_ENABLED -DFONTCONFIG_ENABLED -DALSA_ENABLED -DALSAMIDI_ENABLED -DPULSEAUDIO_ENABLED -D_REENTRANT -DDBUS_ENABLED -DSPEECHD_ENABLED -DXKB_ENABLED -DJOYDEV_ENABLED -DUDEV_ENABLED -DLINUXBSD_ENABLED -DUNIX_ENABLED -D_FILE_OFFSET_BITS=64 -DX11_ENABLED -DLIBDECOR_ENABLED -DWAYLAND_ENABLED -DVULKAN_ENABLED -DRD_ENABLED -DGLES3_ENABLED -DCRASH_HANDLER_ENABLED -DMINIZIP_ENABLED -DBROTLI_ENABLED -DTHREADS_ENABLED -DCLIPPER2_ENABLED -DZSTD_STATIC_LINKING_ONLY -Ithirdparty/zstd -Ithirdparty/zstd/common -Ithirdparty/zlib -Ithirdparty/clipper2/include -Ithirdparty/brotli/include -Ithirdparty/linuxbsd_headers/libdecor-0 -Ithirdparty/linuxbsd_headers/wayland -Ithirdparty/linuxbsd_headers -Iplatform/linuxbsd -I. thirdparty/zstd/decompress/huf_decompress.c
...
clang++ -o bin/godot.linuxbsd.editor.arm32.llvm.mono -static-libgcc -static-libstdc++ -s -O2 platform/linuxbsd/godot_linuxbsd.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/crash_handler_linuxbsd.linuxbsd.editor
.arm32.llvm.o platform/linuxbsd/os_linuxbsd.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/joypad_linux.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/freedesktop_portal_desktop.linuxbsd.editor.arm32.llvm.o plat
form/linuxbsd/freedesktop_screensaver.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/xkbcommon-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/x11/display_server_x11.linuxbsd.editor.arm32.llvm.o platform/
linuxbsd/x11/key_mapping_x11.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/x11/dynwrappers/xlib-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/x11/dynwrappers/xcursor-so_wrap.linuxbsd.editor.arm32.llvm.
o platform/linuxbsd/x11/dynwrappers/xinerama-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/x11/dynwrappers/xinput2-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/x11/dynwrappers/xrandr-so_wrap.l
inuxbsd.editor.arm32.llvm.o platform/linuxbsd/x11/dynwrappers/xrender-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/x11/dynwrappers/xext-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/x11/render
ing_context_driver_vulkan_x11.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/x11/gl_manager_x11_egl.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/x11/gl_manager_x11.linuxbsd.editor.arm32.llvm.o platform/linuxbs
d/x11/detect_prime_x11.linuxbsd.editor.arm32.llvm.o thirdparty/glad/glx.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/wayland.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol
/viewporter.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/fractional_scale.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/xdg_shell.gen.linuxbsd.editor.arm32.llvm.o pla
tform/linuxbsd/wayland/protocol/xdg_system_bell.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/xdg_foreign_v1.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/xdg_foreign_
v2.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/xdg_decoration.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/xdg_activation.gen.linuxbsd.editor.arm32.llvm.o platform/
linuxbsd/wayland/protocol/relative_pointer.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/pointer_constraints.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/pointer_gest
ures.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/primary_selection.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/idle_inhibit.gen.linuxbsd.editor.arm32.llvm.o platfo
rm/linuxbsd/wayland/protocol/tablet.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/protocol/text_input.gen.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/display_server_wayland.linuxbsd.edito
r.arm32.llvm.o platform/linuxbsd/wayland/wayland_thread.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/key_mapping_xkb.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/detect_prime_egl.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/dynwrappers/wayland-cursor-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/dynwrappers/wayland-client-core-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/dynwrappers/wayland-egl-core-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/dynwrappers/libdecor-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/rendering_context_driver_vulkan_wayland.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/egl_manager_wayland.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/wayland/egl_manager_wayland_gles.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/tts_linux.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/speechd-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/fontconfig-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/libudev-so_wrap.linuxbsd.editor.arm32.llvm.o platform/linuxbsd/dbus-so_wrap.linuxbsd.editor.arm32.llvm.o main/libmain.linuxbsd.editor.arm32.llvm.a modules/libmodules.linuxbsd.editor.arm32.llvm.a modules/libmodule_text_server_adv.linuxbsd.editor.arm32.llvm.a modules/libmodule_fbx.linuxbsd.editor.arm32.llvm.a modules/libmodule_gltf.linuxbsd.editor.arm32.llvm.a modules/libmodule_ktx.linuxbsd.editor.arm32.llvm.a modules/libmodule_msdfgen.linuxbsd.editor.arm32.llvm.a modules/libmodule_navigation.linuxbsd.editor.arm32.llvm.a modules/libmodule_theora.linuxbsd.editor.arm32.llvm.a modules/libmodule_vorbis.linuxbsd.editor.arm32.llvm.a modules/libmodule_astcenc.linuxbsd.editor.arm32.llvm.a modules/libmodule_basis_universal.linuxbsd.editor.arm32.llvm.a modules/libmodule_bcdec.linuxbsd.editor.arm32.llvm.a modules/libmodule_betsy.linuxbsd.editor.arm32.llvm.a modules/libmodule_bmp.linuxbsd.editor.arm32.llvm.a modules/libmodule_camera.linuxbsd.editor.arm32.llvm.a modules/libmodule_csg.linuxbsd.editor.arm32.llvm.a modules/libmodule_cvtt.linuxbsd.editor.arm32.llvm.a modules/libmodule_dds.linuxbsd.editor.arm32.llvm.a modules/libmodule_enet.linuxbsd.editor.arm32.llvm.a modules/libmodule_etcpak.linuxbsd.editor.arm32.llvm.a modules/libmodule_freetype.linuxbsd.editor.arm32.llvm.a modules/libmodule_gdscript.linuxbsd.editor.arm32.llvm.a modules/libmodule_glslang.linuxbsd.editor.arm32.llvm.a modules/libmodule_godot_physics_2d.linuxbsd.editor.arm32.llvm.a modules/libmodule_godot_physics_3d.linuxbsd.editor.arm32.llvm.a modules/libmodule_gridmap.linuxbsd.editor.arm32.llvm.a modules/libmodule_hdr.linuxbsd.editor.arm32.llvm.a modules/libmodule_interactive_music.linuxbsd.editor.arm32.llvm.a modules/libmodule_jolt_physics.linuxbsd.editor.arm32.llvm.a modules/libmodule_jpg.linuxbsd.editor.arm32.llvm.a modules/libmodule_jsonrpc.linuxbsd.editor.arm32.llvm.a modules/libmodule_lightmapper_rd.linuxbsd.editor.arm32.llvm.a modules/libmodule_mbedtls.linuxbsd.editor.arm32.llvm.a modules/libmodule_meshoptimizer.linuxbsd.editor.arm32.llvm.a modules/libmodule_minimp3.linuxbsd.editor.arm32.llvm.a modules/libmodule_mobile_vr.linuxbsd.editor.arm32.llvm.a modules/libmodule_mono.linuxbsd.editor.arm32.llvm.a modules/libmodule_multiplayer.linuxbsd.editor.arm32.llvm.a modules/libmodule_noise.linuxbsd.editor.arm32.llvm.a modules/libmodule_ogg.linuxbsd.editor.arm32.llvm.a modules/libmodule_openxr.linuxbsd.editor.arm32.llvm.a modules/libmodule_regex.linuxbsd.editor.arm32.llvm.a modules/libmodule_svg.linuxbsd.editor.arm32.llvm.a modules/libmodule_tga.linuxbsd.editor.arm32.llvm.a modules/libmodule_tinyexr.linuxbsd.editor.arm32.llvm.a modules/libmodule_upnp.linuxbsd.editor.arm32.llvm.a modules/libmodule_vhacd.linuxbsd.editor.arm32.llvm.a modules/libmodule_webp.linuxbsd.editor.arm32.llvm.a modules/libmodule_webrtc.linuxbsd.editor.arm32.llvm.a modules/libmodule_websocket.linuxbsd.editor.arm32.llvm.a modules/libmodule_webxr.linuxbsd.editor.arm32.llvm.a modules/libmodule_xatlas_unwrap.linuxbsd.editor.arm32.llvm.a modules/libmodule_zip.linuxbsd.editor.arm32.llvm.a platform/libplatform.linuxbsd.editor.arm32.llvm.a drivers/libdrivers.linuxbsd.editor.arm32.llvm.a editor/libeditor.linuxbsd.editor.arm32.llvm.a scene/libscene.linuxbsd.editor.arm32.llvm.a servers/libservers.linuxbsd.editor.arm32.llvm.a core/libcore.linuxbsd.editor.arm32.llvm.a modules/freetype/libfreetype_builtin.linuxbsd.editor.arm32.llvm.a modules/msdfgen/libmsdfgen_builtin.linuxbsd.editor.arm32.llvm.a modules/text_server_adv/libharfbuzz_builtin.linuxbsd.editor.arm32.llvm.a modules/text_server_adv/libgraphite_builtin.linuxbsd.editor.arm32.llvm.a modules/text_server_adv/libicu_builtin.linuxbsd.editor.arm32.llvm.a -lrt -lpthread -ldl -l:libatomic.a
...
/usr/bin/ld: core/libcore.linuxbsd.editor.arm32.llvm.a(huf_decompress.linuxbsd.editor.arm32.llvm.o): in function `HUF_decompress4X2_usingDTable_internal':
huf_decompress.c:(.text+0x206a): undefined reference to `HUF_decompress4X2_usingDTable_internal_fast_asm_loop'
/usr/bin/ld: core/libcore.linuxbsd.editor.arm32.llvm.a(huf_decompress.linuxbsd.editor.arm32.llvm.o): in function `HUF_decompress4X1_usingDTable_internal':
huf_decompress.c:(.text+0x3f6f): undefined reference to `HUF_decompress4X1_usingDTable_internal_fast_asm_loop'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Steps to reproduce
- Install Clang, libstdc++-static and libatomic-static on Linux (I tested Fedora 41 and Clang 19.1.7 from official repos)
- Compile with the above command
Minimal reproduction project (MRP)
n/a
WhalesState and FeralBytesWhalesState and boruok
Metadata
Metadata
Assignees
Type
Projects
Status
For team assessment