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', ], },