Commit 421ee551457 for nodejs
commit 421ee5514576aaeef273ed80be5c80c154e036eb
Author: Aviv Keller <me@aviv.sh>
Date: Sat Oct 17 16:42:15 2026 -0400
tools: link more targets with libatomic
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/66851
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
index 2d5d07f9cb0..2668d623e63 100644
--- a/tools/v8_gypfiles/v8.gyp
+++ b/tools/v8_gypfiles/v8.gyp
@@ -1866,6 +1866,14 @@
['node_shared_abseil=="false"', {
'dependencies': ['abseil.gyp:abseil'],
}],
+ # Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library
+ # to implement atomic memory access.
+ # Clang needs it for some atomic operations (https://clang.llvm.org/docs/Toolchain.html#atomics-library).
+ ['(OS=="linux" and clang==1) or (v8_current_cpu in ["mips64", "mips64el", "arm", "riscv64", "loong64"])', {
+ 'link_settings': {
+ 'libraries': ['-latomic', ],
+ },
+ }],
],
'defines!': [
'BUILDING_V8_SHARED=1',