Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More architectures need -latomic to build godot #77645

Open
petterreinholdtsen opened this issue May 30, 2023 · 4 comments
Open

More architectures need -latomic to build godot #77645

petterreinholdtsen opened this issue May 30, 2023 · 4 comments

Comments

@petterreinholdtsen
Copy link

Godot version

3.5.1-stable

System information

Debian unstable on armel machine.

Issue description

Similar to the issue in #54393 for FreeBSD, Linux builds on at least armel and riscv64 also need to be linked to the atomic library. I tried to modify the scons build rules to get this working on armel, but had to give up as none of the approaches I tried worked. I tried modifying platform/x11/detect.py. The issue is reported to Debian as https://bugs.debian.org/1019868.

This is the proposed fix for the debian build, solving the issue outside scons:

diff --git a/debian/rules b/debian/rules
index f46330e3..51ceee03 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,11 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
 
+# Link with libatomic on archs where it is needed.
+ifeq ($(DEB_HOST_ARCH),$(filter $(GCC_MINOR),armel riscv64))
+       export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed
+endif
+
 override_dh_clean:
        dh_clean
        scons -c

Steps to reproduce

Try building 3.5.1 on Debian unstable using a armel machine.

Minimal reproduction project

N/A

@akien-mga
Copy link
Member

Thanks for the report. We don't typically support nor test armel, on the ARM side we support armv7hl (Linux, Android, ~Windows) and arm64-v8 (Linux, Android, macOS, iOS, ~Windows).

I believe Debian's armel is for older armv5 generation chipsets? Is this the only change you had to do to get Godot to compile? Beyond compiling to satisfy distro packaging requirements, does it actually work?

@petterreinholdtsen
Copy link
Author

I only got it to the point where it compiled and built .deb packages. Only got remote ssh access to a armel machine, so not able to test it any further. But the need for libatomic will be needed on any architecture where gcc inject calls to it for types not nativley atomic.

@LinuxUserGD
Copy link
Contributor

For Linux GCC libatomic might not be necessary, see error for x86_64-gentoo-linux-musl with standalone LLVM/Clang/libc++ toolchain after uninstalling GCC on Gentoo Linux, which is similar to FreeBSD:

x86_64-gentoo-linux-musl-ld.lld: error: unable to find library -latomic
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [bin/godot.linuxbsd.template_release.x86_64.llvm.runner] Error 1
scons: building terminated because of errors.

@petterreinholdtsen
Copy link
Author

petterreinholdtsen commented Jul 24, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants