From 89f661dd665d7ac5f380cca5d91ebc90cb9e7312 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 PR-URL: https://github.com/nodejs/node/pull/55014 Reviewed-By: Matteo Collina Reviewed-By: Yagiz Nizipli --- 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 038647e635..9eaa1d219d 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1267,8 +1267,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', ], },