Linker fails; handle_crash(int); Godot 3.x on Alpine Linux 3.12

StripStrip Posts: 2Member
edited November 2020 in Optimizing and Exporting

Can anyone help point me in the right direction. Scons help returns no issues so the build environment is ok I presume. The project is compiling to 100% so that must be ok, the linking fails.

Is this Alpine specific problem or QEMU/KVM or some obscure linker issue?

QEMU/KVM on Ubuntu 18.04.5 LTS, building Godot inside Virtual Machine using Alpine Linux 3.12 (latest standard version). Installed all required dependencies for Godot dedicated server build environment. Getting more or less same error even with older stable versions of Godot from Git. What am I missing here? Even if i use more optimized export template the error is the same.

git init
cd .git
git clone -b 3.2 https://github.com/godotengine/godot
cd godot
scons help
-- no problems with build environment
scons -j8 platform=server use_llvm=yes tools=no target=release_debug

[Initial build] Linking Static Library ==> core/libcore.x11.opt.debug.64.llvm.a
Ranlib Library         ==> core/libcore.x11.opt.debug.64.llvm.a
[Initial build] Linking Program        ==> bin/godot_server.x11.opt.debug.64.llvm
/usr/bin/ld: platform/x11/crash_handler_x11.x11.opt.debug.64.llvm.o: in function `handle_crash(int)':
/root/.git/godot/platform/x11/crash_handler_x11.cpp:54: undefined reference to `backtrace'
/usr/bin/ld: /root/.git/godot/platform/x11/crash_handler_x11.cpp:70: undefined reference to `backtrace_symbols'
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [bin/godot_server.x11.opt.debug.64.llvm] Error 1
scons: building terminated because of errors.

delete godot folder entirely and clone new folder from Git

cd .git
git clone -b 3.1 https://github.com/godotengine/godot
cd godot
scons help
-- no problems with build environment
scons -j8 platform=server use_llvm=yes tools=no target=release_debug

[Initial build] Linking Program        ==> bin/godot_server.x11.opt.debug.64.llvm
/usr/bin/ld: platform/x11/crash_handler_x11.x11.opt.debug.64.llvm.o: in function `handle_crash(int)':
/root/.git/godot/platform/x11/crash_handler_x11.cpp:54: undefined reference to `backtrace'
/usr/bin/ld: /root/.git/godot/platform/x11/crash_handler_x11.cpp:70: undefined reference to `backtrace_symbols'
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [bin/godot_server.x11.opt.debug.64.llvm] Error 1
scons: building terminated because of errors.

Tags :

Comments

  • TwistedTwiglegTwistedTwigleg Posts: 4,621Admin

    Welcome to the forums @Strip!

    Looking at the error report in the second console, it looks like the issue is that the crash_handler_x11.cpp file, on line 70, cannot find a reference to backtrace_symbols. This probably means that the OS you are using is not exposing the expected functions to X11, though I am just making an educated guess.

    That said, it should compile fine on Ubuntu, as I am using Ubuntu 20.04 LTS and everything works there (I've also used Ubuntu 16 LTS as well). Have you tried compiling Godot 3.2? Maybe its a Godot 3.1 specific bug. Outside of that, I am not totally sure.

  • StripStrip Posts: 2Member

    Found more info here: https://github.com/awslabs/aws-c-common/issues/322

    Some Linux systems do not provide execinfo.h in their libc. For example: Android and Alpine Linux

    What you need to do is to install seperate package that contains this linked library:
    apk add libexecinfo-dev

    But that is not enough. You need to include additional linker flag in scons build command. The problem happens in linking stage so we fix it using predefined scons Godot parameter variable LINKFLAGS and assign it to "-lexecinfo" as in "The library that is missing / non-standard for your Linux distro".

    Example:
    scons -j8 platform=server use_llvm=yes tools=no target=release_debug verbose=yes LINKFLAGS=-lexecinfo

    Built server Godot 3.1 and 3.2 with no issues this way.

    I hope this information helps someone else. Maybe this can be fixed in scons Godot configuration file, yes, no?

    Alpine is one of the smallest Linux distros perfect for Docker containers. I encorage you to give it a try and learn about Docker.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file