From d967b6587191cdfe04213eeaf14c9eba4c59e65d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 19 Sep 2024 20:07:03 +0200 Subject: [PATCH] build: link V8 with atomic library Closes: https://github.com/nodejs/node-v8/issues/290 --- tools/v8_gypfiles/v8.gyp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 75cc19d7f0b..3a9f2a8c2da 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1222,8 +1222,9 @@ 'dependencies': ['postmortem-metadata#target'], }], # Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library - # to implement atomic memory access - ['v8_current_cpu in ["mips64", "mips64el", "arm", "riscv64", "loong64"]', { + # 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', ], },