commit:     a4334df80c166f58063c8909c7cf80091f893476
Author:     mojyack <mojyack <AT> gmail <DOT> com>
AuthorDate: Sat Apr 19 13:17:03 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 15 00:07:33 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4334df8

net-libs/nodejs: allow to use libatomic-stub instead of gcc

llvm-runtimes/libatomic-stub provides libatomic.a,
so there is no reason to hard depend on gcc anymore.

also remove force libgcc hack.
this allows nodejs to be built with llvm alone.

[sam: Add another Bug tag.]

Bug: https://bugs.gentoo.org/869992
Bug: https://bugs.gentoo.org/911340
Signed-off-by: mojyack <mojyack <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/41567
Closes: https://github.com/gentoo/gentoo/pull/41567
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-libs/nodejs/nodejs-22.13.1.ebuild  | 11 ++++-------
 net-libs/nodejs/nodejs-22.16.0.ebuild  | 11 ++++-------
 net-libs/nodejs/nodejs-24.1.0.ebuild   | 11 ++++-------
 net-libs/nodejs/nodejs-24.2.0.ebuild   | 11 ++++-------
 net-libs/nodejs/nodejs-99999999.ebuild | 11 ++++-------
 5 files changed, 20 insertions(+), 35 deletions(-)

diff --git a/net-libs/nodejs/nodejs-22.13.1.ebuild 
b/net-libs/nodejs/nodejs-22.13.1.ebuild
index 981e2973a1b6..caf260d92e7b 100644
--- a/net-libs/nodejs/nodejs-22.13.1.ebuild
+++ b/net-libs/nodejs/nodejs-22.13.1.ebuild
@@ -48,7 +48,10 @@ RDEPEND=">=app-arch/brotli-1.1.0:=
                >=dev-libs/openssl-1.1.1:0=
        )
        !system-ssl? ( >=net-libs/ngtcp2-1.9.1:=[-gnutls] )
-       sys-devel/gcc:*"
+       || (
+               sys-devel/gcc:*
+               llvm-runtimes/libatomic-stub
+       )"
 BDEPEND="${PYTHON_DEPS}
        app-alternatives/ninja
        sys-apps/coreutils
@@ -128,12 +131,6 @@ src_configure() {
        tc-is-gcc && append-cxxflags -fno-tree-vectorize
        # https://bugs.gentoo.org/931514
        use arm64 && append-flags $(test-flags-CXX -mbranch-protection=none)
-       # nodejs unconditionally links to libatomic #869992
-       # specifically it requires __atomic_is_lock_free which
-       # is not yet implemented by llvm-runtimes/compiler-rt (see
-       # https://reviews.llvm.org/D85044?id=287068), therefore
-       # we depend on gcc and force using libgcc as the support lib
-       tc-is-clang && append-ldflags "--rtlib=libgcc --unwindlib=libgcc"
 
        local myconf=(
                --ninja

diff --git a/net-libs/nodejs/nodejs-22.16.0.ebuild 
b/net-libs/nodejs/nodejs-22.16.0.ebuild
index 6c5d7d165b91..0d75708c5901 100644
--- a/net-libs/nodejs/nodejs-22.16.0.ebuild
+++ b/net-libs/nodejs/nodejs-22.16.0.ebuild
@@ -48,7 +48,10 @@ RDEPEND=">=app-arch/brotli-1.1.0:=
                >=dev-libs/openssl-1.1.1:0=
        )
        !system-ssl? ( >=net-libs/ngtcp2-1.9.1:=[-gnutls] )
-       sys-devel/gcc:*"
+       || (
+               sys-devel/gcc:*
+               llvm-runtimes/libatomic-stub
+       )"
 BDEPEND="${PYTHON_DEPS}
        app-alternatives/ninja
        sys-apps/coreutils
@@ -128,12 +131,6 @@ src_configure() {
        tc-is-gcc && append-cxxflags -fno-tree-vectorize
        # https://bugs.gentoo.org/931514
        use arm64 && append-flags $(test-flags-CXX -mbranch-protection=none)
-       # nodejs unconditionally links to libatomic #869992
-       # specifically it requires __atomic_is_lock_free which
-       # is not yet implemented by llvm-runtimes/compiler-rt (see
-       # https://reviews.llvm.org/D85044?id=287068), therefore
-       # we depend on gcc and force using libgcc as the support lib
-       tc-is-clang && append-ldflags "--rtlib=libgcc --unwindlib=libgcc"
 
        local myconf=(
                --ninja

diff --git a/net-libs/nodejs/nodejs-24.1.0.ebuild 
b/net-libs/nodejs/nodejs-24.1.0.ebuild
index 250929d1e06d..56c0bc2d838d 100644
--- a/net-libs/nodejs/nodejs-24.1.0.ebuild
+++ b/net-libs/nodejs/nodejs-24.1.0.ebuild
@@ -48,7 +48,10 @@ RDEPEND=">=app-arch/brotli-1.1.0:=
                >=dev-libs/openssl-1.1.1:0=
        )
        !system-ssl? ( >=net-libs/ngtcp2-1.9.1:=[-gnutls] )
-       sys-devel/gcc:*"
+       || (
+               sys-devel/gcc:*
+               llvm-runtimes/libatomic-stub
+       )"
 BDEPEND="${PYTHON_DEPS}
        app-alternatives/ninja
        sys-apps/coreutils
@@ -125,12 +128,6 @@ src_configure() {
        tc-is-gcc && append-cxxflags -fno-tree-vectorize
        # https://bugs.gentoo.org/931514
        use arm64 && append-flags $(test-flags-CXX -mbranch-protection=none)
-       # nodejs unconditionally links to libatomic #869992
-       # specifically it requires __atomic_is_lock_free which
-       # is not yet implemented by llvm-runtimes/compiler-rt (see
-       # https://reviews.llvm.org/D85044?id=287068), therefore
-       # we depend on gcc and force using libgcc as the support lib
-       tc-is-clang && append-ldflags "--rtlib=libgcc --unwindlib=libgcc"
 
        local myconf=(
                --ninja

diff --git a/net-libs/nodejs/nodejs-24.2.0.ebuild 
b/net-libs/nodejs/nodejs-24.2.0.ebuild
index 250929d1e06d..56c0bc2d838d 100644
--- a/net-libs/nodejs/nodejs-24.2.0.ebuild
+++ b/net-libs/nodejs/nodejs-24.2.0.ebuild
@@ -48,7 +48,10 @@ RDEPEND=">=app-arch/brotli-1.1.0:=
                >=dev-libs/openssl-1.1.1:0=
        )
        !system-ssl? ( >=net-libs/ngtcp2-1.9.1:=[-gnutls] )
-       sys-devel/gcc:*"
+       || (
+               sys-devel/gcc:*
+               llvm-runtimes/libatomic-stub
+       )"
 BDEPEND="${PYTHON_DEPS}
        app-alternatives/ninja
        sys-apps/coreutils
@@ -125,12 +128,6 @@ src_configure() {
        tc-is-gcc && append-cxxflags -fno-tree-vectorize
        # https://bugs.gentoo.org/931514
        use arm64 && append-flags $(test-flags-CXX -mbranch-protection=none)
-       # nodejs unconditionally links to libatomic #869992
-       # specifically it requires __atomic_is_lock_free which
-       # is not yet implemented by llvm-runtimes/compiler-rt (see
-       # https://reviews.llvm.org/D85044?id=287068), therefore
-       # we depend on gcc and force using libgcc as the support lib
-       tc-is-clang && append-ldflags "--rtlib=libgcc --unwindlib=libgcc"
 
        local myconf=(
                --ninja

diff --git a/net-libs/nodejs/nodejs-99999999.ebuild 
b/net-libs/nodejs/nodejs-99999999.ebuild
index 6c5d7d165b91..0d75708c5901 100644
--- a/net-libs/nodejs/nodejs-99999999.ebuild
+++ b/net-libs/nodejs/nodejs-99999999.ebuild
@@ -48,7 +48,10 @@ RDEPEND=">=app-arch/brotli-1.1.0:=
                >=dev-libs/openssl-1.1.1:0=
        )
        !system-ssl? ( >=net-libs/ngtcp2-1.9.1:=[-gnutls] )
-       sys-devel/gcc:*"
+       || (
+               sys-devel/gcc:*
+               llvm-runtimes/libatomic-stub
+       )"
 BDEPEND="${PYTHON_DEPS}
        app-alternatives/ninja
        sys-apps/coreutils
@@ -128,12 +131,6 @@ src_configure() {
        tc-is-gcc && append-cxxflags -fno-tree-vectorize
        # https://bugs.gentoo.org/931514
        use arm64 && append-flags $(test-flags-CXX -mbranch-protection=none)
-       # nodejs unconditionally links to libatomic #869992
-       # specifically it requires __atomic_is_lock_free which
-       # is not yet implemented by llvm-runtimes/compiler-rt (see
-       # https://reviews.llvm.org/D85044?id=287068), therefore
-       # we depend on gcc and force using libgcc as the support lib
-       tc-is-clang && append-ldflags "--rtlib=libgcc --unwindlib=libgcc"
 
        local myconf=(
                --ninja

Reply via email to