nlk29
December 27, 2023, 11:45am
1
Godot Version
4.2
Question
Hi,
I’m trying to build Godot 4.2 on my arm64 Linux machine. However, when trying to build, I get a linker error saying it can’t find the std library.
/usr/bin/ld: cannot find -lstdc++: No such file or directory
collect2: error: ld returned 1 exit status
scons: *** [bin/godot.linuxbsd.editor.arm64] Error 1
scons: building terminated because of errors.
[Time elapsed: 00:12:25.710]
I already made sure that i’ve got all the dependencies like the std library installed.
I am running Fedora 39 on an arm64. (Apple M1)
Thank you for your responses.
1 Like
did the export window show any warning or error before you export linux build?
nlk29
December 27, 2023, 2:11pm
3
No. There was no warning.
this one has similar error status for issues found here:
opened 09:42AM - 30 Sep 21 UTC
bug
platform:linuxbsd
topic:buildsystem
confirmed
### Godot version
3.3.stable
### System information
GLES3
### Issue … description
```
[ 94%] modules/libmodules.x11.opt.tools.64.a(godotscript_editor.x11.opt.tools.64.o): In function `Thread::get_main_id()':
/data/godot33/./core/os/thread.h:67:(.text+0x1188): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against symbol `Thread::main_thread_id' defined in .bss section in core/libcore.x11.opt.tools.64.a(thread.x11.opt.tools.64.o)
/data/godot33/./core/os/thread.h:67: warning: Too many GOT entries for -fpic, please recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
[ 94%] scons: *** [bin/godot.x11.opt.tools.64] Error 1
scons: building terminated because of errors.
```
### Steps to reproduce
```
scons p=x11 tools=yes target=release_debug bits=64 -j8
```
### Minimal reproduction project
```
[ 94%] modules/libmodules.x11.opt.tools.64.a(gdscript_editor.x11.opt.tools.64.o): In function `Thread::get_main_id()':
/data/godot33/./core/os/thread.h:67:(.text+0x1188): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against symbol `Thread::main_thread_id' defined in .bss section in core/libcore.x11.opt.tools.64.a(thread.x11.opt.tools.64.o)
/data/godot33/./core/os/thread.h:67: warning: Too many GOT entries for -fpic, please recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
[ 94%] scons: *** [bin/godot.x11.opt.tools.64] Error 1
scons: building terminated because of errors.
```
nlk29
December 27, 2023, 2:55pm
5
Hi,
While this is a similar issue, this does not work for me.
I’ve got the same error message on F39 x86_64.
[100%] /usr/bin/ld: cannot find -lstdc++: No such file or directory
collect2: error: ld returned 1 exit status
scons: *** [bin/godot.linuxbsd.editor.x86_64] Error 1
After following the instruction for Fedora on Compiling for Linux, *BSD — Godot Engine (latest) documentation in English I’ve found that libstdc++-static
dependency was missing.
sudo dnf install libstdc++-static
That fixed the problem. I saw that headers for this lib were installed together with g++
, so I assumed that compiled library is also installed, but it was not.
1 Like
FWIW, Fedora discourages the use of static libraries for general purposes, so the .a
is quite often shoved into a separate package from -devel
.
1 Like