commit:     7dc748f875d8f1a7bda9d0b8c00d45ad4be2d58d
Author:     matoro <matoro <AT> users <DOT> noreply <DOT> github <DOT> com>
AuthorDate: Thu Sep 15 18:46:37 2022 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Sep 16 16:15:16 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7dc748f8

net-libs/nodejs: delete libatomic patch + force libgcc as support lib

Upstream behavior is correct wrt libatomic (unconditionally adding it)
due to their use of atomic_is_lock_free which is yet to be added to
compiler-rt (stuck in review hell at https://reviews.llvm.org/D85044).

This necessitates forcing libgcc as support lib.  Linking to libatomic
from gcc is dynamic, so sys-devel/gcc has to go in RDEPEND.  Clang can
be forced to use libgcc with --rtlib=libgcc, even with
USE=default-compiler-rt (which is the original cuase of the bug in
question).

Closes: https://bugs.gentoo.org/869992
Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 .../nodejs/files/nodejs-18.9.0-clang-fix-libatomic.patch | 16 ----------------
 net-libs/nodejs/nodejs-18.9.0.ebuild                     | 10 +++++++---
 2 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/net-libs/nodejs/files/nodejs-18.9.0-clang-fix-libatomic.patch 
b/net-libs/nodejs/files/nodejs-18.9.0-clang-fix-libatomic.patch
deleted file mode 100644
index 5296ed1318b0..000000000000
--- a/net-libs/nodejs/files/nodejs-18.9.0-clang-fix-libatomic.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-https://bugs.gentoo.org/869992
-
-diff --git a/node.gyp b/node.gyp
-index 347d82d2e1..8c4ffea256 100644
---- a/node.gyp
-+++ b/node.gyp
-@@ -117,9 +117,6 @@
-           '-Wl,-bnoerrmsg',
-         ],
-       }],
--      ['OS == "linux" and llvm_version != "0.0"', {
--        'libraries': ['-latomic'],
--      }],
-     ],
-   },
-

diff --git a/net-libs/nodejs/nodejs-18.9.0.ebuild 
b/net-libs/nodejs/nodejs-18.9.0.ebuild
index 03af59cf2a80..6c803a2495ee 100644
--- a/net-libs/nodejs/nodejs-18.9.0.ebuild
+++ b/net-libs/nodejs/nodejs-18.9.0.ebuild
@@ -38,7 +38,8 @@ RDEPEND=">=app-arch/brotli-1.0.9:=
        >=net-libs/nghttp2-1.41.0:=
        sys-libs/zlib
        system-icu? ( >=dev-libs/icu-67:= )
-       system-ssl? ( >=dev-libs/openssl-1.1.1:0= )"
+       system-ssl? ( >=dev-libs/openssl-1.1.1:0= )
+       sys-devel/gcc:*"
 BDEPEND="${PYTHON_DEPS}
        sys-apps/coreutils
        virtual/pkgconfig
@@ -50,7 +51,6 @@ DEPEND="${RDEPEND}"
 PATCHES=(
        "${FILESDIR}"/${PN}-12.22.5-shared_c-ares_nameser_h.patch
        "${FILESDIR}"/${PN}-15.2.0-global-npm-config.patch
-       "${FILESDIR}"/${P}-clang-fix-libatomic.patch
 )
 
 # These are measured on a loong machine with -ggdb on, and only checked
@@ -127,7 +127,11 @@ src_configure() {
        # LTO compiler flags are handled by configure.py itself
        filter-flags '-flto*'
        # nodejs unconditionally links to libatomic #869992
-       append-atomic-flags
+       # 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
+       tc-is-clang && append-ldflags "--rtlib=libgcc --unwindlib=libgcc"
 
        local myconf=(
                --shared-brotli

Reply via email to