godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.21k stars 20.22k forks source link

Linux Godot Compile Failure #50345

Closed The-Sapphire-Starship closed 3 years ago

The-Sapphire-Starship commented 3 years ago

Godot version

3.3.2-stable

System information

rpi4, raspberry pi os, xfce desktop environment

Issue description

Im trying to compile godot on my raspberry pi, ive done it before but i lost the text file that had the command i was using in it and Im trying to figure out the command that will work again. Im using this command:

scons platform=x11 target=release_debug tools=yes use_llvm=yes CCFLAGS="-mcpu=cortex-a72 -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -mlittle-endian -munaligned-access" -j4 module_webm_enabled=no

Using that command im getting this error:

HEAD is now at 7610409b8a Bump version to 3.3.2-stable
scons: Reading SConscript files ...
Couldn't parse CXX environment variable to infer compiler version.
Enabling ALSA
Enabling PulseAudio
Enabling udev support
Couldn't parse CXX environment variable to infer compiler version.
Checking for C header file mntent.h... no
scons: done reading SConscript files.
scons: Building targets ...
[Initial build] Compiling ==> platform/x11/godot_x11.cpp
[Initial build] Compiling ==> platform/x11/context_gl_x11.cpp
sh: 1: clang++: not found
[Initial build] sh: 1: clang++: not found
[Initial build] Compiling ==> platform/x11/crash_handler_x11.cpp
sh: 1: clang++: not found
[Initial build] scons: *** [platform/x11/godot_x11.x11.opt.tools.32.llvm.o] Error 127
build_gles3_headers(["drivers/gles3/shaders/ssao_minify.glsl.gen.h"], ["drivers/gles3/shaders/ssao_minify.glsl"])
scons: *** [platform/x11/context_gl_x11.x11.opt.tools.32.llvm.o] Error 127
scons: *** [platform/x11/crash_handler_x11.x11.opt.tools.32.llvm.o] Error 127
scons: building terminated because of errors.

Any idea how to fix this?

Steps to reproduce

Try compiling godot using this command:

scons platform=x11 target=release_debug tools=yes use_llvm=yes CCFLAGS="-mcpu=cortex-a72 -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -mlittle-endian -munaligned-access" -j4 module_webm_enabled=no

on a rpi4 running raspberry pi os with xfce desktop environment

Minimal reproduction project

No response

Calinou commented 3 years ago

use_llvm=yes requires that you have the Clang compiler installed. If you only have GCC installed, do not pass use_llvm=yes to the SCons command line.

Also, you can probably remove the CCFLAGS override and stick with the default values.

The-Sapphire-Starship commented 3 years ago

Okay, ive ommited use_llvm=yes and CCFLAGS and it is currently compiling, i started with the command hiulit provides in his unofficial rpi godot github repo and made the edits i remember from the command i was using before, i will post here whether it was successful or not when it is done compiling

The-Sapphire-Starship commented 3 years ago

It was almost done but then it stopped:


[Initial build] /usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `Memory::alloc_static(unsigned int, bool)':
/usr/include/c++/8/bits/atomic_base.h:514: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:514: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:396: undefined reference to `__atomic_load_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:434: undefined reference to `__atomic_compare_exchange_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `Memory::realloc_static(void*, unsigned int, bool)':
/usr/include/c++/8/bits/atomic_base.h:514: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:396: undefined reference to `__atomic_load_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:434: undefined reference to `__atomic_compare_exchange_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:524: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `Memory::free_static(void*, bool)':
/usr/include/c++/8/bits/atomic_base.h:524: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:524: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `Memory::get_mem_usage()':
/usr/include/c++/8/bits/atomic_base.h:396: undefined reference to `__atomic_load_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `Memory::get_mem_max_usage()':
/usr/include/c++/8/bits/atomic_base.h:396: undefined reference to `__atomic_load_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `_GLOBAL__sub_I__ZnwjPKc':
/usr/include/c++/8/bits/atomic_base.h:374: undefined reference to `__atomic_store_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:374: undefined reference to `__atomic_store_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:374: undefined reference to `__atomic_store_8'
/usr/bin/ld: servers/libservers.x11.opt.tools.32.a(visual_server_wrap_mt.x11.opt.tools.32.o): in function `VisualServerWrapMT::thread_flush()':
/usr/include/c++/8/bits/atomic_base.h:524: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: servers/libservers.x11.opt.tools.32.a(visual_server_wrap_mt.x11.opt.tools.32.o): in function `VisualServerWrapMT::thread_draw(bool, double)':
/usr/include/c++/8/bits/atomic_base.h:524: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: servers/libservers.x11.opt.tools.32.a(visual_server_wrap_mt.x11.opt.tools.32.o): in function `VisualServerWrapMT::sync()':
/usr/include/c++/8/bits/atomic_base.h:514: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: servers/libservers.x11.opt.tools.32.a(visual_server_wrap_mt.x11.opt.tools.32.o): in function `VisualServerWrapMT::draw(bool, double)':
/usr/include/c++/8/bits/atomic_base.h:514: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: servers/libservers.x11.opt.tools.32.a(visual_server_wrap_mt.x11.opt.tools.32.o): in function `VisualServerWrapMT::VisualServerWrapMT(VisualServer*, bool)':
/usr/include/c++/8/bits/atomic_base.h:374: undefined reference to `__atomic_store_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(safe_refcount.x11.opt.tools.32.o): in function `check_lockless_atomics()':
/usr/include/c++/8/bits/atomic_base.h:354: undefined reference to `__atomic_is_lock_free'
collect2: error: ld returned 1 exit status
scons: *** [bin/godot.x11.opt.tools.32] Error 1
scons: building terminated because of errors.```
Calinou commented 3 years ago

This should have been fixed a while ago: https://github.com/godotengine/godot/issues/31407

The-Sapphire-Starship commented 3 years ago

im pretty sure i did git checkout 3.3.2-stable before running this but i can try again and make sure

The-Sapphire-Starship commented 3 years ago

it appears to pick up where it left off then end in the same error

The-Sapphire-Starship commented 3 years ago

@Calinou ^ Sorry if you don't like being mentioned like this, im just not sure if you have seen the new messages yet or not

Calinou commented 3 years ago

@Calinou ^ Sorry if you don't like being mentioned like this, im just not sure if you have seen the new messages yet or not

I've seen your messages, but I don't know what would be the cause of the error then.

bruvzg commented 3 years ago

Manually disabling modules and setting CCFLAGS should not be necessary if you are building on device (it's for cross-compiling only), at least current 3.x is building and running on the ARM64 version of Ubuntu 21.04 (QEMU/HVF VM on M1 mac).

undefined reference to `__atomic_fetch_add_8'

Try adding LINKFLAGS="-latomic" to the build command.

The-Sapphire-Starship commented 3 years ago

Adding LINKFLAGS="-latomic" worked! image image Thanks for the help! Here is the build command in full(just in case I loss it again and I can easily find it or just in case someone else is having the same problem you can refer them to this): scons platform=x11 target=release_debug tools=yes -j4 module_webm_enabled=no LINKFLAGS="-latomic"

The-Sapphire-Starship commented 3 years ago

Thank you for your help @Calinou and @bruvzg!

Calinou commented 3 years ago

Out of curiosity, does it work if you compile without LINKFLAGS="-latomic" but with use_static_cpp=no? If so, the cause of this issue is the same as https://github.com/godotengine/godot/issues/46375 (except with a different compiler this time).

The-Sapphire-Starship commented 3 years ago

Nope, it does not appear too:


Enabling ALSA
Enabling PulseAudio
Enabling udev support
Checking for C header file mntent.h... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
[ 96%] Linking Program        ==> bin/godot.x11.opt.tools.32
[100%] progress_finish(["progress_finish"], [])
[100%] /usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `Memory::alloc_static(unsigned int, bool)':
/usr/include/c++/8/bits/atomic_base.h:514: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:514: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:396: undefined reference to `__atomic_load_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:434: undefined reference to `__atomic_compare_exchange_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `Memory::realloc_static(void*, unsigned int, bool)':
/usr/include/c++/8/bits/atomic_base.h:514: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:396: undefined reference to `__atomic_load_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:434: undefined reference to `__atomic_compare_exchange_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:524: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `Memory::free_static(void*, bool)':
/usr/include/c++/8/bits/atomic_base.h:524: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:524: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `Memory::get_mem_usage()':
/usr/include/c++/8/bits/atomic_base.h:396: undefined reference to `__atomic_load_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `Memory::get_mem_max_usage()':
/usr/include/c++/8/bits/atomic_base.h:396: undefined reference to `__atomic_load_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(memory.x11.opt.tools.32.o): in function `_GLOBAL__sub_I__ZnwjPKc':
/usr/include/c++/8/bits/atomic_base.h:374: undefined reference to `__atomic_store_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:374: undefined reference to `__atomic_store_8'
/usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:374: undefined reference to `__atomic_store_8'
/usr/bin/ld: servers/libservers.x11.opt.tools.32.a(visual_server_wrap_mt.x11.opt.tools.32.o): in function `VisualServerWrapMT::thread_flush()':
/usr/include/c++/8/bits/atomic_base.h:524: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: servers/libservers.x11.opt.tools.32.a(visual_server_wrap_mt.x11.opt.tools.32.o): in function `VisualServerWrapMT::thread_draw(bool, double)':
/usr/include/c++/8/bits/atomic_base.h:524: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: servers/libservers.x11.opt.tools.32.a(visual_server_wrap_mt.x11.opt.tools.32.o): in function `VisualServerWrapMT::sync()':
/usr/include/c++/8/bits/atomic_base.h:514: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: servers/libservers.x11.opt.tools.32.a(visual_server_wrap_mt.x11.opt.tools.32.o): in function `VisualServerWrapMT::draw(bool, double)':
/usr/include/c++/8/bits/atomic_base.h:514: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: servers/libservers.x11.opt.tools.32.a(visual_server_wrap_mt.x11.opt.tools.32.o): in function `VisualServerWrapMT::VisualServerWrapMT(VisualServer*, bool)':
/usr/include/c++/8/bits/atomic_base.h:374: undefined reference to `__atomic_store_8'
/usr/bin/ld: core/libcore.x11.opt.tools.32.a(safe_refcount.x11.opt.tools.32.o): in function `check_lockless_atomics()':
/usr/include/c++/8/bits/atomic_base.h:354: undefined reference to `__atomic_is_lock_free'
collect2: error: ld returned 1 exit status
scons: *** [bin/godot.x11.opt.tools.32] Error 1
scons: building terminated because of errors.```