From e2d50ab52249ef4b965be2ca1ccad39d5b44ff9c Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 26 Sep 2019 12:51:46 -0700 Subject: [PATCH 1/2] build: remove unused libatomic on ppc64, s390x The library is not necessary for ppc64 or s390x. It does no harm with some linkers, but devtoolset-6 creates runtime dependencies on all link libraries, even unused ones. Fixes: https://github.com/nodejs/node/issues/27377 Fixes: https://github.com/nodejs/node/issues/29718 --- tools/v8_gypfiles/v8.gyp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 00e285ec2c2025..a506a67dba6d42 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -795,7 +795,7 @@ }], # Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library # to implement atomic memory access - ['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "ppc64", "s390x"]', { + ['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc"]', { 'link_settings': { 'libraries': ['-latomic', ], }, From 3bfdb93b7a196c026d3b8630183209bb78f89413 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 26 Sep 2019 15:17:30 -0700 Subject: [PATCH 2/2] build: do not link against librt on linux --- node.gypi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node.gypi b/node.gypi index f1a29f5277b575..6954352b5e9c41 100644 --- a/node.gypi +++ b/node.gypi @@ -290,6 +290,11 @@ [ 'OS=="sunos"', { 'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ], }], + [ 'OS=="linux"', { + 'libraries!': [ + '-lrt' + ], + }], [ 'OS in "freebsd linux"', { 'ldflags': [ '-Wl,-z,relro', '-Wl,-z,now' ]