From 5d9813fca446841cc86eb9e0e26effb7e6509000 Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Sat, 17 Oct 2026 16:42:15 -0400 Subject: [PATCH] tools: link more targets with libatomic Signed-off-by: Aviv Keller --- tools/v8_gypfiles/v8.gyp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 71b6772bc345..806a1d14e26d 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1864,6 +1864,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',