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)', }], - ['OS=="mac"', { + ['OS=="mac" or OS=="ios"', { 'clang%': 1, }], ['target_arch in "ppc64 s390x"', { @@ -200,7 +200,7 @@ # pull in V8's postmortem metadata 'ldflags': [ '-Wl,-z,allextract' ] }], - ['OS!="mac" and OS!="win"', { + ['OS!="mac" and OS!="ios" and OS!="win"', { 'cflags': [ '-fno-omit-frame-pointer' ], }], ['OS=="linux"', { @@ -314,7 +314,7 @@ [ 'target_arch=="arm64"', { 'msvs_configuration_platform': 'arm64', }], - ['asan == 1 and OS != "mac"', { + ['asan == 1 and (OS != "mac" or OS != "ios")', { 'cflags+': [ '-fno-omit-frame-pointer', '-fsanitize=address', @@ -324,7 +324,7 @@ 'cflags!': [ '-fomit-frame-pointer' ], 'ldflags': [ '-fsanitize=address' ], }], - ['asan == 1 and OS == "mac"', { + ['asan == 1 and (OS == "mac" or OS == "ios")', { 'xcode_settings': { 'OTHER_CFLAGS+': [ '-fno-omit-frame-pointer', @@ -457,6 +457,21 @@ }], ], }], + ['OS=="ios"', { + 'defines': [ + '__IPHONEOS__', + 'TARGET_OS_IPHONE', + 'V8_TARGET_OS_IPHONE', + '_DARWIN_USE_64_BIT_INODE', + '__AARCH64EL__', + '_M_ARM64', + ], + 'cflags': [ + '-fno-exceptions', + '-fno-rtti', + '-fno-strict-aliasing' + ], + }], ['OS=="mac"', { 'defines': ['_DARWIN_USE_64_BIT_INODE=1'], 'xcode_settings': { @@ -468,7 +483,6 @@ 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings 'PREBINDING': 'NO', # No -Wl,-prebind - 'MACOSX_DEPLOYMENT_TARGET': '10.10', # -mmacosx-version-min=10.10 'USE_HEADERMAP': 'NO', 'OTHER_CFLAGS': [ '-fno-strict-aliasing', @@ -497,6 +511,9 @@ ['target_arch=="x64"', { 'xcode_settings': {'ARCHS': ['x86_64']}, }], + [ 'target_arch=="arm64"', { + 'xcode_settings': {'ARCHS': ['arm64']}, + }], ['clang==1', { 'xcode_settings': { 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', 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', +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' + if options.dest_os == 'ios': + o['variables']['OS'] = 'ios' o['variables']['node_prefix'] = options.prefix o['variables']['node_install_npm'] = b(not options.without_npm) o['variables']['debug_node'] = b(options.debug_node) @@ -1157,7 +1159,7 @@ 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' ] }], - ['OS=="mac"', { + ['OS=="mac" or OS=="ios"', { 'defines': [ 'OS_MACOSX' ] 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' ] }], - [ 'OS=="mac"', { + [ 'OS=="mac" or OS=="ios"', { 'include_dirs': [ 'config/darwin' ], 'sources': [ 'config/darwin/ares_config.h' ] }], 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': [ - [ 'OS=="mac"', { + [ 'OS=="mac" or OS=="ios"', { 'defines': [ '_DARWIN_USE_64_BIT_INODE=1' ], 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', ], }], - [ 'os_posix == 1 and OS != "mac" and OS != "android"', { + [ 'os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', { 'cflags': [ '-msse2', ], }], - [ 'OS == "mac"', { + [ 'OS == "mac" or OS == "ios"', { 'configurations': { 'Debug': { 'xcode_settings': { @@ -572,7 +572,7 @@ ], }, }], - [ 'OS=="mac"', { + [ 'OS=="mac" or OS=="ios"', { 'variables': { 'yasm_flags': [ '-DPREFIX', @@ -582,7 +582,7 @@ ], }, }], - [ 'os_posix==1 and OS!="mac"', { + [ 'os_posix==1 and OS!="mac" and OS!="ios"', { 'variables': { 'conditions': [ [ 'target_arch=="ia32"', { @@ -710,7 +710,7 @@ 'webm/webm_parser_unittest.cc', ], 'conditions': [ - ['os_posix==1 and OS!="mac"', { + ['os_posix==1 and OS!="mac" and OS!="ios"', { 'conditions': [ ['linux_use_tcmalloc==1', { 'dependencies': [ @@ -930,7 +930,7 @@ }, ], }], - ['os_posix == 1 and OS != "mac" and OS != "android"', { + ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', { 'targets': [ { 'target_name': 'player_x11', @@ -1064,7 +1064,7 @@ 'filters/pipeline_integration_test_base.cc', ], 'conditions': [ - ['os_posix==1 and OS!="mac"', { + ['os_posix==1 and OS!="mac" and OS!="ios"', { 'conditions': [ ['linux_use_tcmalloc==1', { 'dependencies': [ 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 @@ }], ], }], + ['OS=="ios"', { + 'cflags': [ + '-fno-exceptions', + '-fno-rtti', + '-fno-threadsafe-statics' + ], + }], ['OS=="mac"', { 'xcode_settings': { 'ALWAYS_SEARCH_USER_PATHS': 'NO', 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 @@ }], ], }], - ['uv_library=="shared_library" and OS!="mac" and OS!="zos"', { + ['uv_library=="shared_library" and OS!="mac" and OS!="ios" and OS!="zos"', { # This will cause gyp to set soname # Must correspond with UV_VERSION_MAJOR # in include/uv/version.h 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' ], }], - [ 'OS!="mac" and OS!="linux"', { + [ 'OS!="mac" and OS!="ios" and OS!="linux"', { 'sources': [ 'src/node_dtrace_ustack.cc', 'src/node_dtrace_provider.cc', @@ -993,7 +993,7 @@ 'target_name': 'node_dtrace_provider', 'type': 'none', 'conditions': [ - [ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', { + [ 'node_use_dtrace=="true" and OS!="mac" and OS!="ios" and OS!="linux"', { 'actions': [ { 'action_name': 'node_dtrace_provider_o', @@ -1028,7 +1028,7 @@ 'target_name': 'node_dtrace_ustack', 'type': 'none', 'conditions': [ - [ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', { + [ 'node_use_dtrace=="true" and OS!="mac" and OS!="ios" and OS!="linux"', { 'actions': [ { 'action_name': 'node_dtrace_ustack_constants', 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', - '<(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)', ], }], ], @@ -174,9 +172,7 @@ 'conditions': [ ['OS!="aix" and node_shared=="false"', { 'ldflags': [ - '-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)', ], }], ], @@ -192,7 +188,7 @@ 'dependencies': [ 'deps/brotli/brotli.gyp:brotli' ], }], - [ 'OS=="mac"', { + [ 'OS=="mac" or OS=="ios"', { # linking Corefoundation is needed since certain OSX debugging tools # like Instruments require it for some features 'libraries': [ '-framework CoreFoundation' ], 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', ], }], - ['(OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="netbsd" \ + ['(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': [ '<(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'] }, }], + ['OS=="ios"', { + 'ldflags': [ + '-dynamiclib', + '-all_load' + ], + }], ['soname_version!=""', { 'product_extension': 'so.<(soname_version)', }],