Created attachment 866451 [details, diff] patch Currently, net-libs/nodejs hard depends on libgcc with this reasoning in the ebuild: # nodejs unconditionally links to libatomic #869992 # specifically it requires __atomic_is_lock_free which # is not yet implemented by sys-libs/compiler-rt (see # https://reviews.llvm.org/D85044?id=287068), therefore # we depend on gcc and force using libgcc as the support lib However, it seems that it was implemented in this commit: https://reviews.llvm.org/rG00530dee5d1295dc20ebafdd9a8a79662f41513e There is a note about the linked PR, saying "This function is also added in D85044, but that review also adds support for using lock-free atomics in more cases, whereas this is a minimal change that just adds __atomic_is_lock_free() for the implementation of atomic.c." However, nodejs builds and appears to function fine (all tests pass) with the unconditional link to libatomic removed (via the attached patch). Is this something that would be worthwhile raising upstream?
Nodejs 16.x is almost to end of life, but yes, if this is still an issue with nodejs 18 and 20, please file a bug upstream and link it to this bug. Thanks much. William
Let me take a look first.
(In reply to William Hubbs from comment #1) > Nodejs 16.x is almost to end of life, but yes, if this is still an issue > with nodejs 18 and 20, please file a bug upstream and link it to this > bug. > > Thanks much. > > William The patch was just named nodejs-16.10.0, it works with (and is still an issue in) latest version though. Sorry for the confusion.
Also see Chimera Linux's packaging of nodejs: https://github.com/chimera-linux/cports/tree/master/contrib/nodejs. They use nearly the same patch and support many architectures, so it should be a good reference until someone can properly test w/ gentoo.