diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index a267c0f9980..5d662dbe145 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', ], },