summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMCApollo <34170230+MCApollo@users.noreply.github.com>2020-05-27 23:54:18 -0700
committerMCApollo <34170230+MCApollo@users.noreply.github.com>2020-05-27 23:54:18 -0700
commit55762f063a98e091f362e68b0c12c3bebe037114 (patch)
treea22fbe9c5e69669cd125bc5aae5c139fb3b1b2d9
parent8aa826ef31578d7d1738744c506d6996be92121a (diff)
Updates to NodeJS: recreated patches to support current release
-rw-r--r--data/nodejs/abs.diff26
-rw-r--r--data/nodejs/configure-ios.diff210
-rw-r--r--data/nodejs/gyp.diff60
-rw-r--r--data/nodejs/make.sh2
-rw-r--r--data/nodejs/nodejs-mobile-filecopy.diff11
-rw-r--r--data/nodejs/v8.diff4170
-rw-r--r--data/nodejs/xcode_emulation.diff29
7 files changed, 4264 insertions, 244 deletions
diff --git a/data/nodejs/abs.diff b/data/nodejs/abs.diff
new file mode 100644
index 000000000..6365ace38
--- /dev/null
+++ b/data/nodejs/abs.diff
@@ -0,0 +1,26 @@
+diff -Naur node-v12.3.1/deps/v8/src/objects/bigint.cc node-v12.3.1+iPhone/deps/v8/src/objects/bigint.cc
+--- node-v12.3.1/deps/v8/src/objects/bigint.cc 2019-05-22 05:21:53.000000000 -0700
++++ node-v12.3.1+iPhone/deps/v8/src/objects/bigint.cc 2019-09-16 08:29:40.000000000 -0700
+@@ -819,7 +819,7 @@
+ STATIC_ASSERT(sizeof(digit_t) >= sizeof(value));
+ return (x->length() == 1) && (x->sign() == (value < 0)) &&
+ (x->digit(0) ==
+- static_cast<digit_t>(std::abs(static_cast<int64_t>(value))));
++ static_cast<digit_t>(std::fabs(static_cast<int64_t>(value))));
+ }
+ DCHECK(y->IsHeapNumber());
+ double value = Handle<HeapNumber>::cast(y)->value();
+@@ -843,7 +843,7 @@
+ STATIC_ASSERT(sizeof(digit_t) >= sizeof(y_value));
+ if (x->length() > 1) return AbsoluteGreater(x_sign);
+
+- digit_t abs_value = std::abs(static_cast<int64_t>(y_value));
++ digit_t abs_value = std::fabs(static_cast<int64_t>(y_value));
+ digit_t x_digit = x->digit(0);
+ if (x_digit > abs_value) return AbsoluteGreater(x_sign);
+ if (x_digit < abs_value) return AbsoluteLess(x_sign);
+diff -Naur node-v12.3.1/log node-v12.3.1+iPhone/log
+--- node-v12.3.1/log 1969-12-31 16:00:00.000000000 -0800
++++ node-v12.3.1+iPhone/log 2019-09-16 08:29:56.000000000 -0700
+@@ -0,0 +1 @@
++zsh: no such file or directory: ../../make.sh
diff --git a/data/nodejs/configure-ios.diff b/data/nodejs/configure-ios.diff
index 053234802..a28a532de 100644
--- a/data/nodejs/configure-ios.diff
+++ b/data/nodejs/configure-ios.diff
@@ -1,16 +1,25 @@
-diff -ur node-v12.3.1/common.gypi node-v12.3.1+iPhone/common.gypi
---- node-v12.3.1/common.gypi 2019-05-22 12:21:51.000000000 +0000
-+++ node-v12.3.1+iPhone/common.gypi 2019-05-25 00:16:01.809813352 +0000
-@@ -95,7 +95,7 @@
- 'os_posix': 1,
- 'v8_postmortem_support%': 1,
- }],
-- ['OS == "mac"', {
-+ ['OS == "mac" or OS=="ios"', {
- 'obj_dir%': '<(PRODUCT_DIR)/obj.target',
- 'v8_base': '<(PRODUCT_DIR)/libv8_base.a',
- }],
-@@ -104,7 +104,7 @@
+diff -Naur node-v12.17.0/common.gypi node-v12.17.0+iPhone/common.gypi
+--- node-v12.17.0/common.gypi 2020-05-26 04:53:30.000000000 -0700
++++ node-v12.17.0+iPhone/common.gypi 2020-05-27 19:35:19.000000000 -0700
+@@ -100,7 +100,7 @@
+ 'obj_dir': '<(PRODUCT_DIR)/obj',
+ 'v8_base': '<(PRODUCT_DIR)/lib/libv8_snapshot.a',
+ }],
+- ['OS == "mac"', {
++ ['OS == "mac" or OS == "ios"', {
+ 'obj_dir%': '<(PRODUCT_DIR)/obj.target',
+ 'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a',
+ }],
+@@ -118,7 +118,7 @@
+ 'obj_dir': '<(PRODUCT_DIR)/obj',
+ 'v8_base': '<(PRODUCT_DIR)/lib/libv8_nosnapshot.a',
+ }],
+- ['OS == "mac"', {
++ ['OS == "mac" or OS == "ios"', {
+ 'obj_dir%': '<(PRODUCT_DIR)/obj.target',
+ 'v8_base': '<(PRODUCT_DIR)/libv8_nosnapshot.a',
+ }],
+@@ -129,7 +129,7 @@
}, {
'openssl_product': '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)',
}],
@@ -18,8 +27,8 @@ diff -ur node-v12.3.1/common.gypi node-v12.3.1+iPhone/common.gypi
+ ['OS=="mac" or OS=="ios"', {
'clang%': 1,
}],
- ],
-@@ -172,7 +172,7 @@
+ ['target_arch in "ppc64 s390x"', {
+@@ -200,7 +200,7 @@
# pull in V8's postmortem metadata
'ldflags': [ '-Wl,-z,allextract' ]
}],
@@ -28,7 +37,7 @@ diff -ur node-v12.3.1/common.gypi node-v12.3.1+iPhone/common.gypi
'cflags': [ '-fno-omit-frame-pointer' ],
}],
['OS=="linux"', {
-@@ -293,7 +293,7 @@
+@@ -314,7 +314,7 @@
[ 'target_arch=="arm64"', {
'msvs_configuration_platform': 'arm64',
}],
@@ -37,7 +46,7 @@ diff -ur node-v12.3.1/common.gypi node-v12.3.1+iPhone/common.gypi
'cflags+': [
'-fno-omit-frame-pointer',
'-fsanitize=address',
-@@ -302,7 +302,7 @@
+@@ -324,7 +324,7 @@
'cflags!': [ '-fomit-frame-pointer' ],
'ldflags': [ '-fsanitize=address' ],
}],
@@ -46,7 +55,7 @@ diff -ur node-v12.3.1/common.gypi node-v12.3.1+iPhone/common.gypi
'xcode_settings': {
'OTHER_CFLAGS+': [
'-fno-omit-frame-pointer',
-@@ -425,6 +425,21 @@
+@@ -457,6 +457,21 @@
}],
],
}],
@@ -68,7 +77,7 @@ diff -ur node-v12.3.1/common.gypi node-v12.3.1+iPhone/common.gypi
['OS=="mac"', {
'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
'xcode_settings': {
-@@ -436,7 +451,6 @@
+@@ -468,7 +483,6 @@
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'PREBINDING': 'NO', # No -Wl,-prebind
@@ -76,7 +85,7 @@ diff -ur node-v12.3.1/common.gypi node-v12.3.1+iPhone/common.gypi
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
-@@ -465,6 +479,9 @@
+@@ -497,6 +511,9 @@
['target_arch=="x64"', {
'xcode_settings': {'ARCHS': ['x86_64']},
}],
@@ -86,19 +95,19 @@ diff -ur node-v12.3.1/common.gypi node-v12.3.1+iPhone/common.gypi
['clang==1', {
'xcode_settings': {
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
-diff -ur node-v12.3.1/configure.py node-v12.3.1+iPhone/configure.py
---- node-v12.3.1/configure.py 2019-05-22 12:21:51.000000000 +0000
-+++ node-v12.3.1+iPhone/configure.py 2019-05-25 00:16:01.809813352 +0000
-@@ -44,7 +44,7 @@
+diff -Naur node-v12.17.0/configure.py node-v12.17.0+iPhone/configure.py
+--- node-v12.17.0/configure.py 2020-05-26 04:53:30.000000000 -0700
++++ node-v12.17.0+iPhone/configure.py 2020-05-27 19:37:54.000000000 -0700
+@@ -46,7 +46,7 @@
+ # parse our options
parser = optparse.OptionParser()
- valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux',
-- 'android', 'aix', 'cloudabi')
-+ 'ios', 'android', 'aix', 'cloudabi')
- valid_arch = ('arm', 'arm64', 'ia32', 'ppc',
- 'ppc64', 'x32','x64', 'x86', 'x86_64', 's390', 's390x')
- valid_arm_float_abi = ('soft', 'softfp', 'hard')
-@@ -908,6 +908,8 @@
+-valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux',
++valid_os = ('win', 'ios', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux',
+ 'android', 'aix', 'cloudabi')
+ valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc',
+ 'ppc64', 'x32','x64', 'x86', 'x86_64', 's390x')
+@@ -1008,6 +1008,8 @@
def configure_node(o):
if options.dest_os == 'android':
o['variables']['OS'] = 'android'
@@ -106,24 +115,19 @@ diff -ur node-v12.3.1/configure.py node-v12.3.1+iPhone/configure.py
+ o['variables']['OS'] = 'ios'
o['variables']['node_prefix'] = options.prefix
o['variables']['node_install_npm'] = b(not options.without_npm)
- o['variables']['node_report'] = b(not options.without_report)
-@@ -1069,12 +1071,7 @@
- o['variables']['node_shared'] = b(options.shared)
- node_module_version = getmoduleversion.get_version()
-
-- if sys.platform == 'darwin':
-- shlib_suffix = '%s.dylib'
-- elif sys.platform.startswith('aix'):
-- shlib_suffix = '%s.a'
-- else:
-- shlib_suffix = 'so.%s'
-+ shlib_suffix = '%s.dylib'
+ o['variables']['debug_node'] = b(options.debug_node)
+@@ -1157,7 +1159,7 @@
- shlib_suffix %= node_module_version
- o['variables']['node_module_version'] = int(node_module_version)
-diff -ur node-v12.3.1/deps/brotli/brotli.gyp node-v12.3.1+iPhone/deps/brotli/brotli.gyp
---- node-v12.3.1/deps/brotli/brotli.gyp 2019-05-22 12:21:51.000000000 +0000
-+++ node-v12.3.1+iPhone/deps/brotli/brotli.gyp 2019-05-25 00:16:01.809813352 +0000
+ if options.dest_os == 'android':
+ shlib_suffix = 'so'
+- elif sys.platform == 'darwin':
++ elif sys.platform == 'darwin' or True:
+ shlib_suffix = '%s.dylib'
+ elif sys.platform.startswith('aix'):
+ shlib_suffix = '%s.a'
+diff -Naur node-v12.17.0/deps/brotli/brotli.gyp node-v12.17.0+iPhone/deps/brotli/brotli.gyp
+--- node-v12.17.0/deps/brotli/brotli.gyp 2020-05-26 04:53:30.000000000 -0700
++++ node-v12.17.0+iPhone/deps/brotli/brotli.gyp 2020-05-27 19:25:53.000000000 -0700
@@ -15,7 +15,7 @@
'OS_FREEBSD'
]
@@ -133,10 +137,10 @@ diff -ur node-v12.3.1/deps/brotli/brotli.gyp node-v12.3.1+iPhone/deps/brotli/bro
'defines': [
'OS_MACOSX'
]
-diff -ur node-v12.3.1/deps/cares/cares.gyp node-v12.3.1+iPhone/deps/cares/cares.gyp
---- node-v12.3.1/deps/cares/cares.gyp 2019-05-22 12:21:51.000000000 +0000
-+++ node-v12.3.1+iPhone/deps/cares/cares.gyp 2019-05-25 00:16:01.813813354 +0000
-@@ -145,7 +145,7 @@
+diff -Naur node-v12.17.0/deps/cares/cares.gyp node-v12.17.0+iPhone/deps/cares/cares.gyp
+--- node-v12.17.0/deps/cares/cares.gyp 2020-05-26 04:53:30.000000000 -0700
++++ node-v12.17.0+iPhone/deps/cares/cares.gyp 2020-05-27 19:25:53.000000000 -0700
+@@ -153,7 +153,7 @@
'include_dirs': [ 'config/linux' ],
'sources': [ 'config/linux/ares_config.h' ]
}],
@@ -145,10 +149,10 @@ diff -ur node-v12.3.1/deps/cares/cares.gyp node-v12.3.1+iPhone/deps/cares/cares.
'include_dirs': [ 'config/darwin' ],
'sources': [ 'config/darwin/ares_config.h' ]
}],
-diff -ur node-v12.3.1/deps/npm/node_modules/node-gyp/addon.gypi node-v12.3.1+iPhone/deps/npm/node_modules/node-gyp/addon.gypi
---- node-v12.3.1/deps/npm/node_modules/node-gyp/addon.gypi 2019-05-22 12:21:51.000000000 +0000
-+++ node-v12.3.1+iPhone/deps/npm/node_modules/node-gyp/addon.gypi 2019-05-25 00:16:01.813813354 +0000
-@@ -79,7 +79,7 @@
+diff -Naur node-v12.17.0/deps/npm/node_modules/node-gyp/addon.gypi node-v12.17.0+iPhone/deps/npm/node_modules/node-gyp/addon.gypi
+--- node-v12.17.0/deps/npm/node_modules/node-gyp/addon.gypi 2020-05-26 04:53:30.000000000 -0700
++++ node-v12.17.0+iPhone/deps/npm/node_modules/node-gyp/addon.gypi 2020-05-27 19:25:53.000000000 -0700
+@@ -89,7 +89,7 @@
],
'conditions': [
@@ -157,9 +161,9 @@ diff -ur node-v12.3.1/deps/npm/node_modules/node-gyp/addon.gypi node-v12.3.1+iPh
'defines': [
'_DARWIN_USE_64_BIT_INODE=1'
],
-diff -ur node-v12.3.1/deps/npm/node_modules/node-gyp/gyp/tools/emacs/testdata/media.gyp node-v12.3.1+iPhone/deps/npm/node_modules/node-gyp/gyp/tools/emacs/testdata/media.gyp
---- node-v12.3.1/deps/npm/node_modules/node-gyp/gyp/tools/emacs/testdata/media.gyp 2019-05-22 12:21:51.000000000 +0000
-+++ node-v12.3.1+iPhone/deps/npm/node_modules/node-gyp/gyp/tools/emacs/testdata/media.gyp 2019-05-25 00:16:01.813813354 +0000
+diff -Naur node-v12.17.0/deps/npm/node_modules/node-gyp/gyp/tools/emacs/testdata/media.gyp node-v12.17.0+iPhone/deps/npm/node_modules/node-gyp/gyp/tools/emacs/testdata/media.gyp
+--- node-v12.17.0/deps/npm/node_modules/node-gyp/gyp/tools/emacs/testdata/media.gyp 2020-05-26 04:53:30.000000000 -0700
++++ node-v12.17.0+iPhone/deps/npm/node_modules/node-gyp/gyp/tools/emacs/testdata/media.gyp 2020-05-27 19:25:53.000000000 -0700
@@ -545,12 +545,12 @@
'base/simd/scale_yuv_to_rgb_sse2_x64.asm',
],
@@ -220,10 +224,10 @@ diff -ur node-v12.3.1/deps/npm/node_modules/node-gyp/gyp/tools/emacs/testdata/me
'conditions': [
['linux_use_tcmalloc==1', {
'dependencies': [
-diff -ur node-v12.3.1/deps/uv/common.gypi node-v12.3.1+iPhone/deps/uv/common.gypi
---- node-v12.3.1/deps/uv/common.gypi 2019-05-22 12:21:52.000000000 +0000
-+++ node-v12.3.1+iPhone/deps/uv/common.gypi 2019-05-25 00:16:01.813813354 +0000
-@@ -168,6 +168,13 @@
+diff -Naur node-v12.17.0/deps/uv/common.gypi node-v12.17.0+iPhone/deps/uv/common.gypi
+--- node-v12.17.0/deps/uv/common.gypi 2020-05-26 04:53:32.000000000 -0700
++++ node-v12.17.0+iPhone/deps/uv/common.gypi 2020-05-27 19:25:53.000000000 -0700
+@@ -169,6 +169,13 @@
}],
],
}],
@@ -237,10 +241,10 @@ diff -ur node-v12.3.1/deps/uv/common.gypi node-v12.3.1+iPhone/deps/uv/common.gyp
['OS=="mac"', {
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
-diff -ur node-v12.3.1/deps/uv/uv.gyp node-v12.3.1+iPhone/deps/uv/uv.gyp
---- node-v12.3.1/deps/uv/uv.gyp 2019-05-22 12:21:52.000000000 +0000
-+++ node-v12.3.1+iPhone/deps/uv/uv.gyp 2019-05-25 00:16:01.813813354 +0000
-@@ -198,7 +198,7 @@
+diff -Naur node-v12.17.0/deps/uv/uv.gyp node-v12.17.0+iPhone/deps/uv/uv.gyp
+--- node-v12.17.0/deps/uv/uv.gyp 2020-05-26 04:53:32.000000000 -0700
++++ node-v12.17.0+iPhone/deps/uv/uv.gyp 2020-05-27 19:25:53.000000000 -0700
+@@ -201,7 +201,7 @@
}],
],
}],
@@ -249,30 +253,10 @@ diff -ur node-v12.3.1/deps/uv/uv.gyp node-v12.3.1+iPhone/deps/uv/uv.gyp
# This will cause gyp to set soname
# Must correspond with UV_VERSION_MAJOR
# in include/uv/version.h
-diff -ur node-v12.3.1/node.gyp node-v12.3.1+iPhone/node.gyp
---- node-v12.3.1/node.gyp 2019-05-22 12:21:54.000000000 +0000
-+++ node-v12.3.1+iPhone/node.gyp 2019-05-25 12:01:52.868864501 +0000
-@@ -351,9 +351,8 @@
- 'conditions': [
- ['OS!="aix"', {
- 'ldflags': [
-- '-Wl,--whole-archive,<(obj_dir)/<(STATIC_LIB_PREFIX)'
-+ '-Wl,-force_load,<(obj_dir)/<(STATIC_LIB_PREFIX)'
- '<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
-- '-Wl,--no-whole-archive',
- ],
- }],
- [ 'OS=="win"', {
-@@ -414,7 +413,7 @@
- },
- },
- }],
-- ['want_separate_host_toolset==0', {
-+ ['want_separate_host_toolset==1', {
- 'dependencies': [
- 'mkcodecache',
- ],
-@@ -760,7 +759,7 @@
+diff -Naur node-v12.17.0/node.gyp node-v12.17.0+iPhone/node.gyp
+--- node-v12.17.0/node.gyp 2020-05-26 04:53:34.000000000 -0700
++++ node-v12.17.0+iPhone/node.gyp 2020-05-27 19:25:53.000000000 -0700
+@@ -845,7 +845,7 @@
'<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o'
],
}],
@@ -281,7 +265,7 @@ diff -ur node-v12.3.1/node.gyp node-v12.3.1+iPhone/node.gyp
'sources': [
'src/node_dtrace_ustack.cc',
'src/node_dtrace_provider.cc',
-@@ -939,7 +938,7 @@
+@@ -993,7 +993,7 @@
'target_name': 'node_dtrace_provider',
'type': 'none',
'conditions': [
@@ -290,7 +274,7 @@ diff -ur node-v12.3.1/node.gyp node-v12.3.1+iPhone/node.gyp
'actions': [
{
'action_name': 'node_dtrace_provider_o',
-@@ -974,7 +973,7 @@
+@@ -1028,7 +1028,7 @@
'target_name': 'node_dtrace_ustack',
'type': 'none',
'conditions': [
@@ -299,32 +283,32 @@ diff -ur node-v12.3.1/node.gyp node-v12.3.1+iPhone/node.gyp
'actions': [
{
'action_name': 'node_dtrace_ustack_constants',
-diff -ur node-v12.3.1/node.gypi node-v12.3.1+iPhone/node.gypi
---- node-v12.3.1/node.gypi 2019-05-22 12:21:54.000000000 +0000
-+++ node-v12.3.1+iPhone/node.gypi 2019-05-25 12:03:43.012932500 +0000
-@@ -143,9 +143,8 @@
+diff -Naur node-v12.17.0/node.gypi node-v12.17.0+iPhone/node.gypi
+--- node-v12.17.0/node.gypi 2020-05-26 04:53:34.000000000 -0700
++++ node-v12.17.0+iPhone/node.gypi 2020-05-27 19:43:41.000000000 -0700
+@@ -134,9 +134,7 @@
'conditions': [
['OS!="aix" and node_shared=="false"', {
'ldflags': [
-- '-Wl,--whole-archive,'
-+ '-Wl,-force_load,'
- '<(obj_dir)/deps/zlib/<(STATIC_LIB_PREFIX)zlib<(STATIC_LIB_SUFFIX)',
+- '-Wl,--whole-archive',
+- '<(obj_dir)/deps/zlib/<(STATIC_LIB_PREFIX)zlib<(STATIC_LIB_SUFFIX)',
- '-Wl,--no-whole-archive',
++ '-Wl,-force_load,<(obj_dir)/deps/zlib/<(STATIC_LIB_PREFIX)zlib<(STATIC_LIB_SUFFIX)',
],
}],
],
-@@ -184,9 +183,8 @@
+@@ -174,9 +172,7 @@
'conditions': [
['OS!="aix" and node_shared=="false"', {
'ldflags': [
-- '-Wl,--whole-archive,'
-+ '-Wl,-force_load,'
- '<(obj_dir)/deps/uv/<(STATIC_LIB_PREFIX)uv<(STATIC_LIB_SUFFIX)',
+- '-Wl,--whole-archive',
+- '<(obj_dir)/deps/uv/<(STATIC_LIB_PREFIX)uv<(STATIC_LIB_SUFFIX)',
- '-Wl,--no-whole-archive',
++ '-Wl,-force_load,<(obj_dir)/deps/uv/<(STATIC_LIB_PREFIX)uv<(STATIC_LIB_SUFFIX)',
],
}],
],
-@@ -202,7 +200,7 @@
+@@ -192,7 +188,7 @@
'dependencies': [ 'deps/brotli/brotli.gyp:brotli' ],
}],
@@ -333,9 +317,9 @@ diff -ur node-v12.3.1/node.gypi node-v12.3.1+iPhone/node.gypi
# linking Corefoundation is needed since certain OSX debugging tools
# like Instruments require it for some features
'libraries': [ '-framework CoreFoundation' ],
-diff -ur node-v12.3.1/tools/v8_gypfiles/d8.gyp node-v12.3.1+iPhone/tools/v8_gypfiles/d8.gyp
---- node-v12.3.1/tools/v8_gypfiles/d8.gyp 2019-05-22 12:21:55.000000000 +0000
-+++ node-v12.3.1+iPhone/tools/v8_gypfiles/d8.gyp 2019-05-25 00:16:01.817813355 +0000
+diff -Naur node-v12.17.0/tools/v8_gypfiles/d8.gyp node-v12.17.0+iPhone/tools/v8_gypfiles/d8.gyp
+--- node-v12.17.0/tools/v8_gypfiles/d8.gyp 2020-05-26 04:53:35.000000000 -0700
++++ node-v12.17.0+iPhone/tools/v8_gypfiles/d8.gyp 2020-05-27 19:25:53.000000000 -0700
@@ -43,7 +43,7 @@
'd8_js2c#host',
],
@@ -344,11 +328,11 @@ diff -ur node-v12.3.1/tools/v8_gypfiles/d8.gyp node-v12.3.1+iPhone/tools/v8_gypf
+ ['(OS=="linux" or OS=="mac" or OS=="ios" or OS=="freebsd" or OS=="netbsd" \
or OS=="openbsd" or OS=="solaris" or OS=="android" \
or OS=="qnx" or OS=="aix")', {
- 'sources': [ '../src/d8-posix.cc', ]
-diff -ur node-v12.3.1/tools/v8_gypfiles/v8.gyp node-v12.3.1+iPhone/tools/v8_gypfiles/v8.gyp
---- node-v12.3.1/tools/v8_gypfiles/v8.gyp 2019-05-22 12:21:55.000000000 +0000
-+++ node-v12.3.1+iPhone/tools/v8_gypfiles/v8.gyp 2019-05-25 00:16:01.817813355 +0000
-@@ -128,6 +128,12 @@
+ 'sources': [ '<(V8_ROOT)/src/d8/d8-posix.cc', ]
+diff -Naur node-v12.17.0/tools/v8_gypfiles/v8.gyp node-v12.17.0+iPhone/tools/v8_gypfiles/v8.gyp
+--- node-v12.17.0/tools/v8_gypfiles/v8.gyp 2020-05-26 04:53:35.000000000 -0700
++++ node-v12.17.0+iPhone/tools/v8_gypfiles/v8.gyp 2020-05-27 19:25:53.000000000 -0700
+@@ -1442,6 +1442,12 @@
'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']
},
}],
diff --git a/data/nodejs/gyp.diff b/data/nodejs/gyp.diff
index bf41b1113..f3fb126f1 100644
--- a/data/nodejs/gyp.diff
+++ b/data/nodejs/gyp.diff
@@ -1,7 +1,7 @@
-diff -ur node-v12.2.0/tools/gyp/pylib/gyp/generator/make.py node-v12.2.0+iPhone/tools/gyp/pylib/gyp/generator/make.py
---- node-v12.2.0/tools/gyp/pylib/gyp/generator/make.py 2019-05-07 14:52:16.000000000 +0000
-+++ node-v12.2.0+iPhone/tools/gyp/pylib/gyp/generator/make.py 2019-05-23 02:23:10.400738717 +0000
-@@ -173,8 +173,25 @@
+diff -Naur node-v12.17.0/tools/gyp/pylib/gyp/generator/make.py node-v12.17.0+iPhone/tools/gyp/pylib/gyp/generator/make.py
+--- node-v12.17.0/tools/gyp/pylib/gyp/generator/make.py 2020-05-26 04:53:35.000000000 -0700
++++ node-v12.17.0+iPhone/tools/gyp/pylib/gyp/generator/make.py 2020-05-27 20:02:34.000000000 -0700
+@@ -175,8 +175,25 @@
"""
LINK_COMMANDS_MAC = """\
@@ -29,48 +29,16 @@ diff -ur node-v12.2.0/tools/gyp/pylib/gyp/generator/make.py node-v12.2.0+iPhone/
quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
-@@ -2033,41 +2049,9 @@
- 'srcdir': srcdir,
- 'copy_archive_args': copy_archive_arguments,
+@@ -2066,7 +2083,11 @@
+ 'CXX.host': GetEnvironFallback(('CXX_host', 'CXX'), 'g++'),
+ 'LINK.host': GetEnvironFallback(('LINK_host', 'LINK'), '$(CXX.host)'),
}
- if flavor == 'mac':
-- flock_command = './gyp-mac-tool flock'
-- header_params.update({
-- 'flock': flock_command,
-- 'flock_index': 2,
-- 'link_commands': LINK_COMMANDS_MAC,
-- 'extra_commands': SHARED_HEADER_MAC_COMMANDS,
-- })
-- elif flavor == 'android':
-- header_params.update({
-- 'link_commands': LINK_COMMANDS_ANDROID,
-- })
-- elif flavor == 'solaris':
-- header_params.update({
-- 'flock': './gyp-flock-tool flock',
-- 'flock_index': 2,
-- })
-- elif flavor == 'freebsd':
-- # Note: OpenBSD has sysutils/flock. lockf seems to be FreeBSD specific.
-- header_params.update({
-- 'flock': 'lockf',
-- })
-- elif flavor == 'openbsd':
-- copy_archive_arguments = '-pPRf'
-- header_params.update({
-- 'copy_archive_args': copy_archive_arguments,
-- })
-- elif flavor == 'aix':
-- copy_archive_arguments = '-pPRf'
-- header_params.update({
-- 'copy_archive_args': copy_archive_arguments,
-- 'link_commands': LINK_COMMANDS_AIX,
-- 'flock': './gyp-flock-tool flock',
-- 'flock_index': 2,
-- })
-+ header_params.update({
-+ 'link_commands': LINK_COMMANDS_IOS,
++ if flavor == 'ios' or True:
++ header_params.update({
++ 'link_commands': LINK_COMMANDS_IOS,
+ })
-
- header_params.update({
- 'CC.target': GetEnvironFallback(('CC_target', 'CC'), '$(CC)'),
++ elif flavor == 'mac':
+ flock_command = './gyp-mac-tool flock'
+ header_params.update({
+ 'flock': flock_command,
diff --git a/data/nodejs/make.sh b/data/nodejs/make.sh
index 3e1d29dc4..0ca457745 100644
--- a/data/nodejs/make.sh
+++ b/data/nodejs/make.sh
@@ -25,7 +25,7 @@ export LDFLAGS_target="${LDFLAGS}"
GYP_CROSSCOMPILE=1 \
GYP_DEFINES="v8_enable_inspector=1 target_arch=arm64 v8_target_arch=arm64 host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')" \
PKG_CONFIG="$(realpath "${PKG_BASE}/util/pkg-config.sh")" \
-./configure --prefix="${PKG_TAPF}" --without-snapshot --cross-compiling --dest-os=ios --dest-cpu=arm64 --without-intl --shared-zlib --shared-cares --shared-openssl --shared-nghttp2 --shared
+./configure --prefix="${PKG_TAPF}" --cross-compiling --dest-os=ios --dest-cpu=arm64 --without-intl --shared-zlib --shared-cares --shared-openssl --shared-nghttp2 --shared
# Don't use pkg:make, CC_host gets overwritten
SDKROOT="" \
diff --git a/data/nodejs/nodejs-mobile-filecopy.diff b/data/nodejs/nodejs-mobile-filecopy.diff
index 600d96c96..f6b571850 100644
--- a/data/nodejs/nodejs-mobile-filecopy.diff
+++ b/data/nodejs/nodejs-mobile-filecopy.diff
@@ -1,10 +1,13 @@
---- node-v12.17.0/deps/uv/src/unix/fs.c 2020-05-26 06:53:32.000000000 -0500
-+++ node-v12.17.0+iPhone/deps/uv/src/unix/fs.c 2020-05-27 00:54:19.883409601 -0500
-@@ -1102,6 +1102,17 @@
+diff -Naur node-v12.17.0/deps/uv/src/unix/fs.c node-v12.17.0+iPhone/deps/uv/src/unix/fs.c
+--- node-v12.17.0/deps/uv/src/unix/fs.c 2020-05-26 04:53:32.000000000 -0700
++++ node-v12.17.0+iPhone/deps/uv/src/unix/fs.c 2020-05-27 20:56:16.000000000 -0700
+@@ -1102,6 +1102,19 @@
}
static ssize_t uv__fs_copyfile(uv_fs_t* req) {
+#if defined(__APPLE__)
++#include <copyfile.h>
++
+ /* On macOS, use the native copyfile(3). */
+ copyfile_flags_t flags;
+
@@ -18,7 +21,7 @@
uv_fs_t fs_req;
uv_file srcfd;
uv_file dstfd;
-@@ -1258,6 +1269,7 @@
+@@ -1258,6 +1271,7 @@
errno = UV__ERR(result);
return -1;
diff --git a/data/nodejs/v8.diff b/data/nodejs/v8.diff
index aed571fa6..3d621957b 100644
--- a/data/nodejs/v8.diff
+++ b/data/nodejs/v8.diff
@@ -1,19 +1,7 @@
-diff -ur node-v12.3.1/deps/v8/src/arm64/cpu-arm64.cc node-v12.3.1+iPhone/deps/v8/src/arm64/cpu-arm64.cc
---- node-v12.3.1/deps/v8/src/arm64/cpu-arm64.cc 2019-05-22 12:21:52.000000000 +0000
-+++ node-v12.3.1+iPhone/deps/v8/src/arm64/cpu-arm64.cc 2019-05-24 19:37:47.406732128 +0000
-@@ -15,7 +15,7 @@
- class CacheLineSizes {
- public:
- CacheLineSizes() {
--#if !defined(V8_HOST_ARCH_ARM64) || defined(V8_OS_WIN)
-+#if !defined(V8_HOST_ARCH_ARM64) || defined(V8_OS_WIN) || defined(V8_OS_IPHONEOS) || defined(__IPHONEOS__)
- cache_type_register_ = 0;
- #else
- // Copy the content of the cache type register to a core register.
-diff -ur node-v12.3.1/deps/v8/src/base/platform/platform-posix.cc node-v12.3.1+iPhone/deps/v8/src/base/platform/platform-posix.cc
---- node-v12.3.1/deps/v8/src/base/platform/platform-posix.cc 2019-05-22 12:21:52.000000000 +0000
-+++ node-v12.3.1+iPhone/deps/v8/src/base/platform/platform-posix.cc 2019-05-24 19:40:15.582804009 +0000
-@@ -240,6 +240,8 @@
+diff -Naur node-v12.17.0/deps/v8/src/base/platform/platform-posix.cc node-v12.17.0+iPhone/deps/v8/src/base/platform/platform-posix.cc
+--- node-v12.17.0/deps/v8/src/base/platform/platform-posix.cc 2020-05-26 04:53:32.000000000 -0700
++++ node-v12.17.0+iPhone/deps/v8/src/base/platform/platform-posix.cc 2020-05-27 20:28:31.000000000 -0700
+@@ -246,6 +246,8 @@
// 42 bits of virtual addressing. Truncate to 40 bits to allow kernel chance
// to fulfill request.
raw_addr &= uint64_t{0xFFFFFF0000};
@@ -22,10 +10,1073 @@ diff -ur node-v12.3.1/deps/v8/src/base/platform/platform-posix.cc node-v12.3.1+i
#else
raw_addr &= 0x3FFFF000;
-diff -ur node-v12.3.1/tools/v8_gypfiles/toolchain.gypi node-v12.3.1+iPhone/tools/v8_gypfiles/toolchain.gypi
---- node-v12.3.1/tools/v8_gypfiles/toolchain.gypi 2019-05-22 12:21:55.000000000 +0000
-+++ node-v12.3.1+iPhone/tools/v8_gypfiles/toolchain.gypi 2019-05-24 19:35:58.206678803 +0000
-@@ -84,7 +84,9 @@
+diff -Naur node-v12.17.0/deps/v8/src/base/platform/platform-posix.cc.orig node-v12.17.0+iPhone/deps/v8/src/base/platform/platform-posix.cc.orig
+--- node-v12.17.0/deps/v8/src/base/platform/platform-posix.cc.orig 1969-12-31 16:00:00.000000000 -0800
++++ node-v12.17.0+iPhone/deps/v8/src/base/platform/platform-posix.cc.orig 2020-05-27 20:26:53.000000000 -0700
+@@ -0,0 +1,924 @@
++// Copyright 2012 the V8 project authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++// Platform-specific code for POSIX goes here. This is not a platform on its
++// own, but contains the parts which are the same across the POSIX platforms
++// Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX.
++
++#include <errno.h>
++#include <limits.h>
++#include <pthread.h>
++#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++#include <pthread_np.h> // for pthread_set_name_np
++#endif
++#include <sched.h> // for sched_yield
++#include <stdio.h>
++#include <time.h>
++#include <unistd.h>
++
++#include <sys/mman.h>
++#include <sys/stat.h>
++#include <sys/time.h>
++#include <sys/types.h>
++#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \
++ defined(__NetBSD__) || defined(__OpenBSD__)
++#include <sys/sysctl.h> // NOLINT, for sysctl
++#endif
++
++#if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
++#define LOG_TAG "v8"
++#include <android/log.h> // NOLINT
++#endif
++
++#include <cmath>
++#include <cstdlib>
++
++#include "src/base/platform/platform-posix.h"
++
++#include "src/base/lazy-instance.h"
++#include "src/base/macros.h"
++#include "src/base/platform/platform.h"
++#include "src/base/platform/time.h"
++#include "src/base/utils/random-number-generator.h"
++
++#ifdef V8_FAST_TLS_SUPPORTED
++#include <atomic>
++#endif
++
++#if V8_OS_MACOSX
++#include <dlfcn.h>
++#endif
++
++#if V8_OS_LINUX
++#include <sys/prctl.h> // NOLINT, for prctl
++#endif
++
++#if defined(V8_OS_FUCHSIA)
++#include <zircon/process.h>
++#else
++#include <sys/resource.h>
++#endif
++
++#if !defined(_AIX) && !defined(V8_OS_FUCHSIA)
++#include <sys/syscall.h>
++#endif
++
++#if V8_OS_FREEBSD || V8_OS_MACOSX || V8_OS_OPENBSD || V8_OS_SOLARIS
++#define MAP_ANONYMOUS MAP_ANON
++#endif
++
++#if defined(V8_OS_SOLARIS)
++#if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__)
++extern "C" int madvise(caddr_t, size_t, int);
++#else
++extern int madvise(caddr_t, size_t, int);
++#endif
++#endif
++
++#ifndef MADV_FREE
++#define MADV_FREE MADV_DONTNEED
++#endif
++
++namespace v8 {
++namespace base {
++
++namespace {
++
++// 0 is never a valid thread id.
++const pthread_t kNoThread = static_cast<pthread_t>(0);
++
++bool g_hard_abort = false;
++
++const char* g_gc_fake_mmap = nullptr;
++
++DEFINE_LAZY_LEAKY_OBJECT_GETTER(RandomNumberGenerator,
++ GetPlatformRandomNumberGenerator)
++static LazyMutex rng_mutex = LAZY_MUTEX_INITIALIZER;
++
++#if !V8_OS_FUCHSIA
++#if V8_OS_MACOSX
++// kMmapFd is used to pass vm_alloc flags to tag the region with the user
++// defined tag 255 This helps identify V8-allocated regions in memory analysis
++// tools like vmmap(1).
++const int kMmapFd = VM_MAKE_TAG(255);
++#else // !V8_OS_MACOSX
++const int kMmapFd = -1;
++#endif // !V8_OS_MACOSX
++
++const int kMmapFdOffset = 0;
++
++int GetProtectionFromMemoryPermission(OS::MemoryPermission access) {
++ switch (access) {
++ case OS::MemoryPermission::kNoAccess:
++ return PROT_NONE;
++ case OS::MemoryPermission::kRead:
++ return PROT_READ;
++ case OS::MemoryPermission::kReadWrite:
++ return PROT_READ | PROT_WRITE;
++ case OS::MemoryPermission::kReadWriteExecute:
++ return PROT_READ | PROT_WRITE | PROT_EXEC;
++ case OS::MemoryPermission::kReadExecute:
++ return PROT_READ | PROT_EXEC;
++ }
++ UNREACHABLE();
++}
++
++int GetFlagsForMemoryPermission(OS::MemoryPermission access) {
++ int flags = MAP_PRIVATE | MAP_ANONYMOUS;
++ if (access == OS::MemoryPermission::kNoAccess) {
++#if !V8_OS_AIX && !V8_OS_FREEBSD && !V8_OS_QNX
++ flags |= MAP_NORESERVE;
++#endif // !V8_OS_AIX && !V8_OS_FREEBSD && !V8_OS_QNX
++#if V8_OS_QNX
++ flags |= MAP_LAZY;
++#endif // V8_OS_QNX
++ }
++ return flags;
++}
++
++void* Allocate(void* hint, size_t size, OS::MemoryPermission access) {
++ int prot = GetProtectionFromMemoryPermission(access);
++ int flags = GetFlagsForMemoryPermission(access);
++ void* result = mmap(hint, size, prot, flags, kMmapFd, kMmapFdOffset);
++ if (result == MAP_FAILED) return nullptr;
++ return result;
++}
++
++#endif // !V8_OS_FUCHSIA
++
++} // namespace
++
++void OS::Initialize(bool hard_abort, const char* const gc_fake_mmap) {
++ g_hard_abort = hard_abort;
++ g_gc_fake_mmap = gc_fake_mmap;
++}
++
++int OS::ActivationFrameAlignment() {
++#if V8_TARGET_ARCH_ARM
++ // On EABI ARM targets this is required for fp correctness in the
++ // runtime system.
++ return 8;
++#elif V8_TARGET_ARCH_MIPS
++ return 8;
++#elif V8_TARGET_ARCH_S390
++ return 8;
++#else
++ // Otherwise we just assume 16 byte alignment, i.e.:
++ // - With gcc 4.4 the tree vectorization optimizer can generate code
++ // that requires 16 byte alignment such as movdqa on x86.
++ // - Mac OS X, PPC and Solaris (64-bit) activation frames must
++ // be 16 byte-aligned; see "Mac OS X ABI Function Call Guide"
++ return 16;
++#endif
++}
++
++// static
++size_t OS::AllocatePageSize() {
++ return static_cast<size_t>(sysconf(_SC_PAGESIZE));
++}
++
++// static
++size_t OS::CommitPageSize() {
++ static size_t page_size = getpagesize();
++ return page_size;
++}
++
++// static
++void OS::SetRandomMmapSeed(int64_t seed) {
++ if (seed) {
++ MutexGuard guard(rng_mutex.Pointer());
++ GetPlatformRandomNumberGenerator()->SetSeed(seed);
++ }
++}
++
++// static
++void* OS::GetRandomMmapAddr() {
++ uintptr_t raw_addr;
++ {
++ MutexGuard guard(rng_mutex.Pointer());
++ GetPlatformRandomNumberGenerator()->NextBytes(&raw_addr, sizeof(raw_addr));
++ }
++#if defined(__APPLE__)
++#if V8_TARGET_ARCH_ARM64
++ DCHECK_EQ(1 << 14, AllocatePageSize());
++ raw_addr = RoundDown(raw_addr, 1 << 14);
++#endif
++#endif
++#if defined(V8_USE_ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \
++ defined(THREAD_SANITIZER) || defined(LEAK_SANITIZER)
++ // If random hint addresses interfere with address ranges hard coded in
++ // sanitizers, bad things happen. This address range is copied from TSAN
++ // source but works with all tools.
++ // See crbug.com/539863.
++ raw_addr &= 0x007fffff0000ULL;
++ raw_addr += 0x7e8000000000ULL;
++#else
++#if V8_TARGET_ARCH_X64
++ // Currently available CPUs have 48 bits of virtual addressing. Truncate
++ // the hint address to 46 bits to give the kernel a fighting chance of
++ // fulfilling our placement request.
++ raw_addr &= uint64_t{0x3FFFFFFFF000};
++#elif V8_TARGET_ARCH_PPC64
++#if V8_OS_AIX
++ // AIX: 64 bits of virtual addressing, but we limit address range to:
++ // a) minimize Segment Lookaside Buffer (SLB) misses and
++ raw_addr &= uint64_t{0x3FFFF000};
++ // Use extra address space to isolate the mmap regions.
++ raw_addr += uint64_t{0x400000000000};
++#elif V8_TARGET_BIG_ENDIAN
++ // Big-endian Linux: 42 bits of virtual addressing.
++ raw_addr &= uint64_t{0x03FFFFFFF000};
++#else
++ // Little-endian Linux: 46 bits of virtual addressing.
++ raw_addr &= uint64_t{0x3FFFFFFF0000};
++#endif
++#elif V8_TARGET_ARCH_S390X
++ // Linux on Z uses bits 22-32 for Region Indexing, which translates to 42 bits
++ // of virtual addressing. Truncate to 40 bits to allow kernel chance to
++ // fulfill request.
++ raw_addr &= uint64_t{0xFFFFFFF000};
++#elif V8_TARGET_ARCH_S390
++ // 31 bits of virtual addressing. Truncate to 29 bits to allow kernel chance
++ // to fulfill request.
++ raw_addr &= 0x1FFFF000;
++#elif V8_TARGET_ARCH_MIPS64
++ // 42 bits of virtual addressing. Truncate to 40 bits to allow kernel chance
++ // to fulfill request.
++ raw_addr &= uint64_t{0xFFFFFF0000};
++#else
++ raw_addr &= 0x3FFFF000;
++
++#ifdef __sun
++ // For our Solaris/illumos mmap hint, we pick a random address in the bottom
++ // half of the top half of the address space (that is, the third quarter).
++ // Because we do not MAP_FIXED, this will be treated only as a hint -- the
++ // system will not fail to mmap() because something else happens to already
++ // be mapped at our random address. We deliberately set the hint high enough
++ // to get well above the system's break (that is, the heap); Solaris and
++ // illumos will try the hint and if that fails allocate as if there were
++ // no hint at all. The high hint prevents the break from getting hemmed in
++ // at low values, ceding half of the address space to the system heap.
++ raw_addr += 0x80000000;
++#elif V8_OS_AIX
++ // The range 0x30000000 - 0xD0000000 is available on AIX;
++ // choose the upper range.
++ raw_addr += 0x90000000;
++#else
++ // The range 0x20000000 - 0x60000000 is relatively unpopulated across a
++ // variety of ASLR modes (PAE kernel, NX compat mode, etc) and on macos
++ // 10.6 and 10.7.
++ raw_addr += 0x20000000;
++#endif
++#endif
++#endif
++ return reinterpret_cast<void*>(raw_addr);
++}
++
++// TODO(bbudge) Move Cygwin and Fuchsia stuff into platform-specific files.
++#if !V8_OS_CYGWIN && !V8_OS_FUCHSIA
++// static
++void* OS::Allocate(void* hint, size_t size, size_t alignment,
++ MemoryPermission access) {
++ size_t page_size = AllocatePageSize();
++ DCHECK_EQ(0, size % page_size);
++ DCHECK_EQ(0, alignment % page_size);
++ hint = AlignedAddress(hint, alignment);
++ // Add the maximum misalignment so we are guaranteed an aligned base address.
++ size_t request_size = size + (alignment - page_size);
++ request_size = RoundUp(request_size, OS::AllocatePageSize());
++ void* result = base::Allocate(hint, request_size, access);
++ if (result == nullptr) return nullptr;
++
++ // Unmap memory allocated before the aligned base address.
++ uint8_t* base = static_cast<uint8_t*>(result);
++ uint8_t* aligned_base = reinterpret_cast<uint8_t*>(
++ RoundUp(reinterpret_cast<uintptr_t>(base), alignment));
++ if (aligned_base != base) {
++ DCHECK_LT(base, aligned_base);
++ size_t prefix_size = static_cast<size_t>(aligned_base - base);
++ CHECK(Free(base, prefix_size));
++ request_size -= prefix_size;
++ }
++ // Unmap memory allocated after the potentially unaligned end.
++ if (size != request_size) {
++ DCHECK_LT(size, request_size);
++ size_t suffix_size = request_size - size;
++ CHECK(Free(aligned_base + size, suffix_size));
++ request_size -= suffix_size;
++ }
++
++ DCHECK_EQ(size, request_size);
++ return static_cast<void*>(aligned_base);
++}
++
++// static
++bool OS::Free(void* address, const size_t size) {
++ DCHECK_EQ(0, reinterpret_cast<uintptr_t>(address) % AllocatePageSize());
++ DCHECK_EQ(0, size % AllocatePageSize());
++ return munmap(address, size) == 0;
++}
++
++// static
++bool OS::Release(void* address, size_t size) {
++ DCHECK_EQ(0, reinterpret_cast<uintptr_t>(address) % CommitPageSize());
++ DCHECK_EQ(0, size % CommitPageSize());
++ return munmap(address, size) == 0;
++}
++
++// static
++bool OS::SetPermissions(void* address, size_t size, MemoryPermission access) {
++ DCHECK_EQ(0, reinterpret_cast<uintptr_t>(address) % CommitPageSize());
++ DCHECK_EQ(0, size % CommitPageSize());
++
++ int prot = GetProtectionFromMemoryPermission(access);
++ int ret = mprotect(address, size, prot);
++ if (ret == 0 && access == OS::MemoryPermission::kNoAccess) {
++ // This is advisory; ignore errors and continue execution.
++ USE(DiscardSystemPages(address, size));
++ }
++
++// For accounting purposes, we want to call MADV_FREE_REUSE on macOS after
++// changing permissions away from OS::MemoryPermission::kNoAccess. Since this
++// state is not kept at this layer, we always call this if access != kNoAccess.
++// The cost is a syscall that effectively no-ops.
++// TODO(erikchen): Fix this to only call MADV_FREE_REUSE when necessary.
++// https://crbug.com/823915
++#if defined(OS_MACOSX)
++ if (access != OS::MemoryPermission::kNoAccess)
++ madvise(address, size, MADV_FREE_REUSE);
++#endif
++
++ return ret == 0;
++}
++
++bool OS::DiscardSystemPages(void* address, size_t size) {
++ DCHECK_EQ(0, reinterpret_cast<uintptr_t>(address) % CommitPageSize());
++ DCHECK_EQ(0, size % CommitPageSize());
++#if defined(OS_MACOSX)
++ // On OSX, MADV_FREE_REUSABLE has comparable behavior to MADV_FREE, but also
++ // marks the pages with the reusable bit, which allows both Activity Monitor
++ // and memory-infra to correctly track the pages.
++ int ret = madvise(address, size, MADV_FREE_REUSABLE);
++#elif defined(_AIX) || defined(V8_OS_SOLARIS)
++ int ret = madvise(reinterpret_cast<caddr_t>(address), size, MADV_FREE);
++#else
++ int ret = madvise(address, size, MADV_FREE);
++#endif
++ if (ret != 0 && errno == ENOSYS)
++ return true; // madvise is not available on all systems.
++ if (ret != 0 && errno == EINVAL) {
++// MADV_FREE only works on Linux 4.5+ . If request failed, retry with older
++// MADV_DONTNEED . Note that MADV_FREE being defined at compile time doesn't
++// imply runtime support.
++#if defined(_AIX) || defined(V8_OS_SOLARIS)
++ ret = madvise(reinterpret_cast<caddr_t>(address), size, MADV_DONTNEED);
++#else
++ ret = madvise(address, size, MADV_DONTNEED);
++#endif
++ }
++ return ret == 0;
++}
++
++// static
++bool OS::HasLazyCommits() {
++#if V8_OS_AIX || V8_OS_LINUX || V8_OS_MACOSX
++ return true;
++#else
++ // TODO(bbudge) Return true for all POSIX platforms.
++ return false;
++#endif
++}
++#endif // !V8_OS_CYGWIN && !V8_OS_FUCHSIA
++
++const char* OS::GetGCFakeMMapFile() {
++ return g_gc_fake_mmap;
++}
++
++
++void OS::Sleep(TimeDelta interval) {
++ usleep(static_cast<useconds_t>(interval.InMicroseconds()));
++}
++
++
++void OS::Abort() {
++ if (g_hard_abort) {
++ V8_IMMEDIATE_CRASH();
++ }
++ // Redirect to std abort to signal abnormal program termination.
++ abort();
++}
++
++
++void OS::DebugBreak() {
++#if V8_HOST_ARCH_ARM
++ asm("bkpt 0");
++#elif V8_HOST_ARCH_ARM64
++ asm("brk 0");
++#elif V8_HOST_ARCH_MIPS
++ asm("break");
++#elif V8_HOST_ARCH_MIPS64
++ asm("break");
++#elif V8_HOST_ARCH_PPC
++ asm("twge 2,2");
++#elif V8_HOST_ARCH_IA32
++ asm("int $3");
++#elif V8_HOST_ARCH_X64
++ asm("int $3");
++#elif V8_HOST_ARCH_S390
++ // Software breakpoint instruction is 0x0001
++ asm volatile(".word 0x0001");
++#else
++#error Unsupported host architecture.
++#endif
++}
++
++
++class PosixMemoryMappedFile final : public OS::MemoryMappedFile {
++ public:
++ PosixMemoryMappedFile(FILE* file, void* memory, size_t size)
++ : file_(file), memory_(memory), size_(size) {}
++ ~PosixMemoryMappedFile() final;
++ void* memory() const final { return memory_; }
++ size_t size() const final { return size_; }
++
++ private:
++ FILE* const file_;
++ void* const memory_;
++ size_t const size_;
++};
++
++
++// static
++OS::MemoryMappedFile* OS::MemoryMappedFile::open(const char* name,
++ FileMode mode) {
++ const char* fopen_mode = (mode == FileMode::kReadOnly) ? "r" : "r+";
++ if (FILE* file = fopen(name, fopen_mode)) {
++ if (fseek(file, 0, SEEK_END) == 0) {
++ long size = ftell(file); // NOLINT(runtime/int)
++ if (size == 0) return new PosixMemoryMappedFile(file, nullptr, 0);
++ if (size > 0) {
++ int prot = PROT_READ;
++ int flags = MAP_PRIVATE;
++ if (mode == FileMode::kReadWrite) {
++ prot |= PROT_WRITE;
++ flags = MAP_SHARED;
++ }
++ void* const memory =
++ mmap(OS::GetRandomMmapAddr(), size, prot, flags, fileno(file), 0);
++ if (memory != MAP_FAILED) {
++ return new PosixMemoryMappedFile(file, memory, size);
++ }
++ }
++ }
++ fclose(file);
++ }
++ return nullptr;
++}
++
++// static
++OS::MemoryMappedFile* OS::MemoryMappedFile::create(const char* name,
++ size_t size, void* initial) {
++ if (FILE* file = fopen(name, "w+")) {
++ if (size == 0) return new PosixMemoryMappedFile(file, 0, 0);
++ size_t result = fwrite(initial, 1, size, file);
++ if (result == size && !ferror(file)) {
++ void* memory = mmap(OS::GetRandomMmapAddr(), result,
++ PROT_READ | PROT_WRITE, MAP_SHARED, fileno(file), 0);
++ if (memory != MAP_FAILED) {
++ return new PosixMemoryMappedFile(file, memory, result);
++ }
++ }
++ fclose(file);
++ }
++ return nullptr;
++}
++
++
++PosixMemoryMappedFile::~PosixMemoryMappedFile() {
++ if (memory_) CHECK(OS::Free(memory_, RoundUp(size_, OS::AllocatePageSize())));
++ fclose(file_);
++}
++
++
++int OS::GetCurrentProcessId() {
++ return static_cast<int>(getpid());
++}
++
++
++int OS::GetCurrentThreadId() {
++#if V8_OS_MACOSX || (V8_OS_ANDROID && defined(__APPLE__))
++ return static_cast<int>(pthread_mach_thread_np(pthread_self()));
++#elif V8_OS_LINUX
++ return static_cast<int>(syscall(__NR_gettid));
++#elif V8_OS_ANDROID
++ return static_cast<int>(gettid());
++#elif V8_OS_AIX
++ return static_cast<int>(thread_self());
++#elif V8_OS_FUCHSIA
++ return static_cast<int>(zx_thread_self());
++#elif V8_OS_SOLARIS
++ return static_cast<int>(pthread_self());
++#else
++ return static_cast<int>(reinterpret_cast<intptr_t>(pthread_self()));
++#endif
++}
++
++void OS::ExitProcess(int exit_code) {
++ // Use _exit instead of exit to avoid races between isolate
++ // threads and static destructors.
++ fflush(stdout);
++ fflush(stderr);
++ _exit(exit_code);
++}
++
++// ----------------------------------------------------------------------------
++// POSIX date/time support.
++//
++
++#if !defined(V8_OS_FUCHSIA)
++int OS::GetUserTime(uint32_t* secs, uint32_t* usecs) {
++ struct rusage usage;
++
++ if (getrusage(RUSAGE_SELF, &usage) < 0) return -1;
++ *secs = static_cast<uint32_t>(usage.ru_utime.tv_sec);
++ *usecs = static_cast<uint32_t>(usage.ru_utime.tv_usec);
++ return 0;
++}
++#endif
++
++double OS::TimeCurrentMillis() {
++ return Time::Now().ToJsTime();
++}
++
++double PosixTimezoneCache::DaylightSavingsOffset(double time) {
++ if (std::isnan(time)) return std::numeric_limits<double>::quiet_NaN();
++ time_t tv = static_cast<time_t>(std::floor(time/msPerSecond));
++ struct tm tm;
++ struct tm* t = localtime_r(&tv, &tm);
++ if (nullptr == t) return std::numeric_limits<double>::quiet_NaN();
++ return t->tm_isdst > 0 ? 3600 * msPerSecond : 0;
++}
++
++
++int OS::GetLastError() {
++ return errno;
++}
++
++
++// ----------------------------------------------------------------------------
++// POSIX stdio support.
++//
++
++FILE* OS::FOpen(const char* path, const char* mode) {
++ FILE* file = fopen(path, mode);
++ if (file == nullptr) return nullptr;
++ struct stat file_stat;
++ if (fstat(fileno(file), &file_stat) != 0) {
++ fclose(file);
++ return nullptr;
++ }
++ bool is_regular_file = ((file_stat.st_mode & S_IFREG) != 0);
++ if (is_regular_file) return file;
++ fclose(file);
++ return nullptr;
++}
++
++
++bool OS::Remove(const char* path) {
++ return (remove(path) == 0);
++}
++
++char OS::DirectorySeparator() { return '/'; }
++
++bool OS::isDirectorySeparator(const char ch) {
++ return ch == DirectorySeparator();
++}
++
++
++FILE* OS::OpenTemporaryFile() {
++ return tmpfile();
++}
++
++
++const char* const OS::LogFileOpenMode = "w";
++
++
++void OS::Print(const char* format, ...) {
++ va_list args;
++ va_start(args, format);
++ VPrint(format, args);
++ va_end(args);
++}
++
++
++void OS::VPrint(const char* format, va_list args) {
++#if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
++ __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args);
++#else
++ vprintf(format, args);
++#endif
++}
++
++
++void OS::FPrint(FILE* out, const char* format, ...) {
++ va_list args;
++ va_start(args, format);
++ VFPrint(out, format, args);
++ va_end(args);
++}
++
++
++void OS::VFPrint(FILE* out, const char* format, va_list args) {
++#if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
++ __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args);
++#else
++ vfprintf(out, format, args);
++#endif
++}
++
++
++void OS::PrintError(const char* format, ...) {
++ va_list args;
++ va_start(args, format);
++ VPrintError(format, args);
++ va_end(args);
++}
++
++
++void OS::VPrintError(const char* format, va_list args) {
++#if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
++ __android_log_vprint(ANDROID_LOG_ERROR, LOG_TAG, format, args);
++#else
++ vfprintf(stderr, format, args);
++#endif
++}
++
++
++int OS::SNPrintF(char* str, int length, const char* format, ...) {
++ va_list args;
++ va_start(args, format);
++ int result = VSNPrintF(str, length, format, args);
++ va_end(args);
++ return result;
++}
++
++
++int OS::VSNPrintF(char* str,
++ int length,
++ const char* format,
++ va_list args) {
++ int n = vsnprintf(str, length, format, args);
++ if (n < 0 || n >= length) {
++ // If the length is zero, the assignment fails.
++ if (length > 0)
++ str[length - 1] = '\0';
++ return -1;
++ } else {
++ return n;
++ }
++}
++
++
++// ----------------------------------------------------------------------------
++// POSIX string support.
++//
++
++void OS::StrNCpy(char* dest, int length, const char* src, size_t n) {
++ strncpy(dest, src, n);
++}
++
++
++// ----------------------------------------------------------------------------
++// POSIX thread support.
++//
++
++class Thread::PlatformData {
++ public:
++ PlatformData() : thread_(kNoThread) {}
++ pthread_t thread_; // Thread handle for pthread.
++ // Synchronizes thread creation
++ Mutex thread_creation_mutex_;
++};
++
++Thread::Thread(const Options& options)
++ : data_(new PlatformData),
++ stack_size_(options.stack_size()),
++ start_semaphore_(nullptr) {
++ if (stack_size_ > 0 && static_cast<size_t>(stack_size_) < PTHREAD_STACK_MIN) {
++ stack_size_ = PTHREAD_STACK_MIN;
++ }
++ set_name(options.name());
++}
++
++
++Thread::~Thread() {
++ delete data_;
++}
++
++
++static void SetThreadName(const char* name) {
++#if V8_OS_DRAGONFLYBSD || V8_OS_FREEBSD || V8_OS_OPENBSD
++ pthread_set_name_np(pthread_self(), name);
++#elif V8_OS_NETBSD
++ STATIC_ASSERT(Thread::kMaxThreadNameLength <= PTHREAD_MAX_NAMELEN_NP);
++ pthread_setname_np(pthread_self(), "%s", name);
++#elif V8_OS_MACOSX
++ // pthread_setname_np is only available in 10.6 or later, so test
++ // for it at runtime.
++ int (*dynamic_pthread_setname_np)(const char*);
++ *reinterpret_cast<void**>(&dynamic_pthread_setname_np) =
++ dlsym(RTLD_DEFAULT, "pthread_setname_np");
++ if (dynamic_pthread_setname_np == nullptr) return;
++
++ // Mac OS X does not expose the length limit of the name, so hardcode it.
++ static const int kMaxNameLength = 63;
++ STATIC_ASSERT(Thread::kMaxThreadNameLength <= kMaxNameLength);
++ dynamic_pthread_setname_np(name);
++#elif defined(PR_SET_NAME)
++ prctl(PR_SET_NAME,
++ reinterpret_cast<unsigned long>(name), // NOLINT
++ 0, 0, 0);
++#endif
++}
++
++
++static void* ThreadEntry(void* arg) {
++ Thread* thread = reinterpret_cast<Thread*>(arg);
++ // We take the lock here to make sure that pthread_create finished first since
++ // we don't know which thread will run first (the original thread or the new
++ // one).
++ { MutexGuard lock_guard(&thread->data()->thread_creation_mutex_); }
++ SetThreadName(thread->name());
++ DCHECK_NE(thread->data()->thread_, kNoThread);
++ thread->NotifyStartedAndRun();
++ return nullptr;
++}
++
++
++void Thread::set_name(const char* name) {
++ strncpy(name_, name, sizeof(name_));
++ name_[sizeof(name_) - 1] = '\0';
++}
++
++bool Thread::Start() {
++ int result;
++ pthread_attr_t attr;
++ memset(&attr, 0, sizeof(attr));
++ result = pthread_attr_init(&attr);
++ if (result != 0) return false;
++ size_t stack_size = stack_size_;
++ if (stack_size == 0) {
++#if V8_OS_MACOSX
++ // Default on Mac OS X is 512kB -- bump up to 1MB
++ stack_size = 1 * 1024 * 1024;
++#elif V8_OS_AIX
++ // Default on AIX is 96kB -- bump up to 2MB
++ stack_size = 2 * 1024 * 1024;
++#endif
++ }
++ if (stack_size > 0) {
++ result = pthread_attr_setstacksize(&attr, stack_size);
++ if (result != 0) return pthread_attr_destroy(&attr), false;
++ }
++ {
++ MutexGuard lock_guard(&data_->thread_creation_mutex_);
++ result = pthread_create(&data_->thread_, &attr, ThreadEntry, this);
++ if (result != 0 || data_->thread_ == kNoThread) {
++ return pthread_attr_destroy(&attr), false;
++ }
++ }
++ result = pthread_attr_destroy(&attr);
++ return result == 0;
++}
++
++void Thread::Join() { pthread_join(data_->thread_, nullptr); }
++
++static Thread::LocalStorageKey PthreadKeyToLocalKey(pthread_key_t pthread_key) {
++#if V8_OS_CYGWIN
++ // We need to cast pthread_key_t to Thread::LocalStorageKey in two steps
++ // because pthread_key_t is a pointer type on Cygwin. This will probably not
++ // work on 64-bit platforms, but Cygwin doesn't support 64-bit anyway.
++ STATIC_ASSERT(sizeof(Thread::LocalStorageKey) == sizeof(pthread_key_t));
++ intptr_t ptr_key = reinterpret_cast<intptr_t>(pthread_key);
++ return static_cast<Thread::LocalStorageKey>(ptr_key);
++#else
++ return static_cast<Thread::LocalStorageKey>(pthread_key);
++#endif
++}
++
++
++static pthread_key_t LocalKeyToPthreadKey(Thread::LocalStorageKey local_key) {
++#if V8_OS_CYGWIN
++ STATIC_ASSERT(sizeof(Thread::LocalStorageKey) == sizeof(pthread_key_t));
++ intptr_t ptr_key = static_cast<intptr_t>(local_key);
++ return reinterpret_cast<pthread_key_t>(ptr_key);
++#else
++ return static_cast<pthread_key_t>(local_key);
++#endif
++}
++
++
++#ifdef V8_FAST_TLS_SUPPORTED
++
++static std::atomic<bool> tls_base_offset_initialized{false};
++intptr_t kMacTlsBaseOffset = 0;
++
++// It's safe to do the initialization more that once, but it has to be
++// done at least once.
++static void InitializeTlsBaseOffset() {
++ const size_t kBufferSize = 128;
++ char buffer[kBufferSize];
++ size_t buffer_size = kBufferSize;
++ int ctl_name[] = { CTL_KERN , KERN_OSRELEASE };
++ if (sysctl(ctl_name, 2, buffer, &buffer_size, nullptr, 0) != 0) {
++ FATAL("V8 failed to get kernel version");
++ }
++ // The buffer now contains a string of the form XX.YY.ZZ, where
++ // XX is the major kernel version component.
++ // Make sure the buffer is 0-terminated.
++ buffer[kBufferSize - 1] = '\0';
++ char* period_pos = strchr(buffer, '.');
++ *period_pos = '\0';
++ int kernel_version_major =
++ static_cast<int>(strtol(buffer, nullptr, 10)); // NOLINT
++ // The constants below are taken from pthreads.s from the XNU kernel
++ // sources archive at www.opensource.apple.com.
++ if (kernel_version_major < 11) {
++ // 8.x.x (Tiger), 9.x.x (Leopard), 10.x.x (Snow Leopard) have the
++ // same offsets.
++#if V8_HOST_ARCH_IA32
++ kMacTlsBaseOffset = 0x48;
++#else
++ kMacTlsBaseOffset = 0x60;
++#endif
++ } else {
++ // 11.x.x (Lion) changed the offset.
++ kMacTlsBaseOffset = 0;
++ }
++
++ tls_base_offset_initialized.store(true, std::memory_order_release);
++}
++
++
++static void CheckFastTls(Thread::LocalStorageKey key) {
++ void* expected = reinterpret_cast<void*>(0x1234CAFE);
++ Thread::SetThreadLocal(key, expected);
++ void* actual = Thread::GetExistingThreadLocal(key);
++ if (expected != actual) {
++ FATAL("V8 failed to initialize fast TLS on current kernel");
++ }
++ Thread::SetThreadLocal(key, nullptr);
++}
++
++#endif // V8_FAST_TLS_SUPPORTED
++
++
++Thread::LocalStorageKey Thread::CreateThreadLocalKey() {
++#ifdef V8_FAST_TLS_SUPPORTED
++ bool check_fast_tls = false;
++ if (!tls_base_offset_initialized.load(std::memory_order_acquire)) {
++ check_fast_tls = true;
++ InitializeTlsBaseOffset();
++ }
++#endif
++ pthread_key_t key;
++ int result = pthread_key_create(&key, nullptr);
++ DCHECK_EQ(0, result);
++ USE(result);
++ LocalStorageKey local_key = PthreadKeyToLocalKey(key);
++#ifdef V8_FAST_TLS_SUPPORTED
++ // If we just initialized fast TLS support, make sure it works.
++ if (check_fast_tls) CheckFastTls(local_key);
++#endif
++ return local_key;
++}
++
++
++void Thread::DeleteThreadLocalKey(LocalStorageKey key) {
++ pthread_key_t pthread_key = LocalKeyToPthreadKey(key);
++ int result = pthread_key_delete(pthread_key);
++ DCHECK_EQ(0, result);
++ USE(result);
++}
++
++
++void* Thread::GetThreadLocal(LocalStorageKey key) {
++ pthread_key_t pthread_key = LocalKeyToPthreadKey(key);
++ return pthread_getspecific(pthread_key);
++}
++
++
++void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
++ pthread_key_t pthread_key = LocalKeyToPthreadKey(key);
++ int result = pthread_setspecific(pthread_key, value);
++ DCHECK_EQ(0, result);
++ USE(result);
++}
++
++#undef LOG_TAG
++#undef MAP_ANONYMOUS
++#undef MADV_FREE
++
++} // namespace base
++} // namespace v8
+diff -Naur node-v12.17.0/deps/v8/src/codegen/arm64/cpu-arm64.cc.orig node-v12.17.0+iPhone/deps/v8/src/codegen/arm64/cpu-arm64.cc.orig
+--- node-v12.17.0/deps/v8/src/codegen/arm64/cpu-arm64.cc.orig 1969-12-31 16:00:00.000000000 -0800
++++ node-v12.17.0+iPhone/deps/v8/src/codegen/arm64/cpu-arm64.cc.orig 2020-05-27 20:28:31.000000000 -0700
+@@ -0,0 +1,116 @@
++// Copyright 2013 the V8 project authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++// CPU specific code for arm independent of OS goes here.
++
++#if V8_TARGET_ARCH_ARM64
++
++#include "src/codegen/arm64/utils-arm64.h"
++#include "src/codegen/cpu-features.h"
++
++namespace v8 {
++namespace internal {
++
++class CacheLineSizes {
++ public:
++ CacheLineSizes() {
++#if !defined(V8_HOST_ARCH_ARM64) || defined(V8_OS_WIN) || defined(__APPLE__)
++ cache_type_register_ = 0;
++#else
++ // Copy the content of the cache type register to a core register.
++ __asm__ __volatile__("mrs %x[ctr], ctr_el0" // NOLINT
++ : [ctr] "=r"(cache_type_register_));
++#endif
++ }
++
++ uint32_t icache_line_size() const { return ExtractCacheLineSize(0); }
++ uint32_t dcache_line_size() const { return ExtractCacheLineSize(16); }
++
++ private:
++ uint32_t ExtractCacheLineSize(int cache_line_size_shift) const {
++ // The cache type register holds the size of cache lines in words as a
++ // power of two.
++ return 4 << ((cache_type_register_ >> cache_line_size_shift) & 0xF);
++ }
++
++ uint32_t cache_type_register_;
++};
++
++void CpuFeatures::FlushICache(void* address, size_t length) {
++#if defined(V8_HOST_ARCH_ARM64)
++#if defined(V8_OS_WIN)
++ ::FlushInstructionCache(GetCurrentProcess(), address, length);
++#else
++ // The code below assumes user space cache operations are allowed. The goal
++ // of this routine is to make sure the code generated is visible to the I
++ // side of the CPU.
++
++ uintptr_t start = reinterpret_cast<uintptr_t>(address);
++ // Sizes will be used to generate a mask big enough to cover a pointer.
++ CacheLineSizes sizes;
++ uintptr_t dsize = sizes.dcache_line_size();
++ uintptr_t isize = sizes.icache_line_size();
++ // Cache line sizes are always a power of 2.
++ DCHECK_EQ(CountSetBits(dsize, 64), 1);
++ DCHECK_EQ(CountSetBits(isize, 64), 1);
++ uintptr_t dstart = start & ~(dsize - 1);
++ uintptr_t istart = start & ~(isize - 1);
++ uintptr_t end = start + length;
++
++ __asm__ __volatile__( // NOLINT
++ // Clean every line of the D cache containing the
++ // target data.
++ "0: \n\t"
++ // dc : Data Cache maintenance
++ // c : Clean
++ // i : Invalidate
++ // va : by (Virtual) Address
++ // c : to the point of Coherency
++ // See ARM DDI 0406B page B2-12 for more information.
++ // We would prefer to use "cvau" (clean to the point of unification) here
++ // but we use "civac" to work around Cortex-A53 errata 819472, 826319,
++ // 827319 and 824069.
++ "dc civac, %[dline] \n\t"
++ "add %[dline], %[dline], %[dsize] \n\t"
++ "cmp %[dline], %[end] \n\t"
++ "b.lt 0b \n\t"
++ // Barrier to make sure the effect of the code above is visible to the
++ // rest of the world. dsb : Data Synchronisation Barrier
++ // ish : Inner SHareable domain
++ // The point of unification for an Inner Shareable shareability domain is
++ // the point by which the instruction and data caches of all the
++ // processors in that Inner Shareable shareability domain are guaranteed
++ // to see the same copy of a memory location. See ARM DDI 0406B page
++ // B2-12 for more information.
++ "dsb ish \n\t"
++ // Invalidate every line of the I cache containing the target data.
++ "1: \n\t"
++ // ic : instruction cache maintenance
++ // i : invalidate
++ // va : by address
++ // u : to the point of unification
++ "ic ivau, %[iline] \n\t"
++ "add %[iline], %[iline], %[isize] \n\t"
++ "cmp %[iline], %[end] \n\t"
++ "b.lt 1b \n\t"
++ // Barrier to make sure the effect of the code above is visible to the
++ // rest of the world.
++ "dsb ish \n\t"
++ // Barrier to ensure any prefetching which happened before this code is
++ // discarded.
++ // isb : Instruction Synchronisation Barrier
++ "isb \n\t"
++ : [dline] "+r"(dstart), [iline] "+r"(istart)
++ : [dsize] "r"(dsize), [isize] "r"(isize), [end] "r"(end)
++ // This code does not write to memory but without the dependency gcc might
++ // move this code before the code is generated.
++ : "cc", "memory"); // NOLINT
++#endif // V8_OS_WIN
++#endif // V8_HOST_ARCH_ARM64
++}
++
++} // namespace internal
++} // namespace v8
++
++#endif // V8_TARGET_ARCH_ARM64
+diff -Naur node-v12.17.0/deps/v8/src/codegen/arm64/cpu-arm64.cc.rej node-v12.17.0+iPhone/deps/v8/src/codegen/arm64/cpu-arm64.cc.rej
+--- node-v12.17.0/deps/v8/src/codegen/arm64/cpu-arm64.cc.rej 1969-12-31 16:00:00.000000000 -0800
++++ node-v12.17.0+iPhone/deps/v8/src/codegen/arm64/cpu-arm64.cc.rej 2020-05-27 20:28:31.000000000 -0700
+@@ -0,0 +1,11 @@
++--- deps/v8/src/arm64/cpu-arm64.cc 2019-05-22 12:21:52.000000000 +0000
+++++ deps/v8/src/arm64/cpu-arm64.cc 2019-05-24 19:37:47.406732128 +0000
++@@ -15,7 +15,7 @@
++ class CacheLineSizes {
++ public:
++ CacheLineSizes() {
++-#if !defined(V8_HOST_ARCH_ARM64) || defined(V8_OS_WIN)
+++#if !defined(V8_HOST_ARCH_ARM64) || defined(V8_OS_WIN) || defined(V8_OS_IPHONEOS) || defined(__IPHONEOS__)
++ cache_type_register_ = 0;
++ #else
++ // Copy the content of the cache type register to a core register.
+diff -Naur node-v12.17.0/tools/v8_gypfiles/toolchain.gypi node-v12.17.0+iPhone/tools/v8_gypfiles/toolchain.gypi
+--- node-v12.17.0/tools/v8_gypfiles/toolchain.gypi 2020-05-26 04:53:35.000000000 -0700
++++ node-v12.17.0+iPhone/tools/v8_gypfiles/toolchain.gypi 2020-05-27 20:28:31.000000000 -0700
+@@ -81,7 +81,9 @@
# The setting is ignored if want_separate_host_toolset is 0.
'v8_toolset_for_shell%': 'target',
@@ -36,7 +1087,7 @@ diff -ur node-v12.3.1/tools/v8_gypfiles/toolchain.gypi node-v12.3.1+iPhone/tools
'werror%': '-Werror',
# For a shared library build, results in "libv8-<(soname_version).so".
'soname_version%': '',
-@@ -371,7 +373,7 @@
+@@ -376,7 +378,7 @@
[ 'clang==1', {
'cflags': ['-integrated-as'],
}],
@@ -45,7 +1096,7 @@ diff -ur node-v12.3.1/tools/v8_gypfiles/toolchain.gypi node-v12.3.1+iPhone/tools
'defines': ['_MIPS_TARGET_HW',],
}, {
'defines': ['_MIPS_TARGET_SIMULATOR',],
-@@ -384,7 +386,7 @@
+@@ -389,7 +391,7 @@
}], #'_toolset=="target"
['_toolset=="host"', {
'conditions': [
@@ -54,7 +1105,7 @@ diff -ur node-v12.3.1/tools/v8_gypfiles/toolchain.gypi node-v12.3.1+iPhone/tools
'defines': ['_MIPS_TARGET_HW',],
}, {
'defines': ['_MIPS_TARGET_SIMULATOR',],
-@@ -1025,7 +1027,7 @@
+@@ -1030,7 +1032,7 @@
},
}],
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
@@ -63,7 +1114,7 @@ diff -ur node-v12.3.1/tools/v8_gypfiles/toolchain.gypi node-v12.3.1+iPhone/tools
v8_target_arch=="ia32"', {
'cflags': [
'-msse2',
-@@ -1034,7 +1036,7 @@
+@@ -1039,7 +1041,7 @@
],
}],
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
@@ -71,7 +1122,7 @@ diff -ur node-v12.3.1/tools/v8_gypfiles/toolchain.gypi node-v12.3.1+iPhone/tools
+ or OS=="netbsd" or OS=="mac" or OS=="ios" or OS=="android" or OS=="qnx") and \
(v8_target_arch=="arm" or v8_target_arch=="ia32" or \
v8_target_arch=="mips" or v8_target_arch=="mipsel" or \
- v8_target_arch=="ppc" or v8_target_arch=="s390")', {
+ v8_target_arch=="ppc")', {
@@ -1235,7 +1237,7 @@
'-ffunction-sections',
],
@@ -99,10 +1150,1435 @@ diff -ur node-v12.3.1/tools/v8_gypfiles/toolchain.gypi node-v12.3.1+iPhone/tools
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '3', # -O3
-diff -ur node-v12.3.1/tools/v8_gypfiles/v8.gyp node-v12.3.1+iPhone/tools/v8_gypfiles/v8.gyp
---- node-v12.3.1/tools/v8_gypfiles/v8.gyp 2019-05-22 12:21:55.000000000 +0000
-+++ node-v12.3.1+iPhone/tools/v8_gypfiles/v8.gyp 2019-05-24 19:45:01.650941667 +0000
-@@ -123,6 +123,12 @@
+diff -Naur node-v12.17.0/tools/v8_gypfiles/toolchain.gypi.orig node-v12.17.0+iPhone/tools/v8_gypfiles/toolchain.gypi.orig
+--- node-v12.17.0/tools/v8_gypfiles/toolchain.gypi.orig 1969-12-31 16:00:00.000000000 -0800
++++ node-v12.17.0+iPhone/tools/v8_gypfiles/toolchain.gypi.orig 2020-05-27 20:27:00.000000000 -0700
+@@ -0,0 +1,1421 @@
++# Copyright 2013 the V8 project authors. All rights reserved.
++# Redistribution and use in source and binary forms, with or without
++# modification, are permitted provided that the following conditions are
++# met:
++#
++# * Redistributions of source code must retain the above copyright
++# notice, this list of conditions and the following disclaimer.
++# * Redistributions in binary form must reproduce the above
++# copyright notice, this list of conditions and the following
++# disclaimer in the documentation and/or other materials provided
++# with the distribution.
++# * Neither the name of Google Inc. nor the names of its
++# contributors may be used to endorse or promote products derived
++# from this software without specific prior written permission.
++#
++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++# Shared definitions for all V8-related targets.
++
++{
++ 'variables': {
++ 'msvs_use_common_release': 0,
++ 'clang%': 0,
++ 'asan%': 0,
++ 'cfi_vptr%': 0,
++ 'lsan%': 0,
++ 'msan%': 0,
++ 'tsan%': 0,
++ 'ubsan%': 0,
++ 'ubsan_vptr%': 0,
++ 'has_valgrind%': 0,
++ 'coverage%': 0,
++ 'v8_target_arch%': '<(target_arch)',
++ 'v8_host_byteorder%': '<!(python -c "import sys; print(sys.byteorder)")',
++ 'force_dynamic_crt%': 0,
++
++ # Setting 'v8_can_use_vfp32dregs' to 'true' will cause V8 to use the VFP
++ # registers d16-d31 in the generated code, both in the snapshot and for the
++ # ARM target. Leaving the default value of 'false' will avoid the use of
++ # these registers in the snapshot and use CPU feature probing when running
++ # on the target.
++ 'v8_can_use_vfp32dregs%': 'false',
++ 'arm_test_noprobe%': 'off',
++
++ # Similar to vfp but on MIPS.
++ 'v8_can_use_fpu_instructions%': 'true',
++
++ # Similar to the ARM hard float ABI but on MIPS.
++ 'v8_use_mips_abi_hardfloat%': 'true',
++
++ # MIPS MSA support
++ 'mips_use_msa%': 0,
++
++ # Print to stdout on Android.
++ 'v8_android_log_stdout%': 0,
++
++ 'v8_enable_backtrace%': 0,
++
++ # Enable profiling support. Only required on Windows.
++ 'v8_enable_prof%': 0,
++
++ # Some versions of GCC 4.5 seem to need -fno-strict-aliasing.
++ 'v8_no_strict_aliasing%': 0,
++
++ # Chrome needs this definition unconditionally. For standalone V8 builds,
++ # it's handled in gypfiles/standalone.gypi.
++ 'want_separate_host_toolset%': 1,
++
++ # Toolset the shell binary should be compiled for. Possible values are
++ # 'host' and 'target'.
++ # The setting is ignored if want_separate_host_toolset is 0.
++ 'v8_toolset_for_shell%': 'target',
++
++ 'host_os%': '<(OS)',
++ 'werror%': '-Werror',
++ # For a shared library build, results in "libv8-<(soname_version).so".
++ 'soname_version%': '',
++
++ # Allow to suppress the array bounds warning (default is no suppression).
++ 'wno_array_bounds%': '',
++
++ # Override where to find binutils
++ 'binutils_dir%': '',
++
++ 'conditions': [
++ ['OS=="linux" and host_arch=="x64"', {
++ 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
++ }],
++ ['OS=="linux" and host_arch=="ia32"', {
++ 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
++ }],
++
++ # linux_use_bundled_gold: whether to use the gold linker binary checked
++ # into third_party/binutils. Force this off via GYP_DEFINES when you
++ # are using a custom toolchain and need to control -B in ldflags.
++ # Do not use 32-bit gold on 32-bit hosts as it runs out address space
++ # for component=static_library builds.
++ ['((OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm" or (target_arch=="ia32" and host_arch=="x64"))) or (OS=="linux" and target_arch=="mipsel")', {
++ 'linux_use_bundled_gold%': 1,
++ }, {
++ 'linux_use_bundled_gold%': 0,
++ }],
++ # linux_use_bundled_binutils: whether to use the binary binutils
++ # checked into third_party/binutils. These are not multi-arch so cannot
++ # be used except on x86 and x86-64 (the only two architectures which
++ # are currently checke in). Force this off via GYP_DEFINES when you
++ # are using a custom toolchain and need to control -B in cflags.
++ ['OS=="linux" and (target_arch=="ia32" or target_arch=="x64")', {
++ 'linux_use_bundled_binutils%': 1,
++ }, {
++ 'linux_use_bundled_binutils%': 0,
++ }],
++ # linux_use_gold_flags: whether to use build flags that rely on gold.
++ # On by default for x64 Linux.
++ ['OS=="linux" and target_arch=="x64"', {
++ 'linux_use_gold_flags%': 1,
++ }, {
++ 'linux_use_gold_flags%': 0,
++ }],
++ ],
++
++ # Indicates if gcmole tools are downloaded by a hook.
++ 'gcmole%': 0,
++ },
++
++ # [GYP] this needs to be outside of the top level 'variables'
++ 'conditions': [
++ ['host_arch=="ia32" or host_arch=="x64" or \
++ host_arch=="ppc" or host_arch=="ppc64" or \
++ host_arch=="s390x" or \
++ clang==1', {
++ 'variables': {
++ 'host_cxx_is_biarch%': 1,
++ },
++ }, {
++ 'variables': {
++ 'host_cxx_is_biarch%': 0,
++ },
++ }],
++ ['target_arch=="ia32" or target_arch=="x64" or \
++ target_arch=="ppc" or target_arch=="ppc64" or \
++ target_arch=="s390x" or clang==1', {
++ 'variables': {
++ 'target_cxx_is_biarch%': 1,
++ },
++ }, {
++ 'variables': {
++ 'target_cxx_is_biarch%': 0,
++ },
++ }],
++ ],
++ 'target_defaults': {
++ 'include_dirs': [
++ '<(V8_ROOT)',
++ '<(V8_ROOT)/include',
++ ],
++ 'conditions': [
++ ['clang', {
++ 'cflags': [ '-Werror', '-Wno-unknown-pragmas' ],
++ },{
++ 'cflags!': [ '-Wall', '-Wextra' ],
++ 'cflags': [ '-Wno-return-type' ],
++ }],
++ ['v8_target_arch=="arm"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_ARM',
++ ],
++ 'conditions': [
++ [ 'arm_version==7 or arm_version=="default"', {
++ 'defines': [
++ 'CAN_USE_ARMV7_INSTRUCTIONS',
++ ],
++ }],
++ [ 'arm_fpu=="vfpv3-d16" or arm_fpu=="default"', {
++ 'defines': [
++ 'CAN_USE_VFP3_INSTRUCTIONS',
++ ],
++ }],
++ [ 'arm_fpu=="vfpv3"', {
++ 'defines': [
++ 'CAN_USE_VFP3_INSTRUCTIONS',
++ 'CAN_USE_VFP32DREGS',
++ ],
++ }],
++ [ 'arm_fpu=="neon"', {
++ 'defines': [
++ 'CAN_USE_VFP3_INSTRUCTIONS',
++ 'CAN_USE_VFP32DREGS',
++ 'CAN_USE_NEON',
++ ],
++ }],
++ [ 'arm_test_noprobe=="on"', {
++ 'defines': [
++ 'ARM_TEST_NO_FEATURE_PROBE',
++ ],
++ }],
++ ],
++ 'target_conditions': [
++ ['_toolset=="host"', {
++ 'conditions': [
++ ['v8_target_arch==host_arch', {
++ # Host built with an Arm CXX compiler.
++ 'conditions': [
++ [ 'arm_version==7', {
++ 'cflags': ['-march=armv7-a',],
++ }],
++ [ 'arm_version==7 or arm_version=="default"', {
++ 'conditions': [
++ [ 'arm_fpu!="default"', {
++ 'cflags': ['-mfpu=<(arm_fpu)',],
++ }],
++ ],
++ }],
++ [ 'arm_float_abi!="default"', {
++ 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
++ }],
++ [ 'arm_thumb==1', {
++ 'cflags': ['-mthumb',],
++ }],
++ [ 'arm_thumb==0', {
++ 'cflags': ['-marm',],
++ }],
++ ],
++ }, {
++ # 'v8_target_arch!=host_arch'
++ # Host not built with an Arm CXX compiler (simulator build).
++ 'conditions': [
++ [ 'arm_float_abi=="hard"', {
++ 'defines': [
++ 'USE_EABI_HARDFLOAT=1',
++ ],
++ }],
++ [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
++ 'defines': [
++ 'USE_EABI_HARDFLOAT=0',
++ ],
++ }],
++ ],
++ }],
++ ],
++ }], # _toolset=="host"
++ ['_toolset=="target"', {
++ 'conditions': [
++ ['v8_target_arch==target_arch', {
++ # Target built with an Arm CXX compiler.
++ 'conditions': [
++ [ 'arm_version==7', {
++ 'cflags': ['-march=armv7-a',],
++ }],
++ [ 'arm_version==7 or arm_version=="default"', {
++ 'conditions': [
++ [ 'arm_fpu!="default"', {
++ 'cflags': ['-mfpu=<(arm_fpu)',],
++ }],
++ ],
++ }],
++ [ 'arm_float_abi!="default"', {
++ 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
++ }],
++ [ 'arm_thumb==1', {
++ 'cflags': ['-mthumb',],
++ }],
++ [ 'arm_thumb==0', {
++ 'cflags': ['-marm',],
++ }],
++ ],
++ }, {
++ # 'v8_target_arch!=target_arch'
++ # Target not built with an Arm CXX compiler (simulator build).
++ 'conditions': [
++ [ 'arm_float_abi=="hard"', {
++ 'defines': [
++ 'USE_EABI_HARDFLOAT=1',
++ ],
++ }],
++ [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
++ 'defines': [
++ 'USE_EABI_HARDFLOAT=0',
++ ],
++ }],
++ ],
++ }],
++ ],
++ }], # _toolset=="target"
++ ],
++ }], # v8_target_arch=="arm"
++ ['v8_target_arch=="arm64"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_ARM64',
++ ],
++ }],
++ ['v8_target_arch=="s390x"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_S390',
++ ],
++ 'conditions': [
++ ['v8_target_arch=="s390x"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_S390X',
++ ],
++ }],
++ ['v8_host_byteorder=="little"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_S390_LE_SIM',
++ ],
++ }, {
++ 'cflags': [ '-march=z196' ],
++ }],
++ ],
++ }], # s390x
++ ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_PPC',
++ ],
++ 'conditions': [
++ ['v8_target_arch=="ppc64"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_PPC64',
++ ],
++ }],
++ ['v8_host_byteorder=="little"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_PPC_LE',
++ ],
++ }],
++ ['v8_host_byteorder=="big"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_PPC_BE',
++ ],
++ 'conditions': [
++ ['OS=="aix"', {
++ # Work around AIX ceil, trunc and round oddities.
++ 'cflags': [ '-mcpu=power5+ -mfprnd' ],
++ }],
++ ['OS=="aix"', {
++ # Work around AIX assembler popcntb bug.
++ 'cflags': [ '-mno-popcntb' ],
++ }],
++ ],
++ }],
++ ],
++ }], # ppc
++ ['v8_target_arch=="ia32"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_IA32',
++ ],
++ }], # v8_target_arch=="ia32"
++ ['v8_target_arch=="mips" or v8_target_arch=="mipsel" \
++ or v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
++ 'target_conditions': [
++ ['_toolset=="target"', {
++ 'conditions': [
++ ['v8_target_arch==target_arch', {
++ # Target built with a Mips CXX compiler.
++ 'variables': {
++ 'ldso_path%': '<!(/bin/echo -n $LDSO_PATH)',
++ 'ld_r_path%': '<!(/bin/echo -n $LD_R_PATH)',
++ },
++ 'conditions': [
++ ['ldso_path!=""', {
++ 'ldflags': ['-Wl,--dynamic-linker=<(ldso_path)'],
++ }],
++ ['ld_r_path!=""', {
++ 'ldflags': ['-Wl,--rpath=<(ld_r_path)'],
++ }],
++ [ 'clang==1', {
++ 'cflags': ['-integrated-as'],
++ }],
++ ['OS!="mac"', {
++ 'defines': ['_MIPS_TARGET_HW',],
++ }, {
++ 'defines': ['_MIPS_TARGET_SIMULATOR',],
++ }],
++ ],
++ }, {
++ 'defines': ['_MIPS_TARGET_SIMULATOR',],
++ }],
++ ],
++ }], #'_toolset=="target"
++ ['_toolset=="host"', {
++ 'conditions': [
++ ['v8_target_arch==target_arch and OS!="mac"', {
++ 'defines': ['_MIPS_TARGET_HW',],
++ }, {
++ 'defines': ['_MIPS_TARGET_SIMULATOR',],
++ }],
++ ],
++ }], #'_toolset=="host"
++ ],
++ }],
++ ['v8_target_arch=="mips"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_MIPS',
++ ],
++ 'conditions': [
++ [ 'v8_can_use_fpu_instructions=="true"', {
++ 'defines': [
++ 'CAN_USE_FPU_INSTRUCTIONS',
++ ],
++ }],
++ [ 'v8_use_mips_abi_hardfloat=="true"', {
++ 'defines': [
++ '__mips_hard_float=1',
++ 'CAN_USE_FPU_INSTRUCTIONS',
++ ],
++ }, {
++ 'defines': [
++ '__mips_soft_float=1'
++ ]
++ }],
++ ],
++ 'target_conditions': [
++ ['_toolset=="target"', {
++ 'conditions': [
++ ['v8_target_arch==target_arch', {
++ # Target built with a Mips CXX compiler.
++ 'cflags': [
++ '-EB',
++ '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
++ ],
++ 'ldflags': ['-EB'],
++ 'conditions': [
++ [ 'v8_use_mips_abi_hardfloat=="true"', {
++ 'cflags': ['-mhard-float'],
++ 'ldflags': ['-mhard-float'],
++ }, {
++ 'cflags': ['-msoft-float'],
++ 'ldflags': ['-msoft-float'],
++ }],
++ ['mips_arch_variant=="r6"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R6',
++ 'FPU_MODE_FP64',
++ ],
++ 'cflags!': ['-mfp32', '-mfpxx'],
++ 'conditions': [
++ [ 'clang==0', {
++ 'cflags': ['-Wa,-mips32r6'],
++ }],
++ ],
++ 'cflags': ['-mips32r6'],
++ 'ldflags': ['-mips32r6'],
++ }],
++ ['mips_arch_variant=="r6" and mips_use_msa==1', {
++ 'defines': [ '_MIPS_MSA' ],
++ }],
++ ['mips_arch_variant=="r2"', {
++ 'conditions': [
++ [ 'mips_fpu_mode=="fp64"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP64',
++ ],
++ 'cflags': ['-mfp64'],
++ }],
++ ['mips_fpu_mode=="fpxx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FPXX',
++ ],
++ 'cflags': ['-mfpxx'],
++ }],
++ ['mips_fpu_mode=="fp32"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP32',
++ ],
++ 'cflags': ['-mfp32'],
++ }],
++ [ 'clang==0', {
++ 'cflags': ['-Wa,-mips32r2'],
++ }],
++ ],
++ 'cflags': ['-mips32r2'],
++ 'ldflags': ['-mips32r2'],
++ }],
++ ['mips_arch_variant=="r1"', {
++ 'defines': [
++ 'FPU_MODE_FP32',
++ ],
++ 'cflags!': ['-mfp64', '-mfpxx'],
++ 'conditions': [
++ [ 'clang==0', {
++ 'cflags': ['-Wa,-mips32'],
++ }],
++ ],
++ 'cflags': ['-mips32'],
++ 'ldflags': ['-mips32'],
++ }],
++ ['mips_arch_variant=="rx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32RX',
++ 'FPU_MODE_FPXX',
++ ],
++ 'cflags!': ['-mfp64', '-mfp32'],
++ 'conditions': [
++ [ 'clang==0', {
++ 'cflags': ['-Wa,-mips32'],
++ }],
++ ],
++ 'cflags': ['-mips32', '-mfpxx'],
++ 'ldflags': ['-mips32'],
++ }],
++ ],
++ }, {
++ # 'v8_target_arch!=target_arch'
++ # Target not built with an MIPS CXX compiler (simulator build).
++ 'conditions': [
++ ['mips_arch_variant=="r6"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R6',
++ 'FPU_MODE_FP64',
++ ],
++ }],
++ ['mips_arch_variant=="r6" and mips_use_msa==1', {
++ 'defines': [ '_MIPS_MSA' ],
++ }],
++ ['mips_arch_variant=="r2"', {
++ 'conditions': [
++ [ 'mips_fpu_mode=="fp64"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP64',
++ ],
++ }],
++ ['mips_fpu_mode=="fpxx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FPXX',
++ ],
++ }],
++ ['mips_fpu_mode=="fp32"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP32',
++ ],
++ }],
++ ],
++ }],
++ ['mips_arch_variant=="r1"', {
++ 'defines': [
++ 'FPU_MODE_FP32',
++ ],
++ }],
++ ['mips_arch_variant=="rx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32RX',
++ 'FPU_MODE_FPXX',
++ ],
++ }],
++ ],
++ }],
++ ],
++ }], #_toolset=="target"
++ ['_toolset=="host"', {
++ 'conditions': [
++ ['mips_arch_variant=="rx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32RX',
++ 'FPU_MODE_FPXX',
++ ],
++ }],
++ ['mips_arch_variant=="r6"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R6',
++ 'FPU_MODE_FP64',
++ ],
++ }],
++ ['mips_arch_variant=="r6" and mips_use_msa==1', {
++ 'defines': [ '_MIPS_MSA' ],
++ }],
++ ['mips_arch_variant=="r2"', {
++ 'conditions': [
++ ['mips_fpu_mode=="fp64"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP64',
++ ],
++ }],
++ ['mips_fpu_mode=="fpxx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FPXX',
++ ],
++ }],
++ ['mips_fpu_mode=="fp32"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP32'
++ ],
++ }],
++ ],
++ }],
++ ['mips_arch_variant=="r1"', {
++ 'defines': ['FPU_MODE_FP32',],
++ }],
++ ]
++ }], #_toolset=="host"
++ ],
++ }], # v8_target_arch=="mips"
++ ['v8_target_arch=="mipsel"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_MIPS',
++ ],
++ 'conditions': [
++ [ 'v8_can_use_fpu_instructions=="true"', {
++ 'defines': [
++ 'CAN_USE_FPU_INSTRUCTIONS',
++ ],
++ }],
++ [ 'v8_use_mips_abi_hardfloat=="true"', {
++ 'defines': [
++ '__mips_hard_float=1',
++ 'CAN_USE_FPU_INSTRUCTIONS',
++ ],
++ }, {
++ 'defines': [
++ '__mips_soft_float=1'
++ ],
++ }],
++ ],
++ 'target_conditions': [
++ ['_toolset=="target"', {
++ 'conditions': [
++ ['v8_target_arch==target_arch', {
++ # Target built with a Mips CXX compiler.
++ 'cflags': [
++ '-EL',
++ '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
++ ],
++ 'ldflags': ['-EL'],
++ 'conditions': [
++ [ 'v8_use_mips_abi_hardfloat=="true"', {
++ 'cflags': ['-mhard-float'],
++ 'ldflags': ['-mhard-float'],
++ }, {
++ 'cflags': ['-msoft-float'],
++ 'ldflags': ['-msoft-float'],
++ }],
++ ['mips_arch_variant=="r6"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R6',
++ 'FPU_MODE_FP64',
++ ],
++ 'cflags!': ['-mfp32', '-mfpxx'],
++ 'conditions': [
++ [ 'clang==0', {
++ 'cflags': ['-Wa,-mips32r6'],
++ }],
++ ],
++ 'cflags': ['-mips32r6'],
++ 'ldflags': ['-mips32r6'],
++ }],
++ ['mips_arch_variant=="r6" and mips_use_msa==1', {
++ 'defines': [ '_MIPS_MSA' ],
++ }],
++ ['mips_arch_variant=="r2"', {
++ 'conditions': [
++ [ 'mips_fpu_mode=="fp64"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP64',
++ ],
++ 'cflags': ['-mfp64'],
++ }],
++ ['mips_fpu_mode=="fpxx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FPXX',
++ ],
++ 'cflags': ['-mfpxx'],
++ }],
++ ['mips_fpu_mode=="fp32"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP32',
++ ],
++ 'cflags': ['-mfp32'],
++ }],
++ [ 'clang==0', {
++ 'cflags': ['-Wa,-mips32r2'],
++ }],
++ ],
++ 'cflags': ['-mips32r2'],
++ 'ldflags': ['-mips32r2'],
++ }],
++ ['mips_arch_variant=="r1"', {
++ 'defines': [
++ 'FPU_MODE_FP32',
++ ],
++ 'cflags!': ['-mfp64', '-mfpxx'],
++ 'conditions': [
++ [ 'clang==0', {
++ 'cflags': ['-Wa,-mips32'],
++ }],
++ ],
++ 'cflags': ['-mips32'],
++ 'ldflags': ['-mips32'],
++ }],
++ ['mips_arch_variant=="rx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32RX',
++ 'FPU_MODE_FPXX',
++ ],
++ 'cflags!': ['-mfp64', '-mfp32'],
++ 'conditions': [
++ [ 'clang==0', {
++ 'cflags': ['-Wa,-mips32'],
++ }],
++ ],
++ 'cflags': ['-mips32', '-mfpxx'],
++ 'ldflags': ['-mips32'],
++ }],
++ ['mips_arch_variant=="loongson"', {
++ 'defines': [
++ '_MIPS_ARCH_LOONGSON',
++ 'FPU_MODE_FP32',
++ ],
++ 'cflags!': ['-mfp64', '-mfpxx'],
++ 'conditions': [
++ [ 'clang==0', {
++ 'cflags': ['-Wa,-mips3'],
++ }],
++ ],
++ 'cflags': ['-mips3', '-mfp32'],
++ }],
++ ],
++ }, {
++ # 'v8_target_arch!=target_arch'
++ # Target not built with an MIPS CXX compiler (simulator build).
++ 'conditions': [
++ ['mips_arch_variant=="r6"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R6',
++ 'FPU_MODE_FP64',
++ ],
++ }],
++ ['mips_arch_variant=="r6" and mips_use_msa==1', {
++ 'defines': [ '_MIPS_MSA' ],
++ }],
++ ['mips_arch_variant=="r2"', {
++ 'conditions': [
++ [ 'mips_fpu_mode=="fp64"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP64',
++ ],
++ }],
++ ['mips_fpu_mode=="fpxx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FPXX',
++ ],
++ }],
++ ['mips_fpu_mode=="fp32"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP32',
++ ],
++ }],
++ ],
++ }],
++ ['mips_arch_variant=="r1"', {
++ 'defines': [
++ 'FPU_MODE_FP32',
++ ],
++ }],
++ ['mips_arch_variant=="rx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32RX',
++ 'FPU_MODE_FPXX',
++ ],
++ }],
++ ['mips_arch_variant=="loongson"', {
++ 'defines': [
++ '_MIPS_ARCH_LOONGSON',
++ 'FPU_MODE_FP32',
++ ],
++ }],
++ ],
++ }],
++ ],
++ }], #_toolset=="target
++ ['_toolset=="host"', {
++ 'conditions': [
++ ['mips_arch_variant=="rx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32RX',
++ 'FPU_MODE_FPXX',
++ ],
++ }],
++ ['mips_arch_variant=="r6"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R6',
++ 'FPU_MODE_FP64',
++ ],
++ }],
++ ['mips_arch_variant=="r6" and mips_use_msa==1', {
++ 'defines': [ '_MIPS_MSA' ],
++ }],
++ ['mips_arch_variant=="r2"', {
++ 'conditions': [
++ ['mips_fpu_mode=="fp64"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP64',
++ ],
++ }],
++ ['mips_fpu_mode=="fpxx"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FPXX',
++ ],
++ }],
++ ['mips_fpu_mode=="fp32"', {
++ 'defines': [
++ '_MIPS_ARCH_MIPS32R2',
++ 'FPU_MODE_FP32'
++ ],
++ }],
++ ],
++ }],
++ ['mips_arch_variant=="r1"', {
++ 'defines': ['FPU_MODE_FP32',],
++ }],
++ ['mips_arch_variant=="loongson"', {
++ 'defines': [
++ '_MIPS_ARCH_LOONGSON',
++ 'FPU_MODE_FP32',
++ ],
++ }],
++ ]
++ }],
++ ],
++ }], # v8_target_arch=="mipsel"
++ ['v8_target_arch=="mips64el" or v8_target_arch=="mips64"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_MIPS64',
++ ],
++ 'conditions': [
++ [ 'v8_can_use_fpu_instructions=="true"', {
++ 'defines': [
++ 'CAN_USE_FPU_INSTRUCTIONS',
++ ],
++ }],
++ [ 'v8_host_byteorder=="little"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_MIPS64_LE',
++ ],
++ }],
++ [ 'v8_host_byteorder=="big"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_MIPS64_BE',
++ ],
++ }],
++ [ 'v8_use_mips_abi_hardfloat=="true"', {
++ 'defines': [
++ '__mips_hard_float=1',
++ 'CAN_USE_FPU_INSTRUCTIONS',
++ ],
++ }, {
++ 'defines': [
++ '__mips_soft_float=1'
++ ],
++ }],
++ ],
++ 'target_conditions': [
++ ['_toolset=="target"', {
++ 'conditions': [
++ ['v8_target_arch==target_arch', {
++ 'cflags': [
++ '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
++ ],
++ 'conditions': [
++ ['v8_target_arch=="mips64el"', {
++ 'cflags': ['-EL'],
++ 'ldflags': ['-EL'],
++ }],
++ ['v8_target_arch=="mips64"', {
++ 'cflags': ['-EB'],
++ 'ldflags': ['-EB'],
++ }],
++ [ 'v8_use_mips_abi_hardfloat=="true"', {
++ 'cflags': ['-mhard-float'],
++ 'ldflags': ['-mhard-float'],
++ }, {
++ 'cflags': ['-msoft-float'],
++ 'ldflags': ['-msoft-float'],
++ }],
++ ['mips_arch_variant=="r6"', {
++ 'defines': ['_MIPS_ARCH_MIPS64R6',],
++ 'conditions': [
++ [ 'clang==0', {
++ 'cflags': ['-Wa,-mips64r6'],
++ }],
++ ],
++ 'cflags': ['-mips64r6', '-mabi=64'],
++ 'ldflags': ['-mips64r6', '-mabi=64'],
++ }],
++ ['mips_arch_variant=="r6" and mips_use_msa==1', {
++ 'defines': [ '_MIPS_MSA' ],
++ }],
++ ['mips_arch_variant=="r2"', {
++ 'defines': ['_MIPS_ARCH_MIPS64R2',],
++ 'conditions': [
++ [ 'clang==0', {
++ 'cflags': ['-Wa,-mips64r2'],
++ }],
++ ],
++ 'cflags': ['-mips64r2', '-mabi=64'],
++ 'ldflags': ['-mips64r2', '-mabi=64'],
++ }],
++ ],
++ }, {
++ # 'v8_target_arch!=target_arch'
++ # Target not built with an MIPS CXX compiler (simulator build).
++ 'conditions': [
++ ['mips_arch_variant=="r6"', {
++ 'defines': ['_MIPS_ARCH_MIPS64R6',],
++ }],
++ ['mips_arch_variant=="r6" and mips_use_msa==1', {
++ 'defines': [ '_MIPS_MSA' ],
++ }],
++ ['mips_arch_variant=="r2"', {
++ 'defines': ['_MIPS_ARCH_MIPS64R2',],
++ }],
++ ],
++ }],
++ ],
++ }], #'_toolset=="target"
++ ['_toolset=="host"', {
++ 'conditions': [
++ ['mips_arch_variant=="r6"', {
++ 'defines': ['_MIPS_ARCH_MIPS64R6',],
++ }],
++ ['mips_arch_variant=="r6" and mips_use_msa==1', {
++ 'defines': [ '_MIPS_MSA' ],
++ }],
++ ['mips_arch_variant=="r2"', {
++ 'defines': ['_MIPS_ARCH_MIPS64R2',],
++ }],
++ ],
++ }], #'_toolset=="host"
++ ],
++ }], # v8_target_arch=="mips64el"
++ ['v8_target_arch=="x64"', {
++ 'defines': [
++ 'V8_TARGET_ARCH_X64',
++ ],
++ 'xcode_settings': {
++ 'ARCHS': [ 'x86_64' ],
++ },
++ 'msvs_settings': {
++ 'VCLinkerTool': {
++ 'StackReserveSize': '2097152',
++ },
++ },
++ 'msvs_configuration_platform': 'x64',
++ }], # v8_target_arch=="x64"
++ ['v8_target_arch=="x32"', {
++ 'defines': [
++ # x32 port shares the source code with x64 port.
++ 'V8_TARGET_ARCH_X64',
++ 'V8_TARGET_ARCH_32_BIT',
++ ],
++ 'cflags': [
++ '-mx32',
++ # Inhibit warning if long long type is used.
++ '-Wno-long-long',
++ ],
++ 'ldflags': [
++ '-mx32',
++ ],
++ }], # v8_target_arch=="x32"
++ ['linux_use_gold_flags==1', {
++ # Newer gccs and clangs support -fuse-ld, use the flag to force gold
++ # selection.
++ # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
++ 'ldflags': [ '-fuse-ld=gold', ],
++ }],
++ ['linux_use_bundled_binutils==1', {
++ 'cflags': [
++ '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
++ ],
++ }],
++ ['linux_use_bundled_gold==1', {
++ # Put our binutils, which contains gold in the search path. We pass
++ # the path to gold to the compiler. gyp leaves unspecified what the
++ # cwd is when running the compiler, so the normal gyp path-munging
++ # fails us. This hack gets the right path.
++ 'ldflags': [
++ '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
++ ],
++ }],
++ ['OS=="win"', {
++ 'defines': [
++ 'WIN32',
++ 'NOMINMAX', # Refs: https://chromium-review.googlesource.com/c/v8/v8/+/1456620
++ ],
++ # 4351: VS 2005 and later are warning us that they've fixed a bug
++ # present in VS 2003 and earlier.
++ 'msvs_disabled_warnings': [4351],
++ 'msvs_configuration_attributes': {
++ 'CharacterSet': '1',
++ },
++ }],
++ ['OS=="win" and v8_target_arch=="ia32"', {
++ 'msvs_settings': {
++ 'VCCLCompilerTool': {
++ # Ensure no surprising artifacts from 80bit double math with x86.
++ 'AdditionalOptions': ['/arch:SSE2'],
++ },
++ },
++ }],
++ ['OS=="win" and v8_enable_prof==1', {
++ 'msvs_settings': {
++ 'VCLinkerTool': {
++ 'GenerateMapFile': 'true',
++ },
++ },
++ }],
++ ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
++ or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
++ v8_target_arch=="ia32"', {
++ 'cflags': [
++ '-msse2',
++ '-mfpmath=sse',
++ '-mmmx', # Allows mmintrin.h for MMX intrinsics.
++ ],
++ }],
++ ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
++ or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
++ (v8_target_arch=="arm" or v8_target_arch=="ia32" or \
++ v8_target_arch=="mips" or v8_target_arch=="mipsel" or \
++ v8_target_arch=="ppc")', {
++ 'target_conditions': [
++ ['_toolset=="host"', {
++ 'conditions': [
++ ['host_cxx_is_biarch==1', {
++ 'conditions': [
++ ['host_arch=="s390x"', {
++ 'cflags': [ '-m31' ],
++ 'ldflags': [ '-m31' ]
++ },{
++ 'cflags': [ '-m32' ],
++ 'ldflags': [ '-m32' ]
++ }],
++ ],
++ }],
++ ],
++ 'xcode_settings': {
++ 'ARCHS': [ 'i386' ],
++ },
++ }],
++ ['_toolset=="target"', {
++ 'conditions': [
++ ['target_cxx_is_biarch==1', {
++ 'conditions': [
++ ['host_arch=="s390x"', {
++ 'cflags': [ '-m31' ],
++ 'ldflags': [ '-m31' ]
++ },{
++ 'cflags': [ '-m32' ],
++ 'ldflags': [ '-m32' ],
++ }],
++ ],
++ }],
++ ],
++ 'xcode_settings': {
++ 'ARCHS': [ 'i386' ],
++ },
++ }],
++ ],
++ }],
++ ['(OS=="linux" or OS=="android") and \
++ (v8_target_arch=="x64" or v8_target_arch=="arm64" or \
++ v8_target_arch=="ppc64" or v8_target_arch=="s390x")', {
++ 'target_conditions': [
++ ['_toolset=="host"', {
++ 'conditions': [
++ ['host_cxx_is_biarch==1', {
++ 'cflags': [ '-m64' ],
++ 'ldflags': [ '-m64' ]
++ }],
++ ],
++ }],
++ ['_toolset=="target"', {
++ 'conditions': [
++ ['target_cxx_is_biarch==1', {
++ 'cflags': [ '-m64' ],
++ 'ldflags': [ '-m64' ],
++ }],
++ ]
++ }],
++ ],
++ }],
++ ['OS=="android" and v8_android_log_stdout==1', {
++ 'defines': [
++ 'V8_ANDROID_LOG_STDOUT',
++ ],
++ }],
++ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
++ or OS=="netbsd" or OS=="qnx" or OS=="aix"', {
++ 'conditions': [
++ [ 'v8_no_strict_aliasing==1', {
++ 'cflags': [ '-fno-strict-aliasing' ],
++ }],
++ ], # conditions
++ }],
++ ['OS=="solaris"', {
++ 'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
++ }],
++ ['OS=="freebsd" or OS=="openbsd"', {
++ 'cflags': [ '-I/usr/local/include' ],
++ }],
++ ['OS=="netbsd"', {
++ 'cflags': [ '-I/usr/pkg/include' ],
++ }],
++ ['OS=="aix"', {
++ 'defines': [
++ # Support for malloc(0)
++ '_LINUX_SOURCE_COMPAT=1',
++ '__STDC_FORMAT_MACROS',
++ '_ALL_SOURCE=1'],
++ 'conditions': [
++ [ 'v8_target_arch=="ppc"', {
++ 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ],
++ }],
++ [ 'v8_target_arch=="ppc64"', {
++ 'cflags': [ '-maix64', '-fdollars-in-identifiers' ],
++ 'ldflags': [ '-maix64 -Wl,-bbigtoc' ],
++ }],
++ ],
++ }],
++ ], # conditions
++ 'configurations': {
++ 'Debug': {
++ 'defines': [
++ 'ENABLE_DISASSEMBLER',
++ 'V8_ENABLE_CHECKS',
++ 'OBJECT_PRINT',
++ 'VERIFY_HEAP',
++ 'DEBUG',
++ 'V8_TRACE_MAPS',
++ 'V8_ENABLE_ALLOCATION_TIMEOUT',
++ 'V8_ENABLE_FORCE_SLOW_PATH',
++ ],
++ 'conditions': [
++ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
++ OS=="qnx" or OS=="aix"', {
++ 'cflags': [ '-Woverloaded-virtual', '<(wno_array_bounds)', ],
++ }],
++ ['OS=="linux" and v8_enable_backtrace==1', {
++ # Support for backtrace_symbols.
++ 'ldflags': [ '-rdynamic' ],
++ }],
++ ['OS=="aix"', {
++ 'ldflags': [ '-Wl,-bbigtoc' ],
++ 'conditions': [
++ ['v8_target_arch=="ppc64"', {
++ 'cflags': [ '-maix64 -mcmodel=large' ],
++ }],
++ ],
++ }],
++ ['OS=="android"', {
++ 'variables': {
++ 'android_full_debug%': 1,
++ },
++ 'conditions': [
++ ['android_full_debug==0', {
++ # Disable full debug if we want a faster v8 in a debug build.
++ # TODO(2304): pass DISABLE_DEBUG_ASSERT instead of hiding DEBUG.
++ 'defines!': [
++ 'DEBUG',
++ 'ENABLE_SLOW_DCHECKS',
++ ],
++ }],
++ ],
++ }],
++ ['linux_use_gold_flags==1', {
++ 'target_conditions': [
++ ['_toolset=="target"', {
++ 'ldflags': [
++ # Experimentation found that using four linking threads
++ # saved ~20% of link time.
++ # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
++ # Only apply this to the target linker, since the host
++ # linker might not be gold, but isn't used much anyway.
++ '-Wl,--threads',
++ '-Wl,--thread-count=4',
++ ],
++ }],
++ ],
++ }],
++ ['v8_optimized_debug==0', {
++ 'msvs_settings': {
++ 'VCCLCompilerTool': {
++ 'Optimization': '0',
++ 'conditions': [
++ ['component=="shared_library" or force_dynamic_crt==1', {
++ 'RuntimeLibrary': '3', # /MDd
++ }, {
++ 'RuntimeLibrary': '1', # /MTd
++ }],
++ ],
++ },
++ 'VCLinkerTool': {
++ 'LinkIncremental': '2',
++ },
++ },
++ 'variables': {
++ 'v8_enable_slow_dchecks%': 1,
++ },
++ 'conditions': [
++ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
++ OS=="qnx" or OS=="aix"', {
++ 'cflags!': [
++ '-O3',
++ '-O2',
++ '-O1',
++ '-Os',
++ ],
++ 'cflags': [
++ '-fdata-sections',
++ '-ffunction-sections',
++ ],
++ }],
++ ['OS=="mac"', {
++ 'xcode_settings': {
++ 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
++ },
++ }],
++ ['v8_enable_slow_dchecks==1', {
++ 'defines': [
++ 'ENABLE_SLOW_DCHECKS',
++ ],
++ }],
++ ],
++ }, {
++ 'msvs_settings': {
++ 'VCCLCompilerTool': {
++ 'Optimization': '2',
++ 'InlineFunctionExpansion': '2',
++ 'EnableIntrinsicFunctions': 'true',
++ 'FavorSizeOrSpeed': '0',
++ 'StringPooling': 'true',
++ 'BasicRuntimeChecks': '0',
++ 'conditions': [
++ ['component=="shared_library" or force_dynamic_crt==1', {
++ 'RuntimeLibrary': '3', #/MDd
++ }, {
++ 'RuntimeLibrary': '1', #/MTd
++ }],
++ ],
++ },
++ 'VCLinkerTool': {
++ 'LinkIncremental': '1',
++ 'OptimizeReferences': '2',
++ 'EnableCOMDATFolding': '2',
++ },
++ },
++ 'variables': {
++ 'v8_enable_slow_dchecks%': 0,
++ },
++ 'conditions': [
++ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
++ OS=="qnx" or OS=="aix"', {
++ 'cflags!': [
++ '-O0',
++ '-O1',
++ '-Os',
++ ],
++ 'cflags': [
++ '-fdata-sections',
++ '-ffunction-sections',
++ ],
++ 'conditions': [
++ # Don't use -O3 with sanitizers.
++ ['asan==0 and msan==0 and lsan==0 \
++ and tsan==0 and ubsan==0 and ubsan_vptr==0', {
++ 'cflags': ['-O3'],
++ 'cflags!': ['-O2'],
++ }, {
++ 'cflags': ['-O2'],
++ 'cflags!': ['-O3'],
++ }],
++ ],
++ }],
++ ['OS=="mac"', {
++ 'xcode_settings': {
++ 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
++ 'GCC_STRICT_ALIASING': 'YES',
++ },
++ }],
++ ['v8_enable_slow_dchecks==1', {
++ 'defines': [
++ 'ENABLE_SLOW_DCHECKS',
++ ],
++ }],
++ ],
++ }],
++ # Temporary refs: https://github.com/nodejs/node/pull/23801
++ ['v8_enable_handle_zapping==1', {
++ 'defines': ['ENABLE_HANDLE_ZAPPING',],
++ }],
++ ],
++
++ }, # DebugBaseCommon
++ 'Release': {
++ 'variables': {
++ 'v8_enable_slow_dchecks%': 0,
++ },
++ # Temporary refs: https://github.com/nodejs/node/pull/23801
++ 'defines!': ['ENABLE_HANDLE_ZAPPING',],
++ 'conditions': [
++ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
++ or OS=="aix"', {
++ 'cflags!': [
++ '-Os',
++ ],
++ 'cflags': [
++ '-fdata-sections',
++ '-ffunction-sections',
++ '<(wno_array_bounds)',
++ ],
++ 'conditions': [
++ # Don't use -O3 with sanitizers.
++ ['asan==0 and msan==0 and lsan==0 \
++ and tsan==0 and ubsan==0 and ubsan_vptr==0', {
++ 'cflags': ['-O3'],
++ 'cflags!': ['-O2'],
++ }, {
++ 'cflags': ['-O2'],
++ 'cflags!': ['-O3'],
++ }],
++ ],
++ }],
++ ['OS=="android"', {
++ 'cflags!': [
++ '-O3',
++ '-Os',
++ ],
++ 'cflags': [
++ '-fdata-sections',
++ '-ffunction-sections',
++ '-O2',
++ ],
++ }],
++ ['OS=="mac"', {
++ 'xcode_settings': {
++ 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
++
++ # -fstrict-aliasing. Mainline gcc
++ # enables this at -O2 and above,
++ # but Apple gcc does not unless it
++ # is specified explicitly.
++ 'GCC_STRICT_ALIASING': 'YES',
++ },
++ }], # OS=="mac"
++ ['OS=="win"', {
++ 'msvs_settings': {
++ 'VCCLCompilerTool': {
++ 'Optimization': '2',
++ 'InlineFunctionExpansion': '2',
++ 'EnableIntrinsicFunctions': 'true',
++ 'FavorSizeOrSpeed': '0',
++ 'StringPooling': 'true',
++ 'conditions': [
++ ['component=="shared_library" or force_dynamic_crt==1', {
++ 'RuntimeLibrary': '2', #/MD
++ }, {
++ 'RuntimeLibrary': '0', #/MT
++ }],
++ ],
++ },
++ 'VCLinkerTool': {
++ 'LinkIncremental': '1',
++ 'OptimizeReferences': '2',
++ 'EnableCOMDATFolding': '2',
++ },
++ },
++ }], # OS=="win"
++ ['v8_enable_slow_dchecks==1', {
++ 'defines': [
++ 'ENABLE_SLOW_DCHECKS',
++ ],
++ }],
++ ], # conditions
++ }, # Release
++ }, # configurations
++ 'msvs_disabled_warnings': [
++ 4129, # unrecognized character escape sequence (torque-generated)
++ 4245, # Conversion with signed/unsigned mismatch.
++ 4267, # Conversion with possible loss of data.
++ 4324, # Padding structure due to alignment.
++ # 4351, # [refack] Old issue with array init.
++ 4355, # 'this' used in base member initializer list
++ 4661, # no suitable definition provided for explicit template instantiation request
++ 4701, # Potentially uninitialized local variable.
++ 4702, # Unreachable code.
++ 4703, # Potentially uninitialized local pointer variable.
++ 4709, # Comma operator within array index expr (bugged).
++ # 4714, # Function marked forceinline not inlined.
++ 4715, # Not all control paths return a value. (see https://crbug.com/v8/7658)
++ 4718, # Recursive call has no side-effect.
++ 4723, # https://crbug.com/v8/7771
++ 4724, # https://crbug.com/v8/7771
++ 4800, # Forcing value to bool.
++ ],
++ }, # target_defaults
++}
+diff -Naur node-v12.17.0/tools/v8_gypfiles/v8.gyp node-v12.17.0+iPhone/tools/v8_gypfiles/v8.gyp
+--- node-v12.17.0/tools/v8_gypfiles/v8.gyp 2020-05-26 04:53:35.000000000 -0700
++++ node-v12.17.0+iPhone/tools/v8_gypfiles/v8.gyp 2020-05-27 20:28:31.000000000 -0700
+@@ -1437,6 +1437,12 @@
],
},
'conditions': [
@@ -115,53 +2591,1617 @@ diff -ur node-v12.3.1/tools/v8_gypfiles/v8.gyp node-v12.3.1+iPhone/tools/v8_gypf
['OS=="mac"', {
'xcode_settings': {
'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']
-@@ -2221,7 +2227,7 @@
- }],
- ],
- 'conditions': [
-- ['OS=="linux"', {
-+ ['OS=="linux" or (host_os=="linux" and _toolset=="host")', {
- 'link_settings': {
- 'libraries': [
- '-ldl',
-@@ -2296,15 +2302,37 @@
- '<(V8_ROOT)/src/base/platform/platform-fuchsia.cc',
- ]},
- ],
-- ['OS=="mac"', {
-+ ['OS=="mac" or OS=="ios"', {
- 'sources': [
- '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
-- '<(V8_ROOT)/src/base/platform/platform-macos.cc',
- '<(V8_ROOT)/src/base/platform/platform-posix.cc',
- '<(V8_ROOT)/src/base/platform/platform-posix.h',
- '<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
- '<(V8_ROOT)/src/base/platform/platform-posix-time.h',
-- ]},
+diff -Naur node-v12.17.0/tools/v8_gypfiles/v8.gyp.orig node-v12.17.0+iPhone/tools/v8_gypfiles/v8.gyp.orig
+--- node-v12.17.0/tools/v8_gypfiles/v8.gyp.orig 1969-12-31 16:00:00.000000000 -0800
++++ node-v12.17.0+iPhone/tools/v8_gypfiles/v8.gyp.orig 2020-05-27 20:27:00.000000000 -0700
+@@ -0,0 +1,1554 @@
++# Copyright 2012 the V8 project authors. All rights reserved.
++# Use of this source code is governed by a BSD-style license that can be
++# found in the LICENSE file.
++{
++ 'variables': {
++ 'V8_ROOT': '../../deps/v8',
++ 'v8_code': 1,
++ 'v8_random_seed%': 314159265,
++ 'v8_vector_stores%': 0,
++ 'v8_embed_script%': "",
++ 'mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)',
++ 'v8_os_page_size%': 0,
++ 'generate_bytecode_output_root': '<(SHARED_INTERMEDIATE_DIR)/generate-bytecode-output-root',
++ 'generate_bytecode_builtins_list_output': '<(generate_bytecode_output_root)/builtins-generated/bytecodes-builtins-list.h',
++ 'torque_files': [
++ "<(V8_ROOT)/src/builtins/arguments.tq",
++ "<(V8_ROOT)/src/builtins/array-copywithin.tq",
++ "<(V8_ROOT)/src/builtins/array-every.tq",
++ "<(V8_ROOT)/src/builtins/array-filter.tq",
++ "<(V8_ROOT)/src/builtins/array-find.tq",
++ "<(V8_ROOT)/src/builtins/array-findindex.tq",
++ "<(V8_ROOT)/src/builtins/array-foreach.tq",
++ "<(V8_ROOT)/src/builtins/array-join.tq",
++ "<(V8_ROOT)/src/builtins/array-lastindexof.tq",
++ "<(V8_ROOT)/src/builtins/array-map.tq",
++ "<(V8_ROOT)/src/builtins/array-of.tq",
++ "<(V8_ROOT)/src/builtins/array-reduce-right.tq",
++ "<(V8_ROOT)/src/builtins/array-reduce.tq",
++ "<(V8_ROOT)/src/builtins/array-reverse.tq",
++ "<(V8_ROOT)/src/builtins/array-shift.tq",
++ "<(V8_ROOT)/src/builtins/array-slice.tq",
++ "<(V8_ROOT)/src/builtins/array-some.tq",
++ "<(V8_ROOT)/src/builtins/array-splice.tq",
++ "<(V8_ROOT)/src/builtins/array-unshift.tq",
++ "<(V8_ROOT)/src/builtins/array.tq",
++ "<(V8_ROOT)/src/builtins/base.tq",
++ "<(V8_ROOT)/src/builtins/bigint.tq",
++ "<(V8_ROOT)/src/builtins/boolean.tq",
++ "<(V8_ROOT)/src/builtins/collections.tq",
++ "<(V8_ROOT)/src/builtins/data-view.tq",
++ "<(V8_ROOT)/src/builtins/extras-utils.tq",
++ "<(V8_ROOT)/src/builtins/frames.tq",
++ "<(V8_ROOT)/src/builtins/growable-fixed-array.tq",
++ "<(V8_ROOT)/src/builtins/internal-coverage.tq",
++ "<(V8_ROOT)/src/builtins/iterator.tq",
++ "<(V8_ROOT)/src/builtins/math.tq",
++ "<(V8_ROOT)/src/builtins/object-fromentries.tq",
++ "<(V8_ROOT)/src/builtins/object.tq",
++ "<(V8_ROOT)/src/builtins/proxy-constructor.tq",
++ "<(V8_ROOT)/src/builtins/proxy-delete-property.tq",
++ "<(V8_ROOT)/src/builtins/proxy-get-property.tq",
++ "<(V8_ROOT)/src/builtins/proxy-get-prototype-of.tq",
++ "<(V8_ROOT)/src/builtins/proxy-has-property.tq",
++ "<(V8_ROOT)/src/builtins/proxy-is-extensible.tq",
++ "<(V8_ROOT)/src/builtins/proxy-prevent-extensions.tq",
++ "<(V8_ROOT)/src/builtins/proxy-revocable.tq",
++ "<(V8_ROOT)/src/builtins/proxy-revoke.tq",
++ "<(V8_ROOT)/src/builtins/proxy-set-property.tq",
++ "<(V8_ROOT)/src/builtins/proxy-set-prototype-of.tq",
++ "<(V8_ROOT)/src/builtins/proxy.tq",
++ "<(V8_ROOT)/src/builtins/reflect.tq",
++ "<(V8_ROOT)/src/builtins/regexp-match.tq",
++ "<(V8_ROOT)/src/builtins/regexp-replace.tq",
++ "<(V8_ROOT)/src/builtins/regexp-source.tq",
++ "<(V8_ROOT)/src/builtins/regexp-test.tq",
++ "<(V8_ROOT)/src/builtins/regexp.tq",
++ "<(V8_ROOT)/src/builtins/string.tq",
++ "<(V8_ROOT)/src/builtins/string-endswith.tq",
++ "<(V8_ROOT)/src/builtins/string-html.tq",
++ "<(V8_ROOT)/src/builtins/string-iterator.tq",
++ "<(V8_ROOT)/src/builtins/string-pad.tq",
++ "<(V8_ROOT)/src/builtins/string-repeat.tq",
++ "<(V8_ROOT)/src/builtins/string-slice.tq",
++ "<(V8_ROOT)/src/builtins/string-startswith.tq",
++ "<(V8_ROOT)/src/builtins/string-substring.tq",
++ "<(V8_ROOT)/src/builtins/torque-internal.tq",
++ "<(V8_ROOT)/src/builtins/typed-array-createtypedarray.tq",
++ "<(V8_ROOT)/src/builtins/typed-array-every.tq",
++ "<(V8_ROOT)/src/builtins/typed-array-filter.tq",
++ "<(V8_ROOT)/src/builtins/typed-array-find.tq",
++ "<(V8_ROOT)/src/builtins/typed-array-findindex.tq",
++ "<(V8_ROOT)/src/builtins/typed-array-foreach.tq",
++ "<(V8_ROOT)/src/builtins/typed-array-reduce.tq",
++ "<(V8_ROOT)/src/builtins/typed-array-reduceright.tq",
++ "<(V8_ROOT)/src/builtins/typed-array-slice.tq",
++ "<(V8_ROOT)/src/builtins/typed-array-some.tq",
++ "<(V8_ROOT)/src/builtins/typed-array-subarray.tq",
++ "<(V8_ROOT)/src/builtins/typed-array.tq",
++ "<(V8_ROOT)/third_party/v8/builtins/array-sort.tq",
++ "<(V8_ROOT)/test/torque/test-torque.tq",
++ ],
++ 'torque_output_root': '<(SHARED_INTERMEDIATE_DIR)/torque-output-root',
++ 'torque_files_replaced': ['<!@pymod_do_main(ForEachReplace ".tq" "-tq-csa" <@(torque_files))'],
++ 'torque_outputs': ['<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/%s.cc" <@(torque_files_replaced))'],
++ 'torque_outputs+': ['<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/%s.h" <@(torque_files_replaced))'],
++ 'v8_compiler_sources': ['<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources = ")'],
++
++ 'conditions': [
++ ['v8_enable_i18n_support', {
++ 'torque_files': [
++ "<(V8_ROOT)/src/objects/intl-objects.tq",
++ ]
++ }]
++ ],
++ },
++ 'includes': ['toolchain.gypi', 'features.gypi'],
++ 'target_defaults': {
++ 'msvs_settings': {
++ 'VCCLCompilerTool': {
++ 'AdditionalOptions': ['/utf-8']
++ }
++ },
++ },
++ 'targets': [
++ {
++ 'target_name': 'run_torque',
++ 'type': 'none',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'dependencies': ['torque#host'],
++ 'toolsets': ['host', 'target'],
++ }, {
++ 'dependencies': ['torque'],
++ }],
++ ],
++ 'hard_dependency': 1,
++ 'direct_dependent_settings': {
++ 'include_dirs': [
++ '<(torque_output_root)',
++ ],
++ },
++ 'actions': [
++ {
++ 'action_name': 'run_torque_action',
++ 'inputs': [ # Order matters.
++ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
++ '<@(torque_files)',
++ ],
++ 'outputs': [
++ '<(torque_output_root)/torque-generated/builtin-definitions-tq.h',
++ '<(torque_output_root)/torque-generated/field-offsets-tq.h',
++ '<(torque_output_root)/torque-generated/class-verifiers-tq.cc',
++ '<(torque_output_root)/torque-generated/class-verifiers-tq.h',
++ '<(torque_output_root)/torque-generated/objects-printer-tq.cc',
++ '<(torque_output_root)/torque-generated/class-definitions-tq.cc',
++ '<(torque_output_root)/torque-generated/class-definitions-tq-inl.h',
++ '<(torque_output_root)/torque-generated/class-definitions-tq.h',
++ '<(torque_output_root)/torque-generated/class-debug-readers-tq.cc',
++ '<(torque_output_root)/torque-generated/class-debug-readers-tq.h',
++ '<(torque_output_root)/torque-generated/exported-macros-assembler-tq.cc',
++ '<(torque_output_root)/torque-generated/exported-macros-assembler-tq.h',
++ '<(torque_output_root)/torque-generated/csa-types-tq.h',
++ '<(torque_output_root)/torque-generated/instance-types-tq.h',
++ '<@(torque_outputs)',
++ ],
++ 'action': [
++ '<@(_inputs)',
++ '-o', '<(torque_output_root)/torque-generated',
++ '-v8-root', '<(V8_ROOT)'
++ ],
++ },
++ ],
++ }, # run_torque
++ {
++ 'target_name': 'v8_maybe_icu',
++ 'type': 'none',
++ 'hard_dependency': 1,
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ['v8_enable_i18n_support', {
++ 'dependencies': [
++ '<(icu_gyp_path):icui18n',
++ '<(icu_gyp_path):icuuc',
++ ],
++ 'export_dependent_settings': [
++ '<(icu_gyp_path):icui18n',
++ '<(icu_gyp_path):icuuc',
++ ],
++ }],
++ ],
++ }, # v8_maybe_icu
++ {
++ 'target_name': 'torque_generated_initializers',
++ 'type': 'none',
++ 'hard_dependency': 1,
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ],
++ 'dependencies': [
++ 'generate_bytecode_builtins_list',
++ 'run_torque',
++ 'v8_maybe_icu',
++ ],
++ 'direct_dependent_settings': {
++ 'sources': [
++ '<(torque_output_root)/torque-generated/exported-macros-assembler-tq.cc',
++ '<(torque_output_root)/torque-generated/exported-macros-assembler-tq.h',
++ '<(torque_output_root)/torque-generated/csa-types-tq.h',
++ '<@(torque_outputs)',
++ ],
++ }
++ }, # torque_generated_initializers
++ {
++ 'target_name': 'torque_generated_definitions',
++ 'type': 'none',
++ 'hard_dependency': 1,
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ],
++ 'dependencies': [
++ 'generate_bytecode_builtins_list',
++ 'run_torque',
++ 'v8_maybe_icu',
++ ],
++ 'direct_dependent_settings': {
++ 'sources': [
++ '<(torque_output_root)/torque-generated/class-definitions-tq.cc',
++ '<(torque_output_root)/torque-generated/class-verifiers-tq.cc',
++ '<(torque_output_root)/torque-generated/class-verifiers-tq.h',
++ '<(torque_output_root)/torque-generated/objects-printer-tq.cc',
++ ],
++ 'include_dirs': [
++ '<(torque_output_root)',
++ ],
++ },
++ }, # torque_generated_definitions
++ {
++ 'target_name': 'generate_bytecode_builtins_list',
++ 'type': 'none',
++ 'hard_dependency': 1,
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'dependencies': ['bytecode_builtins_list_generator#host'],
++ 'toolsets': ['host', 'target'],
++ }, {
++ 'dependencies': ['bytecode_builtins_list_generator'],
++ }],
++ ],
++ 'direct_dependent_settings': {
++ 'sources': [
++ '<(generate_bytecode_builtins_list_output)',
++ ],
++ 'include_dirs': [
++ '<(generate_bytecode_output_root)',
++ '<(torque_output_root)',
++ ],
++ },
++ 'actions': [
++ {
++ 'action_name': 'generate_bytecode_builtins_list_action',
++ 'inputs': [
++ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
++ ],
++ 'outputs': [
++ '<(generate_bytecode_builtins_list_output)',
++ ],
++ 'action': [
++ 'python',
++ '<(V8_ROOT)/tools/run.py',
++ '<@(_inputs)',
++ '<@(_outputs)',
++ ],
++ },
++ ],
++ }, # generate_bytecode_builtins_list
++
++ {
++ # This rule delegates to either v8_snapshot or v8_nosnapshot depending on
++ # the current variables.
++ # The intention is to make the 'calling' rules a bit simpler.
++ 'target_name': 'v8_maybe_snapshot',
++ 'type': 'none',
++ 'toolsets': ['target'],
++ 'hard_dependency': 1,
++ 'conditions': [
++ # The dependency on v8_base should come from a transitive
++ # dependency however the Android toolchain requires libv8_base.a
++ # to appear before libv8_snapshot.a so it's listed explicitly.
++ ['v8_use_snapshot==1', {
++ 'dependencies': ['v8_base', 'v8_snapshot'],
++ }, {
++ 'dependencies': ['v8_base', 'v8_init', 'v8_nosnapshot'],
++ }],
++ ]
++ }, # v8_maybe_snapshot
++ {
++ 'target_name': 'v8_init',
++ 'type': 'static_library',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ],
++ 'dependencies': [
++ 'generate_bytecode_builtins_list',
++ 'run_torque',
++ 'v8_initializers',
++ 'v8_maybe_icu',
++ ],
++ 'sources': [
++ ### gcmole(all) ###
++ '<(V8_ROOT)/src/init/setup-isolate-full.cc',
++
++ # '<(generate_bytecode_builtins_list_output)',
++ ],
++ }, # v8_init
++ {
++ 'target_name': 'v8_initializers',
++ 'type': 'static_library',
++ 'dependencies': [
++ 'torque_generated_initializers',
++ ],
++ 'include_dirs': [
++ '<(torque_output_root)',
++ '<(generate_bytecode_output_root)',
++ ],
++ 'sources': [
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_initializers.*?sources = ")',
++
++ '<@(torque_outputs)',
++ ],
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ['v8_target_arch=="ia32"', {
++ 'sources': [
++ '<(V8_ROOT)/src/builtins/ia32/builtins-ia32.cc',
++ ],
++ }],
++ ['v8_target_arch=="x64"', {
++ 'sources': [
++ '<(V8_ROOT)/src/builtins/x64/builtins-x64.cc',
+ ],
++ }],
++ ['v8_target_arch=="arm"', {
++ 'sources': [
++ '<(V8_ROOT)/src/builtins/arm/builtins-arm.cc',
++ ],
++ }],
++ ['v8_target_arch=="arm64"', {
++ 'sources': [
++ '<(V8_ROOT)/src/builtins/arm64/builtins-arm64.cc',
++ ],
++ }],
++ ['v8_target_arch=="mips" or v8_target_arch=="mipsel"', {
++ 'sources': [
++ '<(V8_ROOT)/src/builtins/mips/builtins-mips.cc',
++ ],
++ }],
++ ['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
++ 'sources': [
++ '<(V8_ROOT)/src/builtins/mips64/builtins-mips64.cc',
++ ],
++ }],
++ ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
++ 'sources': [
++ '<(V8_ROOT)/src/builtins/ppc/builtins-ppc.cc',
++ ],
++ }],
++ ['v8_target_arch=="s390x"', {
++ 'sources': [
++ '<(V8_ROOT)/src/builtins/s390/builtins-s390.cc',
++ ],
++ }],
++ ['v8_enable_i18n_support==1', {
++ 'dependencies': [
++ '<(icu_gyp_path):icui18n',
++ '<(icu_gyp_path):icuuc',
++ ],
++ }, {
++ 'sources!': [
++ '<(V8_ROOT)/src/builtins/builtins-intl-gen.cc',
++ ],
++ }],
++ ['OS=="win"', {
++ 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
++ 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
++ 'sources': [
++ '<(_msvs_precompiled_header)',
++ '<(_msvs_precompiled_source)',
++ ],
++ }],
++ ],
++ }, # v8_initializers
++ {
++ 'target_name': 'v8_snapshot',
++ 'type': 'static_library',
++ 'toolsets': ['target'],
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'dependencies': [
++ 'generate_bytecode_builtins_list',
++ 'run_torque',
++ 'mksnapshot#host',
++ 'v8_maybe_icu',
++ # [GYP] added explicitly, instead of inheriting from the other deps
++ 'v8_base_without_compiler',
++ 'v8_compiler_for_mksnapshot',
++ 'v8_initializers',
++ 'v8_libplatform',
++ ]
++ }, {
++ 'dependencies': [
++ 'generate_bytecode_builtins_list',
++ 'run_torque',
++ 'mksnapshot',
++ 'v8_maybe_icu',
++ # [GYP] added explicitly, instead of inheriting from the other deps
++ 'v8_base_without_compiler',
++ 'v8_compiler_for_mksnapshot',
++ 'v8_initializers',
++ 'v8_libplatform',
++ ]
++ }],
++ ],
++ 'sources': [
++ '<(V8_ROOT)/src/init/setup-isolate-deserialize.cc',
++ './extras-libraries.cc',
++ ],
++ 'xcode_settings': {
++ # V8 7.4 over macOS10.11 compatibility
++ # Refs: https://github.com/nodejs/node/pull/26685
++ 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
++ },
++ 'actions': [
++ {
++ 'action_name': 'run_mksnapshot',
++ 'message': 'generating: >@(_outputs)',
++ 'variables': {
++ 'mksnapshot_flags': [
++ '--turbo_instruction_scheduling',
++ # In cross builds, the snapshot may be generated for both the host and
++ # target toolchains. The same host binary is used to generate both, so
++ # mksnapshot needs to know which target OS to use at runtime. It's weird,
++ # but the target OS is really <(OS).
++ '--target_os=<(OS)',
++ '--target_arch=<(v8_target_arch)',
++ '--startup_src', '<(INTERMEDIATE_DIR)/snapshot.cc',
++ ],
++ },
++ 'inputs': [
++ '<(mksnapshot_exec)',
++ ],
++ 'outputs': ["<(INTERMEDIATE_DIR)/snapshot.cc"],
++ 'process_outputs_as_sources': 1,
+ 'conditions': [
-+ ['(host_os=="mac" and _toolset=="host") or _toolset=="target"', {
++ ['v8_enable_embedded_builtins', {
++ # In this case we use `embedded_variant "Default"`
++ # and `suffix = ''` for the template `embedded${suffix}.S`.
++ 'outputs': ['<(INTERMEDIATE_DIR)/embedded.S'],
++ 'variables': {
++ 'mksnapshot_flags': [
++ '--embedded_variant', 'Default',
++ '--embedded_src', '<(INTERMEDIATE_DIR)/embedded.S',
++ ],
++ },
++ }, {
++ 'outputs': ['<(V8_ROOT)/src/snapshot/embedded/embedded-empty.cc']
++ }],
++ ['v8_random_seed', {
++ 'variables': {
++ 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'],
++ },
++ }],
++ ['v8_os_page_size', {
++ 'variables': {
++ 'mksnapshot_flags': ['--v8_os_page_size', '<(v8_os_page_size)'],
++ },
++ }],
++ ['v8_embed_script != ""', {
++ 'inputs': ['<(v8_embed_script)'],
++ 'variables': {
++ 'mksnapshot_flags': ['<(v8_embed_script)'],
++ },
++ }],
++ ['v8_enable_snapshot_code_comments', {
++ 'variables': {
++ 'mksnapshot_flags': ['--code-comments'],
++ },
++ }],
++ ['v8_enable_snapshot_native_code_counters', {
++ 'variables': {
++ 'mksnapshot_flags': ['--native-code-counters'],
++ },
++ }, {
++ # --native-code-counters is the default in debug mode so make sure we can
++ # unset it.
++ 'variables': {
++ 'mksnapshot_flags': ['--no-native-code-counters'],
++ },
++ }],
++ ],
++ 'action': [
++ '>@(_inputs)',
++ '>@(mksnapshot_flags)',
++ ],
++ },
++ ],
++ }, # v8_snapshot
++ {
++ 'target_name': 'v8_nosnapshot',
++ 'type': 'static_library',
++ 'dependencies': [
++ # 'js2c_extras', # Disabled for Node.js
++ 'generate_bytecode_builtins_list',
++ 'run_torque',
++ 'v8_maybe_icu',
++ ],
++ 'sources': [
++ './extras-libraries.cc',
++ '<(V8_ROOT)/src/snapshot/embedded/embedded-empty.cc',
++ '<(V8_ROOT)/src/snapshot/snapshot-empty.cc',
++ ],
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ['component=="shared_library"', {
++ 'defines': [
++ 'BUILDING_V8_SHARED',
++ ],
++ }],
++ ]
++ }, # v8_nosnapshot
++ {
++ 'target_name': 'v8_version',
++ 'type': 'none',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ],
++ 'direct_dependent_settings': {
++ 'sources': [
++ '<(V8_ROOT)/include/v8-value-serializer-version.h',
++ '<(V8_ROOT)/include/v8-version-string.h',
++ '<(V8_ROOT)/include/v8-version.h',
++ ],
++ },
++ }, # v8_version
++ {
++ 'target_name': 'v8_headers',
++ 'type': 'none',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ],
++ 'dependencies': [
++ 'v8_version',
++ ],
++ 'direct_dependent_settings': {
++ 'sources': [
++ '<(V8_ROOT)/include/v8-internal.h',
++ '<(V8_ROOT)/include/v8.h',
++ '<(V8_ROOT)/include/v8config.h',
++
++ # The following headers cannot be platform-specific. The include validation
++ # of `gn gen $dir --check` requires all header files to be available on all
++ # platforms.
++ '<(V8_ROOT)/include/v8-wasm-trap-handler-posix.h',
++ '<(V8_ROOT)/include/v8-wasm-trap-handler-win.h',
++ ],
++ },
++ }, # v8_headers
++ {
++ 'target_name': 'v8_shared_internal_headers',
++ 'type': 'none',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ],
++ 'dependencies': [
++ 'v8_headers',
++ ],
++ 'direct_dependent_settings': {
++ 'sources': [
++ '<(V8_ROOT)/src/common/globals.h',
++ ],
++ },
++ }, # v8_shared_internal_headers
++ {
++ 'target_name': 'v8_compiler_opt',
++ 'type': 'static_library',
++ 'dependencies': [
++ 'generate_bytecode_builtins_list',
++ 'run_torque',
++ 'v8_maybe_icu',
++ ],
++ 'sources': ['<@(v8_compiler_sources)'],
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ['OS=="win"', {
++ 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
++ 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
++ 'sources': [
++ '<(_msvs_precompiled_header)',
++ '<(_msvs_precompiled_source)',
++ ],
++ }],
++ ],
++ }, # v8_compiler_opt
++ {
++ 'target_name': 'v8_compiler',
++ 'type': 'static_library',
++ 'dependencies': [
++ 'generate_bytecode_builtins_list',
++ 'run_torque',
++ 'v8_maybe_icu',
++ ],
++ 'sources': ['<@(v8_compiler_sources)'],
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ['OS=="win"', {
++ 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
++ 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
++ 'sources': [
++ '<(_msvs_precompiled_header)',
++ '<(_msvs_precompiled_source)',
++ ],
++ }],
++ ],
++ }, # v8_compiler
++ {
++ 'target_name': 'v8_compiler_for_mksnapshot',
++ 'type': 'none',
++ 'hard_dependency': 1,
++ 'dependencies': [
++ 'generate_bytecode_builtins_list',
++ 'run_torque',
++ 'v8_maybe_icu',
++ ],
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ['is_component_build and not v8_optimized_debug and v8_enable_fast_mksnapshot', {
++ 'dependencies': [
++ 'v8_compiler_opt',
++ ],
++ 'export_dependent_settings': [
++ 'v8_compiler_opt',
++ ],
++ }, {
++ 'dependencies': [
++ 'v8_compiler',
++ ],
++ 'export_dependent_settings': [
++ 'v8_compiler',
++ ],
++ }],
++ ],
++ }, # v8_compiler_for_mksnapshot
++ {
++ 'target_name': 'v8_base_without_compiler',
++ 'type': 'static_library',
++ 'dependencies': [
++ # Code generators that only need to be build for the host.
++ 'torque_generated_definitions',
++ 'v8_headers',
++ 'v8_libbase',
++ 'v8_libsampler',
++ 'v8_shared_internal_headers',
++ 'v8_version',
++ # BUILD.gn public_deps
++ 'generate_bytecode_builtins_list',
++ 'run_torque',
++ 'v8_maybe_icu',
++ ],
++ 'includes': ['inspector.gypi'],
++ 'direct_dependent_settings': {
++ 'include_dirs': [
++ '<(generate_bytecode_output_root)',
++ '<(torque_output_root)',
++ ],
++ },
++ 'sources': [
++ # "//base/trace_event/common/trace_event_common.h",
++
++ ### gcmole(all) ###
++ '<(generate_bytecode_builtins_list_output)',
++
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?sources = ")',
++
++ '<@(inspector_all_sources)',
++ ],
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ['v8_target_arch=="ia32"', {
++ 'sources': [ ### gcmole(arch:ia32) ###
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x86.*?sources \+= ")',
++ ],
++ }],
++ ['v8_target_arch=="x64"', {
++ 'sources': [ ### gcmole(arch:x64) ###
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64.*?sources \+= ")',
++ ],
++ 'conditions': [
++ # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both
++ # based on Darwin and thus POSIX-compliant to a similar degree.
++ ['OS=="linux" or OS=="mac" or OS=="ios"', {
++ 'sources': [
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?is_linux.*?sources \+= ")',
++ ],
++ }],
++ ['OS=="win"', {
+ 'sources': [
-+ '<(V8_ROOT)/src/base/platform/platform-macos.cc',
-+ ]
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?is_win.*?sources \+= ")',
++ ],
++ }],
++ ],
++ }],
++ ['v8_target_arch=="arm"', {
++ 'sources': [ ### gcmole(arch:arm) ###
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"arm.*?sources \+= ")',
++ ],
++ }],
++ ['v8_target_arch=="arm64"', {
++ 'sources': [ ### gcmole(arch:arm64) ###
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"arm64.*?sources \+= ")',
++ ],
++ }],
++ ['v8_target_arch=="mips" or v8_target_arch=="mipsel"', {
++ 'sources': [ ### gcmole(arch:mipsel) ###
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"mips.*?sources \+= ")',
++ ],
++ }],
++ ['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
++ 'sources': [ ### gcmole(arch:mips64el) ###
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"mips64.*?sources \+= ")',
++ ],
++ }],
++ ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
++ 'sources': [ ### gcmole(arch:ppc) ###
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"ppc.*?sources \+= ")',
++ ],
++ }],
++ ['v8_target_arch=="s390x"', {
++ 'sources': [ ### gcmole(arch:s390) ###
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"s390.*?sources \+= ")',
++ ],
++ }],
++ ['OS=="win"', {
++ 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
++ 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
++ 'sources': [
++ '<(_msvs_precompiled_header)',
++ '<(_msvs_precompiled_source)',
++ ],
++ # This will prevent V8's .cc files conflicting with the inspector's
++ # .cpp files in the same shard.
++ 'msvs_settings': {
++ 'VCCLCompilerTool': {
++ 'ObjectFile': '$(IntDir)%(Extension)\\',
++ },
++ },
++ }],
++ ['component=="shared_library"', {
++ 'defines': [
++ 'BUILDING_V8_SHARED',
++ ],
++ }],
++ ['v8_enable_i18n_support', {
++ 'dependencies': [
++ 'run_gen-regexp-special-case',
++ ],
++ 'sources': [
++ '<(SHARED_INTERMEDIATE_DIR)/src/regexp/special-case.cc',
++ ],
++ 'conditions': [
++ ['icu_use_data_file_flag', {
++ 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'],
+ }, {
++ 'conditions': [
++ ['OS=="win"', {
++ 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'],
++ }, {
++ 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'],
++ }],
++ ],
++ }],
++ ['OS=="win"', {
++ 'dependencies': [
++ '<(icu_gyp_path):icudata#target',
++ ],
++ }],
++ ],
++ }, { # v8_enable_i18n_support==0
++ 'sources!': [
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_i18n_support.*?sources -= ")',
++ ],
++ }],
++ ['v8_postmortem_support', {
++ '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 ["mips", "mipsel", "mips64", "mips64el", "ppc", "arm"]', {
++ 'link_settings': {
++ 'libraries': ['-latomic', ],
++ },
++ }],
++ ],
++ }, # v8_base_without_compiler
++ {
++ 'target_name': 'v8_base',
++ 'type': 'none',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ],
++ 'dependencies': [
++ 'v8_base_without_compiler',
++ 'v8_compiler',
++ ],
++ }, # v8_base
++ {
++ 'target_name': 'torque_base',
++ 'type': 'static_library',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ],
++ 'sources': [
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"torque_base.*?sources = ")',
++ ],
++ 'dependencies': [
++ 'v8_shared_internal_headers',
++ 'v8_libbase',
++ ],
++ 'defines!': [
++ '_HAS_EXCEPTIONS=0',
++ 'BUILDING_V8_SHARED=1',
++ ],
++ 'cflags_cc!': ['-fno-exceptions'],
++ 'cflags_cc': ['-fexceptions'],
++ 'xcode_settings': {
++ 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fexceptions
++ },
++ 'msvs_settings': {
++ 'VCCLCompilerTool': {
++ 'RuntimeTypeInfo': 'true',
++ 'ExceptionHandling': 1,
++ },
++ },
++ }, # torque_base
++ {
++ 'target_name': 'torque_ls_base',
++ 'type': 'static_library',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ],
++ 'sources': [
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"torque_ls_base.*?sources = ")',
++ ],
++ 'dependencies': [
++ 'torque_base',
++ ],
++ 'defines!': [
++ '_HAS_EXCEPTIONS=0',
++ 'BUILDING_V8_SHARED=1',
++ ],
++ 'cflags_cc!': ['-fno-exceptions'],
++ 'cflags_cc': ['-fexceptions'],
++ 'xcode_settings': {
++ 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fexceptions
++ },
++ 'msvs_settings': {
++ 'VCCLCompilerTool': {
++ 'RuntimeTypeInfo': 'true',
++ 'ExceptionHandling': 1,
++ },
++ },
++ }, # torque_ls_base
++ {
++ 'target_name': 'v8_libbase',
++ 'type': 'static_library',
++ 'sources': [
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_libbase.*?sources = ")',
++ ],
++
++ 'dependencies': [
++ 'v8_headers',
++ ],
++
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ['is_component_build', {
++ 'defines': ["BUILDING_V8_BASE_SHARED"],
++ }],
++ ['is_posix or is_fuchsia', {
++ 'sources': [
++ '<(V8_ROOT)/src/base/platform/platform-posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix.h',
++ ],
++ 'conditions': [
++ ['OS != "aix" and OS != "solaris"', {
+ 'sources': [
-+ '<(V8_ROOT)/src/base/platform/platform-linux.cc',
-+ ]
-+ }]
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.h',
++ ],
++ }],
++ ],
++ }],
++ ['OS=="linux"', {
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-linux.cc',
++ ],
++ 'link_settings': {
++ 'libraries': [
++ '-ldl',
++ '-lrt'
++ ],
++ },
++ }],
++ ['OS=="aix"', {
++ 'variables': {
++ # Used to differentiate `AIX` and `OS400`(IBM i).
++ 'aix_variant_name': '<!(uname -s)',
++ },
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-aix.cc',
++ ],
++ 'conditions': [
++ [ '"<(aix_variant_name)"=="AIX"', { # It is `AIX`
++ 'link_settings': {
++ 'libraries': [
++ '-ldl',
++ '-lrt'
++ ],
++ },
++ }],
++ ],
++ }],
++ ['is_android', {
++ 'sources': [
++ '<(V8_ROOT)/src/base/platform/platform-posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix.h',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.h',
+ ],
+ 'link_settings': {
+ 'target_conditions': [
-+ ['_toolset=="host" and host_os!="mac"', {
++ ['_toolset=="host" and host_os=="linux"', {
+ 'libraries': [
+ '-ldl',
-+ '-lpthread',
+ '-lrt'
++ ],
++ }],
++ ],
++ },
++ 'target_conditions': [
++ ['_toolset=="host"', {
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-linux.cc',
++ ],
++ }, {
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_android.cc',
++ '<(V8_ROOT)/src/base/platform/platform-linux.cc',
++ ],
++ }],
++ ],
++ }],
++ ['is_fuchsia', {
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_fuchsia.cc',
++ '<(V8_ROOT)/src/base/platform/platform-fuchsia.cc',
++ ]
++ }],
++ ['OS == "mac" or OS == "ios"', {
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-macos.cc',
++ ]
++ }],
++ ['is_win', {
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_win.cc',
++ '<(V8_ROOT)/src/base/platform/platform-win32.cc',
++ '<(V8_ROOT)/src/base/win32-headers.h',
++ ],
++
++ 'defines': ['_CRT_RAND_S'], # for rand_s()
++ 'direct_dependent_settings': {
++ 'msvs_settings': {
++ 'VCLinkerTool': {
++ 'AdditionalDependencies': [
++ 'dbghelp.lib',
++ 'winmm.lib',
++ 'ws2_32.lib'
+ ]
-+ }]
++ }
++ },
++ },
++ }],
++ ['target_arch == "mips" or OS == "mips64"', {
++ # here just for 'BUILD.gn' sync
++ # 'data': [
++ # '<(V8_ROOT)/tools/mips_toolchain/sysroot/usr/lib/',
++ # '<(V8_ROOT)/tools/mips_toolchain/sysroot/usr/lib/',
++ # ],
++ }],
++ # end of conditions from 'BUILD.gn'
++
++ # Node.js validated
++ ['OS=="solaris"', {
++ 'link_settings': {
++ 'libraries': [
++ '-lnsl',
++ '-lrt',
+ ]
+ },
-+ },
- ],
- ['OS=="win"', {
- 'defines': [
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-solaris.cc',
++ ],
++ }],
++
++ # YMMV with the following conditions
++ ['OS=="qnx"', {
++ 'link_settings': {
++ 'target_conditions': [
++ ['_toolset=="host" and host_os=="linux"', {
++ 'libraries': [
++ '-lrt'
++ ],
++ }],
++ ['_toolset=="target"', {
++ 'libraries': [
++ '-lbacktrace'
++ ],
++ }],
++ ],
++ },
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix.h',
++ '<(V8_ROOT)/src/base/platform/platform-posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.h',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
++ '<(V8_ROOT)/src/base/qnx-math.h'
++ ],
++ 'target_conditions': [
++ ['_toolset=="host" and host_os=="linux"', {
++ 'sources': [
++ '<(V8_ROOT)/src/base/platform/platform-linux.cc'
++ ],
++ }],
++ ['_toolset=="host" and host_os=="mac"', {
++ 'sources': [
++ '<(V8_ROOT)/src/base/platform/platform-macos.cc'
++ ],
++ }],
++ ['_toolset=="target"', {
++ 'sources': [
++ '<(V8_ROOT)/src/base/platform/platform-qnx.cc'
++ ],
++ }],
++ ],
++ },
++ ],
++ ['OS=="freebsd"', {
++ 'link_settings': {
++ 'libraries': [
++ '-L/usr/local/lib -lexecinfo',
++ ]
++ },
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-freebsd.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix.h',
++ '<(V8_ROOT)/src/base/platform/platform-posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.h',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
++ ],
++ }
++ ],
++ ['OS=="openbsd"', {
++ 'link_settings': {
++ 'libraries': [
++ '-L/usr/local/lib -lexecinfo',
++ ]
++ },
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-openbsd.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix.h',
++ '<(V8_ROOT)/src/base/platform/platform-posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.h',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
++ ],
++ }
++ ],
++ ['OS=="netbsd"', {
++ 'link_settings': {
++ 'libraries': [
++ '-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lexecinfo',
++ ]
++ },
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-openbsd.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix.h',
++ '<(V8_ROOT)/src/base/platform/platform-posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.h',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
++ ],
++ }
++ ],
++ ],
++ }, # v8_libbase
++ {
++ 'target_name': 'v8_libplatform',
++ 'type': 'static_library',
++ 'dependencies': [
++ 'v8_libbase',
++ ],
++ 'sources': [
++ '<(V8_ROOT)/base/trace_event/common/trace_event_common.h',
++ '<(V8_ROOT)/include/libplatform/libplatform-export.h',
++ '<(V8_ROOT)/include/libplatform/libplatform.h',
++ '<(V8_ROOT)/include/libplatform/v8-tracing.h',
++ '<(V8_ROOT)/src/libplatform/default-foreground-task-runner.cc',
++ '<(V8_ROOT)/src/libplatform/default-foreground-task-runner.h',
++ '<(V8_ROOT)/src/libplatform/default-platform.cc',
++ '<(V8_ROOT)/src/libplatform/default-platform.h',
++ '<(V8_ROOT)/src/libplatform/default-worker-threads-task-runner.cc',
++ '<(V8_ROOT)/src/libplatform/default-worker-threads-task-runner.h',
++ '<(V8_ROOT)/src/libplatform/delayed-task-queue.cc',
++ '<(V8_ROOT)/src/libplatform/delayed-task-queue.h',
++ '<(V8_ROOT)/src/libplatform/task-queue.cc',
++ '<(V8_ROOT)/src/libplatform/task-queue.h',
++ '<(V8_ROOT)/src/libplatform/tracing/trace-buffer.cc',
++ '<(V8_ROOT)/src/libplatform/tracing/trace-buffer.h',
++ '<(V8_ROOT)/src/libplatform/tracing/trace-config.cc',
++ '<(V8_ROOT)/src/libplatform/tracing/trace-object.cc',
++ '<(V8_ROOT)/src/libplatform/tracing/trace-writer.cc',
++ '<(V8_ROOT)/src/libplatform/tracing/trace-writer.h',
++ '<(V8_ROOT)/src/libplatform/tracing/tracing-controller.cc',
++ '<(V8_ROOT)/src/libplatform/worker-thread.cc',
++ '<(V8_ROOT)/src/libplatform/worker-thread.h',
++ ],
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ['component=="shared_library"', {
++ 'direct_dependent_settings': {
++ 'defines': ['USING_V8_PLATFORM_SHARED'],
++ },
++ 'defines': ['BUILDING_V8_PLATFORM_SHARED'],
++ }],
++ ['v8_use_perfetto', {
++ 'sources': [
++ '<(V8_ROOT)/src/libplatform/tracing/json-trace-event-listener.cc',
++ '<(V8_ROOT)/src/libplatform/tracing/json-trace-event-listener.h',
++ '<(V8_ROOT)/src/libplatform/tracing/trace-event-listener.cc',
++ '<(V8_ROOT)/src/libplatform/tracing/trace-event-listener.h',
++ ],
++ 'dependencies': [
++ '<(V8_ROOT)/third_party/perfetto:libperfetto',
++ '<(V8_ROOT)/third_party/perfetto/protos/perfetto/trace:lite',
++ ],
++ }],
++ ],
++ 'direct_dependent_settings': {
++ 'include_dirs': [
++ '<(V8_ROOT)/include',
++ ],
++ },
++ }, # v8_libplatform
++ {
++ 'target_name': 'v8_libsampler',
++ 'type': 'static_library',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ],
++ 'dependencies': [
++ 'v8_libbase',
++ ],
++ 'sources': [
++ '<(V8_ROOT)/src/libsampler/sampler.cc',
++ '<(V8_ROOT)/src/libsampler/sampler.h'
++ ],
++ }, # v8_libsampler
++
++ # {
++ # 'target_name': 'fuzzer_support',
++ # 'type': 'static_library',
++ # 'conditions': [
++ # ['want_separate_host_toolset', {
++ # 'toolsets': ['host', 'target'],
++ # }],
++ # ],
++ # 'dependencies': [
++ # 'v8',
++ # 'v8_libbase',
++ # 'v8_libplatform',
++ # 'v8_maybe_icu',
++ # ],
++ # 'sources': [
++ # "<(V8_ROOT)/test/fuzzer/fuzzer-support.cc",
++ # "<(V8_ROOT)/test/fuzzer/fuzzer-support.h",
++ # ],
++ # }, # fuzzer_support
++
++ # {
++ # 'target_name': 'wee8',
++ # 'type': 'static_library',
++ # 'dependencies': [
++ # 'v8_base',
++ # 'v8_libbase',
++ # 'v8_libplatform',
++ # 'v8_libsampler',
++ # 'v8_maybe_snapshot',
++ # # 'build/win:default_exe_manifest',
++ # ],
++ # 'sources': [
++ # "<(V8_ROOT)/src/wasm/c-api.cc",
++ # "<(V8_ROOT)/third_party/wasm-api/wasm.h",
++ # "<(V8_ROOT)/third_party/wasm-api/wasm.hh",
++ # ],
++ # }, # wee8
++
++ # ###############################################################################
++ # # Executablesicu_path
++ # #
++
++ {
++ 'target_name': 'bytecode_builtins_list_generator',
++ 'type': 'executable',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host'],
++ }],
++ ],
++ 'defines!': [
++ 'BUILDING_V8_SHARED=1',
++ ],
++ 'dependencies': [
++ "v8_libbase",
++ # "build/win:default_exe_manifest",
++ ],
++ 'sources': [
++ "<(V8_ROOT)/src/builtins/generate-bytecodes-builtins-list.cc",
++ "<(V8_ROOT)/src/interpreter/bytecode-operands.cc",
++ "<(V8_ROOT)/src/interpreter/bytecode-operands.h",
++ "<(V8_ROOT)/src/interpreter/bytecodes.cc",
++ "<(V8_ROOT)/src/interpreter/bytecodes.h",
++ ],
++ }, # bytecode_builtins_list_generator
++ {
++ 'target_name': 'mksnapshot',
++ 'type': 'executable',
++ 'dependencies': [
++ 'v8_base_without_compiler',
++ 'v8_compiler_for_mksnapshot',
++ 'v8_init',
++ 'v8_libbase',
++ 'v8_libplatform',
++ 'v8_nosnapshot',
++ # "build/win:default_exe_manifest",
++ 'v8_maybe_icu',
++ ],
++ 'sources': [
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"mksnapshot.*?sources = ")',
++ ],
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host'],
++ }],
++ ],
++ }, # mksnapshot
++ {
++ 'target_name': 'torque',
++ 'type': 'executable',
++ 'dependencies': [
++ 'torque_base',
++ # "build/win:default_exe_manifest",
++ ],
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host'],
++ }],
++ ],
++ 'defines!': [
++ '_HAS_EXCEPTIONS=0',
++ 'BUILDING_V8_SHARED=1',
++ ],
++ 'cflags_cc!': ['-fno-exceptions'],
++ 'cflags_cc': ['-fexceptions'],
++ 'xcode_settings': {
++ 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fexceptions
++ },
++ 'msvs_settings': {
++ 'VCCLCompilerTool': {
++ 'RuntimeTypeInfo': 'true',
++ 'ExceptionHandling': 1,
++ },
++ 'VCLinkerTool': {
++ 'AdditionalDependencies': [
++ 'dbghelp.lib',
++ 'winmm.lib',
++ 'ws2_32.lib'
++ ]
++ }
++ },
++ 'sources': [
++ "<(V8_ROOT)/src/torque/torque.cc",
++ ],
++ }, # torque
++ {
++ 'target_name': 'torque-language-server',
++ 'type': 'executable',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host'],
++ }],
++ ],
++ 'dependencies': [
++ 'torque_base',
++ 'torque_ls_base',
++ # "build/win:default_exe_manifest",
++ ],
++ 'defines!': [
++ '_HAS_EXCEPTIONS=0',
++ 'BUILDING_V8_SHARED=1',
++ ],
++ 'msvs_settings': {
++ 'VCCLCompilerTool': {
++ 'RuntimeTypeInfo': 'true',
++ 'ExceptionHandling': 1,
++ },
++ },
++ 'sources': [
++ "<(V8_ROOT)/src/torque/ls/torque-language-server.cc",
++ ],
++ }, # torque-language-server
++ {
++ 'target_name': 'gen-regexp-special-case',
++ 'type': 'executable',
++ 'dependencies': [
++ 'v8_libbase',
++ # "build/win:default_exe_manifest",
++ 'v8_maybe_icu',
++ ],
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host'],
++ }],
++ ],
++ 'sources': [
++ "<(V8_ROOT)/src/regexp/gen-regexp-special-case.cc",
++ ],
++ }, # gen-regexp-special-case
++ {
++ 'target_name': 'run_gen-regexp-special-case',
++ 'type': 'none',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'dependencies': ['gen-regexp-special-case#host'],
++ 'toolsets': ['host', 'target'],
++ }, {
++ 'dependencies': ['gen-regexp-special-case'],
++ }],
++ ],
++ 'actions': [
++ {
++ 'action_name': 'run_gen-regexp-special-case_action',
++ 'inputs': [
++ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
++ ],
++ 'outputs': [
++ '<(SHARED_INTERMEDIATE_DIR)/src/regexp/special-case.cc',
++ ],
++ 'action': [
++ 'python',
++ '<(V8_ROOT)/tools/run.py',
++ '<@(_inputs)',
++ '<@(_outputs)',
++ ],
++ },
++ ],
++ }, # run_gen-regexp-special-case
++
++ ###############################################################################
++ # Public targets
++ #
++
++ {
++ 'target_name': 'v8',
++ 'hard_dependency': 1,
++ 'toolsets': ['target'],
++ 'dependencies': [
++ 'v8_maybe_snapshot'
++ ],
++ 'conditions': [
++ ['component=="shared_library"', {
++ 'type': '<(component)',
++ 'sources': [
++ # Note: on non-Windows we still build this file so that gyp
++ # has some sources to link into the component.
++ '<(V8_ROOT)/src/utils/v8dll-main.cc',
++ ],
++ 'defines': [
++ 'BUILDING_V8_SHARED',
++ ],
++ 'direct_dependent_settings': {
++ 'defines': [
++ 'USING_V8_SHARED',
++ ],
++ },
++ 'conditions': [
++ ['OS=="mac"', {
++ 'xcode_settings': {
++ 'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']
++ },
++ }],
++ ['soname_version!=""', {
++ 'product_extension': 'so.<(soname_version)',
++ }],
++ ],
++ },
++ {
++ 'type': 'static_library',
++ }],
++ ],
++ 'direct_dependent_settings': {
++ 'include_dirs': [
++ '<(V8_ROOT)/include',
++ ],
++ },
++ 'actions': [
++ {
++ 'action_name': 'v8_dump_build_config',
++ 'inputs': [
++ '<(V8_ROOT)/tools/testrunner/utils/dump_build_config_gyp.py',
++ ],
++ 'outputs': [
++ '<(PRODUCT_DIR)/v8_build_config.json',
++ ],
++ 'variables': {
++ 'v8_dump_build_config_args': [
++ '<(PRODUCT_DIR)/v8_build_config.json',
++ 'dcheck_always_on=<(dcheck_always_on)',
++ 'is_android=<(is_android)',
++ 'is_asan=<(asan)',
++ 'is_cfi=<(cfi_vptr)',
++ 'is_clang=<(clang)',
++ 'is_component_build=<(component)',
++ 'is_debug=<(CONFIGURATION_NAME)',
++ # Not available in gyp.
++ 'is_gcov_coverage=0',
++ 'is_msan=<(msan)',
++ 'is_tsan=<(tsan)',
++ # Not available in gyp.
++ 'is_ubsan_vptr=0',
++ 'target_cpu=<(target_arch)',
++ 'v8_enable_i18n_support=<(v8_enable_i18n_support)',
++ 'v8_enable_verify_predictable=<(v8_enable_verify_predictable)',
++ 'v8_target_cpu=<(v8_target_arch)',
++ 'v8_use_snapshot=<(v8_use_snapshot)',
++ 'v8_use_siphash=<(v8_use_siphash)',
++ 'v8_enable_embedded_builtins=<(v8_enable_embedded_builtins)',
++ 'v8_enable_verify_csa=<(v8_enable_verify_csa)',
++ 'v8_enable_lite_mode=<(v8_enable_lite_mode)',
++ 'v8_enable_pointer_compression=<(v8_enable_pointer_compression)',
++ ]
++ },
++ 'conditions': [
++ ['v8_target_arch=="mips" or v8_target_arch=="mipsel" \
++ or v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
++ 'v8_dump_build_config_args': [
++ 'mips_arch_variant=<(mips_arch_variant)',
++ 'mips_use_msa=<(mips_use_msa)',
++ ],
++ }],
++ ],
++ 'action': [
++ 'python', '<(V8_ROOT)/tools/testrunner/utils/dump_build_config_gyp.py',
++ '<@(v8_dump_build_config_args)',
++ ],
++ },
++ ],
++ }, # v8
++ # missing a bunch of fuzzer targets
++
++ ###############################################################################
++ # Protobuf targets, used only when building outside of chromium.
++ #
++
++ {
++ 'target_name': 'postmortem-metadata',
++ 'type': 'none',
++ 'conditions': [
++ ['want_separate_host_toolset', {
++ 'toolsets': ['host', 'target'],
++ }],
++ ],
++ 'variables': {
++ 'heapobject_files': [
++ '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"postmortem-metadata.*?sources = ")',
++ ],
++ },
++ 'actions': [
++ {
++ 'action_name': 'gen-postmortem-metadata',
++ 'inputs': [
++ '<(V8_ROOT)/tools/gen-postmortem-metadata.py',
++ '<@(heapobject_files)',
++ ],
++ 'outputs': [
++ '<(SHARED_INTERMEDIATE_DIR)/debug-support.cc',
++ ],
++ 'action': [
++ 'python',
++ '<(V8_ROOT)/tools/gen-postmortem-metadata.py',
++ '<@(_outputs)',
++ '<@(heapobject_files)'
++ ],
++ },
++ ],
++ 'direct_dependent_settings': {
++ 'sources': ['<(SHARED_INTERMEDIATE_DIR)/debug-support.cc', ],
++ },
++ }, # postmortem-metadata
++ ],
++}
+diff -Naur node-v12.17.0/tools/v8_gypfiles/v8.gyp.rej node-v12.17.0+iPhone/tools/v8_gypfiles/v8.gyp.rej
+--- node-v12.17.0/tools/v8_gypfiles/v8.gyp.rej 1969-12-31 16:00:00.000000000 -0800
++++ node-v12.17.0+iPhone/tools/v8_gypfiles/v8.gyp.rej 2020-05-27 20:28:31.000000000 -0700
+@@ -0,0 +1,52 @@
++--- tools/v8_gypfiles/v8.gyp 2019-05-22 12:21:55.000000000 +0000
+++++ tools/v8_gypfiles/v8.gyp 2019-05-24 19:45:01.650941667 +0000
++@@ -2227,7 +2233,7 @@
++ }],
++ ],
++ 'conditions': [
++- ['OS=="linux"', {
+++ ['OS=="linux" or (host_os=="linux" and _toolset=="host")', {
++ 'link_settings': {
++ 'libraries': [
++ '-ldl',
++@@ -2302,15 +2308,37 @@
++ '<(V8_ROOT)/src/base/platform/platform-fuchsia.cc',
++ ]},
++ ],
++- ['OS=="mac"', {
+++ ['OS=="mac" or OS=="ios"', {
++ 'sources': [
++ '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
++- '<(V8_ROOT)/src/base/platform/platform-macos.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix.h',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
++ '<(V8_ROOT)/src/base/platform/platform-posix-time.h',
++- ]},
+++ ],
+++ 'conditions': [
+++ ['(host_os=="mac" and _toolset=="host") or _toolset=="target"', {
+++ 'sources': [
+++ '<(V8_ROOT)/src/base/platform/platform-macos.cc',
+++ ]
+++ }, {
+++ 'sources': [
+++ '<(V8_ROOT)/src/base/platform/platform-linux.cc',
+++ ]
+++ }]
+++ ],
+++ 'link_settings': {
+++ 'target_conditions': [
+++ ['_toolset=="host" and host_os!="mac"', {
+++ 'libraries': [
+++ '-ldl',
+++ '-lpthread',
+++ '-lrt'
+++ ]
+++ }]
+++ ]
+++ },
+++ },
++ ],
++ ['OS=="win"', {
++ 'defines': [
diff --git a/data/nodejs/xcode_emulation.diff b/data/nodejs/xcode_emulation.diff
index 527523dc2..79f976c12 100644
--- a/data/nodejs/xcode_emulation.diff
+++ b/data/nodejs/xcode_emulation.diff
@@ -1,7 +1,7 @@
-diff -ur node-chakracore-node-v10.13.0/tools/gyp/pylib/gyp/xcode_emulation.py node-chakracore-node-v10.13.0+iPhone/tools/gyp/pylib/gyp/xcode_emulation.py
---- node-chakracore-node-v10.13.0/tools/gyp/pylib/gyp/xcode_emulation.py 2018-11-17 00:31:08.000000000 +0000
-+++ node-chakracore-node-v10.13.0+iPhone/tools/gyp/pylib/gyp/xcode_emulation.py 2019-05-16 21:41:49.953754405 +0000
-@@ -500,9 +500,10 @@
+diff -Naur node-v12.17.0/tools/gyp/pylib/gyp/xcode_emulation.py node-v12.17.0+iPhone/tools/gyp/pylib/gyp/xcode_emulation.py
+--- node-v12.17.0/tools/gyp/pylib/gyp/xcode_emulation.py 2020-05-26 04:53:35.000000000 -0700
++++ node-v12.17.0+iPhone/tools/gyp/pylib/gyp/xcode_emulation.py 2020-05-27 20:15:11.000000000 -0700
+@@ -504,9 +504,10 @@
pass
def _SdkRoot(self, configname):
@@ -15,7 +15,7 @@ diff -ur node-chakracore-node-v10.13.0/tools/gyp/pylib/gyp/xcode_emulation.py no
def _XcodePlatformPath(self, configname=None):
sdk_root = self._SdkRoot(configname)
-@@ -527,16 +528,17 @@
+@@ -531,16 +532,17 @@
return XcodeSettings._sdk_path_cache[sdk_root]
def _AppendPlatformVersionMinFlags(self, lst):
@@ -43,7 +43,7 @@ diff -ur node-chakracore-node-v10.13.0/tools/gyp/pylib/gyp/xcode_emulation.py no
def GetCflags(self, configname, arch=None):
"""Returns flags that need to be added to .c, .cc, .m, and .mm
-@@ -548,8 +550,8 @@
+@@ -552,8 +554,8 @@
cflags = []
sdk_root = self._SdkPath()
@@ -54,7 +54,7 @@ diff -ur node-chakracore-node-v10.13.0/tools/gyp/pylib/gyp/xcode_emulation.py no
if self.header_map_path:
cflags.append('-I%s' % self.header_map_path)
-@@ -873,8 +875,8 @@
+@@ -877,8 +879,8 @@
self._AppendPlatformVersionMinFlags(ldflags)
@@ -65,13 +65,12 @@ diff -ur node-chakracore-node-v10.13.0/tools/gyp/pylib/gyp/xcode_emulation.py no
for library_path in self._Settings().get('LIBRARY_SEARCH_PATHS', []):
ldflags.append('-L' + gyp_to_build_path(library_path))
-@@ -1407,7 +1409,8 @@
- if version:
- version = re.match(r'(\d+\.\d+\.?\d*)', version).groups()[0]
- else:
+@@ -1414,7 +1416,7 @@
+ except GypError: # Xcode not installed so look for XCode Command Line Tools
+ version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322
+ if not version:
- raise GypError("No Xcode or CLT version detected!")
+ version = '10.6'
-+# raise GypError("No Xcode or CLT version detected!")
- # The CLT has no build information, so we return an empty string.
- version_list = [version, '']
- version = version_list[0]
+ # Be careful to convert "4.2.3" to "0423" and "11.0.0" to "1100":
+ version = version.split(".")[:3] # Just major, minor, micro
+ version[0] = version[0].zfill(2) # Add a leading zero if major is one digit