Open Be-ing opened 2 years ago
Odd. How can that be a link error? Either the standard library has it or it doesn't surely?
Huh. Looks like there is such a thing as libatomic
. I had no idea. Interesting that it isn't necessary when using Clang on macOS.
If the only symbol undefined is the one that we use for diagnostic purposes only (i.e. is_lock_free
) and not any of the actual atomic ops, then it might actually be better to (at least conditionally) eliminate the diagnostic check than to add a system-specific library dependency. (Is libatomic
system-specific? I'm finding it surprisingly hard to find reliable info)
I found this issue: https://github.com/godotengine/godot/issues/46375. Installing the libatomic-static Fedora package as described in this comment resolved the issue. :shrug:
I'm unclear whether it should be the build system's responsibility to check for the availability of libatomic.
With environment variables
CC=clang
andCXX=clang++
when running Meson, the build fails with:The error is reproducible regardless of linker (mold, lld, GNU ld).
Compiling with GCC 12.1.1 works.