Skip to content

Commit 6f4086b

Browse files
refacknodejs-ci
authored andcommitted
deps,v8: link with atomic for platforms lacking CAS
Fixes: #81
1 parent f429b98 commit 6f4086b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

deps/v8/gypfiles/features.gypi

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
'variables': {
3232
'v8_target_arch%': '<(target_arch)',
3333

34+
'v8_current_cpu%': '<(target_arch)',
35+
3436
# Emulate GN variables
3537
'conditions': [
3638
['OS=="android"', { # GYP reverts OS to linux so use `-D OS=android`

deps/v8/gypfiles/v8.gyp

+12
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,18 @@
361361
'../src/builtins/builtins-intl-gen.cc',
362362
],
363363
}],
364+
# Platforms that don't have Compare-And-Swap support need to link atomic
365+
# library to implement atomic memory access
366+
[ 'v8_current_cpu == "mips" or v8_current_cpu == "mipsel" or '
367+
'v8_current_cpu == "mips64" or v8_current_cpu == "mips64el" or '
368+
'v8_current_cpu == "ppc" or v8_current_cpu == "ppc64" or '
369+
'v8_current_cpu == "s390" or v8_current_cpu == "s390x"',
370+
{
371+
'link_settings': {
372+
'libraries': [ '-latomic', ],
373+
},
374+
},
375+
],
364376
],
365377
}, # v8_initializers
366378
{

0 commit comments

Comments
 (0)