From 8f4270163ac8cf716c892216b4164f89b1cbca57 Mon Sep 17 00:00:00 2001 From: MCApollo <34170230+MCApollo@users.noreply.github.com> Date: Wed, 22 May 2019 16:09:11 +0000 Subject: WIP 2 --- data/node/README | 1 - data/node/configure-ios.diff | 138 --------------------------- data/node/make.sh | 12 ++- data/node/v8.diff | 221 +++++++++++++++++++++++++++---------------- 4 files changed, 148 insertions(+), 224 deletions(-) delete mode 100644 data/node/README diff --git a/data/node/README b/data/node/README deleted file mode 100644 index 944cea319..000000000 --- a/data/node/README +++ /dev/null @@ -1 +0,0 @@ -V8 released jit-less support, might as well try it diff --git a/data/node/configure-ios.diff b/data/node/configure-ios.diff index 6931ec2b0..29c134a73 100644 --- a/data/node/configure-ios.diff +++ b/data/node/configure-ios.diff @@ -269,141 +269,3 @@ diff -ur node-v12.2.0/node.gypi node-v12.2.0+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.2.0/tools/v8_gypfiles/broken/standalone.gypi node-v12.2.0+iPhone/tools/v8_gypfiles/broken/standalone.gypi ---- node-v12.2.0/tools/v8_gypfiles/broken/standalone.gypi 2019-05-07 14:52:17.000000000 +0000 -+++ node-v12.2.0+iPhone/tools/v8_gypfiles/broken/standalone.gypi 2019-05-21 16:48:38.214928931 +0000 -@@ -53,7 +53,7 @@ - 'variables': { - 'conditions': [ - ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or \ -- OS=="netbsd" or OS=="mac" or OS=="qnx" or OS=="aix"', { -+ OS=="netbsd" or OS=="mac" or OS=="ios" or OS=="qnx" or OS=="aix"', { - # This handles the Unix platforms we generally deal with. - # Anything else gets passed through, which probably won't work - # very well; such hosts should pass an explicit target_arch -@@ -519,7 +519,7 @@ - 'DEBUG', - ], - 'conditions': [ -- ['os_posix == 1 and OS != "mac"', { -+ ['os_posix == 1 and OS != "mac" and OS != "ios"', { - # We don't want to get warnings from third-party code, - # so remove any existing warning-enabling flags like -Wall. - 'cflags!': [ -@@ -550,7 +550,7 @@ - '-Wnon-virtual-dtor', - ], - }], -- ['OS == "mac"', { -+ ['OS == "mac" or OS == "ios"', { - 'xcode_settings': { - 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror - }, -@@ -567,7 +567,7 @@ - ], - }, - 'conditions': [ -- ['os_posix==1 and OS!="mac"', { -+ ['os_posix==1 and OS!="mac" and OS!="ios"', { - 'target_defaults': { - 'conditions': [ - # Common options for AddressSanitizer, LeakSanitizer, -diff -ur node-v12.2.0/tools/v8_gypfiles/d8.gyp node-v12.2.0+iPhone/tools/v8_gypfiles/d8.gyp ---- node-v12.2.0/tools/v8_gypfiles/d8.gyp 2019-05-07 14:52:17.000000000 +0000 -+++ node-v12.2.0+iPhone/tools/v8_gypfiles/d8.gyp 2019-05-21 16:50:27.615066264 +0000 -@@ -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': [ '../src/d8-posix.cc', ] -diff -ur node-v12.2.0/tools/v8_gypfiles/toolchain.gypi node-v12.2.0+iPhone/tools/v8_gypfiles/toolchain.gypi ---- node-v12.2.0/tools/v8_gypfiles/toolchain.gypi 2019-05-07 14:52:17.000000000 +0000 -+++ node-v12.2.0+iPhone/tools/v8_gypfiles/toolchain.gypi 2019-05-21 16:50:01.383034824 +0000 -@@ -371,7 +371,7 @@ - [ 'clang==1', { - 'cflags': ['-integrated-as'], - }], -- ['OS!="mac"', { -+ ['OS!="mac" and OS!="ios"', { - 'defines': ['_MIPS_TARGET_HW',], - }, { - 'defines': ['_MIPS_TARGET_SIMULATOR',], -@@ -384,7 +384,7 @@ - }], #'_toolset=="target" - ['_toolset=="host"', { - 'conditions': [ -- ['v8_target_arch==target_arch and OS!="mac"', { -+ ['v8_target_arch==target_arch and OS!="mac" and OS!="ios"', { - 'defines': ['_MIPS_TARGET_HW',], - }, { - 'defines': ['_MIPS_TARGET_SIMULATOR',], -@@ -1025,7 +1025,7 @@ - }, - }], - ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ -- or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \ -+ or OS=="netbsd" or OS=="mac" or OS=="ios" or OS=="android" or OS=="qnx") and \ - v8_target_arch=="ia32"', { - 'cflags': [ - '-msse2', -@@ -1034,7 +1034,7 @@ - ], - }], - ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ -- or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \ -+ 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")', { -@@ -1235,7 +1235,7 @@ - '-ffunction-sections', - ], - }], -- ['OS=="mac"', { -+ ['OS=="mac" or OS=="ios"', { - 'xcode_settings': { - 'GCC_OPTIMIZATION_LEVEL': '0', # -O0 - }, -@@ -1296,7 +1296,7 @@ - }], - ], - }], -- ['OS=="mac"', { -+ ['OS=="mac" or OS=="ios"', { - 'xcode_settings': { - 'GCC_OPTIMIZATION_LEVEL': '3', # -O3 - 'GCC_STRICT_ALIASING': 'YES', -diff -ur node-v12.2.0/tools/v8_gypfiles/v8.gyp node-v12.2.0+iPhone/tools/v8_gypfiles/v8.gyp ---- node-v12.2.0/tools/v8_gypfiles/v8.gyp 2019-05-07 14:52:17.000000000 +0000 -+++ node-v12.2.0+iPhone/tools/v8_gypfiles/v8.gyp 2019-05-21 16:46:00.898697935 +0000 -@@ -123,7 +123,7 @@ - ], - }, - 'conditions': [ -- ['OS=="mac"', { -+ ['OS=="mac" or OS=="ios"', { - 'xcode_settings': { - 'OTHER_LDFLAGS': ['-dynamiclib', '-all_load'] - }, -@@ -1824,7 +1824,7 @@ - '<(V8_ROOT)/src/x64/sse-instr.h', - ], - }], -- ['v8_target_arch=="x64" and (OS=="linux" or OS=="mac")', { -+ ['v8_target_arch=="x64" and (OS=="linux" or OS=="mac" or OS=="ios")', { - 'sources': [ - '<(V8_ROOT)/src/trap-handler/handler-inside-posix.cc', - '<(V8_ROOT)/src/trap-handler/handler-inside-posix.h', -@@ -2296,7 +2296,7 @@ - '<(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', diff --git a/data/node/make.sh b/data/node/make.sh index 6f189509d..c2d288b3f 100644 --- a/data/node/make.sh +++ b/data/node/make.sh @@ -1,6 +1,7 @@ pkg:setup export CC="${PKG_TARG}-gcc" +export CXX="${PKG_TARG}-g++" export LD="${PKG_TARG}-ld" export AR="${PKG_TARG}-ar" export AS="${PKG_TARG}-as" @@ -10,10 +11,15 @@ export SDKROOT="${PKG_ROOT}" export CC_host="gcc" export CXX_host="g++" -export LINK_host="gcc" +export LINK_host="g++" export AR_host="ar" -export GYP_DEFINES="target_arch=arm64 v8_target_arch=amr64 host_os=mac OS=ios" +export CC_target="${CC}" +export CXX_target="${CXX}" +export LINK_target="${CXX}" # On purpose, see out/Makefile +export AR_target="${AR}" + +export GYP_DEFINES="target_arch=arm64 v8_target_arch=arm64 host_os=linux target_os=ios OS=ios" ./configure --without-snapshot --dest-os=ios --dest-cpu=arm64 --with-intl=none --shared-zlib --openssl-no-asm -make +make -j2 diff --git a/data/node/v8.diff b/data/node/v8.diff index 28a9382f8..9b801e55a 100644 --- a/data/node/v8.diff +++ b/data/node/v8.diff @@ -1,83 +1,140 @@ -diff -ur node-v12.2.0/deps/v8/BUILD.gn node-v12.2.0+iPhone/deps/v8/BUILD.gn ---- node-v12.2.0/deps/v8/BUILD.gn 2019-05-07 14:52:14.000000000 +0000 -+++ node-v12.2.0+iPhone/deps/v8/BUILD.gn 2019-05-21 18:40:00.282148080 +0000 -@@ -3330,7 +3330,7 @@ - "dl", - "rt", - ] -- if (host_os == "mac") { -+ if (host_os == "mac" or host_os == "ios") { - sources += [ - "src/base/debug/stack_trace_posix.cc", - "src/base/platform/platform-macos.cc", -diff -ur node-v12.2.0/deps/v8/DEPS node-v12.2.0+iPhone/deps/v8/DEPS ---- node-v12.2.0/deps/v8/DEPS 2019-05-07 14:52:14.000000000 +0000 -+++ node-v12.2.0+iPhone/deps/v8/DEPS 2019-05-21 18:36:28.270234167 +0000 -@@ -88,7 +88,7 @@ - 'version': '2d3358ae9a569b2d4a474f498b32b202a152134f' +diff -ur node-v12.2.0/tools/v8_gypfiles/toolchain.gypi node-v12.2.0+iPhone/tools/v8_gypfiles/toolchain.gypi +--- node-v12.2.0/tools/v8_gypfiles/toolchain.gypi 2019-05-07 14:52:17.000000000 +0000 ++++ node-v12.2.0+iPhone/tools/v8_gypfiles/toolchain.gypi 2019-05-22 14:09:36.491652492 +0000 +@@ -84,7 +84,9 @@ + # The setting is ignored if want_separate_host_toolset is 0. + 'v8_toolset_for_shell%': 'target', + +- 'host_os%': '<(OS)', ++ # 'host_os%': '<(OS)', ++ 'host_os%': " win cross-compile, which is only supported w/ clang. - v8_snapshot_toolchain = "//build/toolchain/mac:clang_${v8_current_cpu}" - } else if (host_cpu == "x64" && -diff -ur node-v12.2.0/deps/v8/tools/node/build_gn.py node-v12.2.0+iPhone/deps/v8/tools/node/build_gn.py ---- node-v12.2.0/deps/v8/tools/node/build_gn.py 2019-05-07 14:52:15.000000000 +0000 -+++ node-v12.2.0+iPhone/deps/v8/tools/node/build_gn.py 2019-05-21 18:37:26.194204650 +0000 -@@ -42,7 +42,7 @@ - def FindGn(options): - if options.host_os == "linux": - os_path = "linux64" -- elif options.host_os == "mac": -+ elif options.host_os == "mac" or options.host_os == "ios": - os_path = "mac" - elif options.host_os == "win": - os_path = "win" + 'conditions': [ +- ['OS=="mac"', { ++ ['OS=="mac" or OS=="ios"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': ['-dynamiclib', '-all_load'] + }, +@@ -1824,7 +1824,7 @@ + '<(V8_ROOT)/src/x64/sse-instr.h', + ], + }], +- ['v8_target_arch=="x64" and (OS=="linux" or OS=="mac")', { ++ ['v8_target_arch=="x64" and (OS=="linux" or OS=="mac" or OS=="ios")', { + 'sources': [ + '<(V8_ROOT)/src/trap-handler/handler-inside-posix.cc', + '<(V8_ROOT)/src/trap-handler/handler-inside-posix.h', +@@ -2296,15 +2296,38 @@ + '<(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': [ -- cgit v1.2.3