Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler-rt supports `__atomic_is_lock_free` since LLVM 12[0]. Requiring `-latomic` on clang builds introduces a dependency on libgcc, which is often undesirable on LLVM-based build environments. This change makes sure it's never added in clang builds, so it can use the compiler-rt's implementation, making it possible to build Node.js on Linux systems with LLVM as the main toolchain, without having to install GCC. compiler-rt's `__atomic_is_lock_free` works on all architectures, so there is no need to to link libatomic for mips64, ppc, arm, riscv etc. as well, as long as clang is used. Similar patch was already adopted or discussed in: * Chimera Linux * https://github.com/chimera-linux/cports/blob/master/contrib/nodejs/patches/no-libatomic.patch * Gentoo (LLVM profiles) * https://bugs.gentoo.org/869992 * https://bugs.gentoo.org/911340 * gentoo/gentoo#33141 [0] llvm/llvm-project@00530de
- Loading branch information