Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 911340

Summary: net-libs/nodejs: potential erroneous dependency on GCC
Product: Gentoo Linux Reporter: Violet Purcell <vimproved>
Component: Current packagesAssignee: William Hubbs <williamh>
Status: UNCONFIRMED ---    
Severity: normal CC: ionen, sam
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=869992
https://github.com/gentoo/gentoo/pull/33141
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch

Description Violet Purcell 2023-07-27 20:31:44 UTC
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?
Comment 1 William Hubbs gentoo-dev 2023-07-28 18:39:53 UTC
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
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-28 18:57:44 UTC
Let me take a look first.
Comment 3 Violet Purcell 2023-08-11 21:31:04 UTC
(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.
Comment 4 Violet Purcell 2023-11-03 17:44:40 UTC
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.