summaryrefslogtreecommitdiff
path: root/data/node/v8.diff
blob: 9b801e55aa64145d013e6ed32e85e8e9c3c8e278 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
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%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
+
     'werror%': '-Werror',
     # For a shared library build, results in "libv8-<(soname_version).so".
     'soname_version%': '',
@@ -371,7 +373,7 @@
                   [ 'clang==1', {
                     'cflags': ['-integrated-as'],
                   }],
-                  ['OS!="mac"', {
+                  ['OS!="mac" or OS!="ios"', {
                     'defines': ['_MIPS_TARGET_HW',],
                   }, {
                     'defines': ['_MIPS_TARGET_SIMULATOR',],
@@ -384,7 +386,7 @@
           }],  #'_toolset=="target"
           ['_toolset=="host"', {
             'conditions': [
-              ['v8_target_arch==target_arch and OS!="mac"', {
+              ['v8_target_arch==target_arch and OS!="mac" or OS!="ios"', {
                 'defines': ['_MIPS_TARGET_HW',],
               }, {
                 'defines': ['_MIPS_TARGET_SIMULATOR',],
@@ -1025,7 +1027,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 +1036,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 +1237,7 @@
                   '-ffunction-sections',
                 ],
               }],
-              ['OS=="mac"', {
+              ['OS=="mac" or OS=="ios"', {
                 'xcode_settings': {
                   'GCC_OPTIMIZATION_LEVEL': '0',  # -O0
                 },
@@ -1296,7 +1298,7 @@
                    }],
                 ],
               }],
-              ['OS=="mac"', {
+              ['OS=="mac" or OS=="ios"', {
                 'xcode_settings': {
                   'GCC_OPTIMIZATION_LEVEL': '3',  # -O3
                   'GCC_STRICT_ALIASING': 'YES',
@@ -1356,7 +1358,7 @@
               '-O2',
             ],
           }],
-          ['OS=="mac"', {
+          ['OS=="mac" or OS=="ios"', {
             'xcode_settings': {
               'GCC_OPTIMIZATION_LEVEL': '3',  # -O3
 
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-22 15:21:50.389972067 +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,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': [