@@ -10,6 +10,17 @@ however those files were cherry-picked from main branch and do not
10
10
really in 20/21. We have to wait until 22 is released to be able to
11
11
build with upstream GN files.
12
12
13
+ diff --git a/deps/simdjson/unofficial.gni b/deps/simdjson/unofficial.gni
14
+ index d6909b95886f4de3f0b953c2a2992f69066b7434..972955f9144aafcd3a3fe278b7aaad401cadddda 100644
15
+ --- a/deps/simdjson/unofficial.gni
16
+ +++ b/deps/simdjson/unofficial.gni
17
+ @@ -18,5 +18,6 @@ template("simdjson_gn_build") {
18
+ forward_variables_from(invoker, "*")
19
+ public_configs = [ ":simdjson_config" ]
20
+ sources = gypi_values.simdjson_sources
21
+ + cflags_c = [ "-Wdeprecated-literal-operator" ]
22
+ }
23
+ }
13
24
diff --git a/deps/sqlite/unofficial.gni b/deps/sqlite/unofficial.gni
14
25
index ebb3ffcd6d42b4c16b6865a91ccf4428cffe864b..00225afa1fb4205f1e02d9f185aeb97d642b3fd9 100644
15
26
--- a/deps/sqlite/unofficial.gni
@@ -31,7 +42,7 @@ index ebb3ffcd6d42b4c16b6865a91ccf4428cffe864b..00225afa1fb4205f1e02d9f185aeb97d
31
42
"-Wno-unused-but-set-variable",
32
43
"-Wno-unused-function",
33
44
diff --git a/node.gni b/node.gni
34
- index 9dca810decebd75aab427e306b3cc37c80fb55c9..32709b860ccb12d8d1e75342a65dda0b86129b21 100644
45
+ index 9dca810decebd75aab427e306b3cc37c80fb55c9..852f64fa9cfb50fe6e9ce7aa46be336d3196d5b8 100644
35
46
--- a/node.gni
36
47
+++ b/node.gni
37
48
@@ -5,10 +5,10 @@
@@ -56,20 +67,29 @@ index 9dca810decebd75aab427e306b3cc37c80fb55c9..32709b860ccb12d8d1e75342a65dda0b
56
67
57
68
# Custom build tag.
58
69
node_tag = ""
59
- @@ -58,7 +58,7 @@ declare_args() {
70
+ @@ -58,7 +58,16 @@ declare_args() {
60
71
# TODO(zcbenz): There are few broken things for now:
61
72
# 1. cross-os compilation is not supported.
62
73
# 2. node_mksnapshot crashes when cross-compiling for x64 from arm64.
63
74
- node_use_node_snapshot = (host_os == target_os) && !(host_cpu == "arm64" && target_cpu == "x64")
64
75
+ node_use_node_snapshot = false
76
+ +
77
+ + # Build with Amaro (TypeScript utils).
78
+ + node_use_amaro = true
79
+ +
80
+ + # Allows downstream packagers (eg. Linux distributions) to build against system shared libraries.
81
+ + use_system_cares = false
82
+ + use_system_nghttp2 = false
83
+ + use_system_llhttp = false
84
+ + use_system_histogram = false
65
85
}
66
86
67
87
assert(!node_enable_inspector || node_use_openssl,
68
88
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
69
- index 2bc7155f7c075e5a22ece7159a64a1c9ba3d8ac9..48d29a0d05538cd1d992f3f086d826e78d0d8882 100644
89
+ index 1bec44f6f29b0b652e92d2bb336fdb74b85eee30..599b59873dbb17ae5e7463403859e088ffb86cda 100644
70
90
--- a/src/node_builtins.cc
71
91
+++ b/src/node_builtins.cc
72
- @@ -775 ,6 +775 ,7 @@ void BuiltinLoader::RegisterExternalReferences(
92
+ @@ -778 ,6 +778 ,7 @@ void BuiltinLoader::RegisterExternalReferences(
73
93
registry->Register(GetNatives);
74
94
75
95
RegisterExternalReferencesForInternalizedBuiltinCode(registry);
@@ -91,7 +111,7 @@ index 1cb85b9058d06555382e565dc32192a9fa48ed9f..cec9be01abd107e8612f70daf19b4834
91
111
// Handles compilation and caching of built-in JavaScript modules and
92
112
// bootstrap scripts, whose source are bundled into the binary as static data.
93
113
diff --git a/tools/generate_config_gypi.py b/tools/generate_config_gypi.py
94
- index 45b3ac5006140fb55aad0e6b78084b753a947a76..8667857107e4f2481fd98032d4333b086fb7b479 100755
114
+ index 45b3ac5006140fb55aad0e6b78084b753a947a76..35cce2ea8fd85f21582962115ac455918d4c4553 100755
95
115
--- a/tools/generate_config_gypi.py
96
116
+++ b/tools/generate_config_gypi.py
97
117
@@ -21,7 +21,7 @@ import getnapibuildversion
@@ -103,6 +123,14 @@ index 45b3ac5006140fb55aad0e6b78084b753a947a76..8667857107e4f2481fd98032d4333b08
103
123
else:
104
124
GN = 'gn'
105
125
126
+ @@ -65,6 +65,7 @@ def translate_config(out_dir, config, v8_config):
127
+ eval(config['node_builtin_shareable_builtins']),
128
+ 'node_module_version': int(config['node_module_version']),
129
+ 'node_use_openssl': config['node_use_openssl'],
130
+ + 'node_use_amaro': config['node_use_amaro'],
131
+ 'node_use_node_code_cache': config['node_use_node_code_cache'],
132
+ 'node_use_node_snapshot': config['node_use_node_snapshot'],
133
+ 'v8_enable_inspector': # this is actually a node misnomer
106
134
diff --git a/tools/install.py b/tools/install.py
107
135
index bf54249b66c0d4e179deaae5a9fd55568e694fe0..31b94d2e4b532d3b8202b512e2d2f41d29a2a546 100755
108
136
--- a/tools/install.py
@@ -118,26 +146,26 @@ index bf54249b66c0d4e179deaae5a9fd55568e694fe0..31b94d2e4b532d3b8202b512e2d2f41d
118
146
diff --git a/tools/js2c.cc b/tools/js2c.cc
119
147
old mode 100644
120
148
new mode 100755
121
- index a536b5dcd857275d3b02e361bd7d37a939f6b573..b2d5678d58a79774d5aeedc15ac5d5fd786f64bb
149
+ index 21992cbe894a880e3223c379326b62db22f2f12d..1296a5457422099035ba34f2b02624f2e9dfb0f0
122
150
--- a/tools/js2c.cc
123
151
+++ b/tools/js2c.cc
124
- @@ -30 ,6 +30 ,7 @@ namespace js2c {
152
+ @@ -28 ,6 +28 ,7 @@ namespace js2c {
125
153
int Main(int argc, char* argv[]);
126
154
127
155
static bool is_verbose = false;
128
156
+ static bool only_js = false;
129
157
130
158
void Debug(const char* format, ...) {
131
159
va_list arguments;
132
- @@ -196 ,6 +197 ,7 @@ const char* kTemplate = R"(
160
+ @@ -175 ,6 +176 ,7 @@ const char* kTemplate = R"(
133
161
#include "node_builtins.h"
134
162
#include "node_external_reference.h"
135
163
#include "node_internals.h"
136
164
+ #include "node_threadsafe_cow-inl.h"
137
165
138
166
namespace node {
139
167
140
- @@ -211 ,7 +213 ,11 @@ const ThreadsafeCopyOnWrite<BuiltinSourceMap> global_source_map {
168
+ @@ -190 ,7 +192 ,11 @@ const ThreadsafeCopyOnWrite<BuiltinSourceMap> global_source_map {
141
169
} // anonymous namespace
142
170
143
171
void BuiltinLoader::LoadJavaScriptSource() {
@@ -150,7 +178,7 @@ index a536b5dcd857275d3b02e361bd7d37a939f6b573..b2d5678d58a79774d5aeedc15ac5d5fd
150
178
}
151
179
152
180
void RegisterExternalReferencesForInternalizedBuiltinCode(
153
- @@ -228 ,6 +234 ,45 @@ UnionBytes BuiltinLoader::GetConfig() {
181
+ @@ -207 ,6 +213 ,45 @@ UnionBytes BuiltinLoader::GetConfig() {
154
182
} // namespace node
155
183
)";
156
184
@@ -196,7 +224,7 @@ index a536b5dcd857275d3b02e361bd7d37a939f6b573..b2d5678d58a79774d5aeedc15ac5d5fd
196
224
Fragment Format(const Fragments& definitions,
197
225
const Fragments& initializers,
198
226
const Fragments& registrations) {
199
- @@ -237 ,13 +282 ,12 @@ Fragment Format(const Fragments& definitions,
227
+ @@ -216 ,13 +261 ,12 @@ Fragment Format(const Fragments& definitions,
200
228
size_t init_size = init_buf.size();
201
229
std::vector<char> reg_buf = Join(registrations, "\n");
202
230
size_t reg_size = reg_buf.size();
@@ -213,7 +241,7 @@ index a536b5dcd857275d3b02e361bd7d37a939f6b573..b2d5678d58a79774d5aeedc15ac5d5fd
213
241
static_cast<int>(def_buf.size()),
214
242
def_buf.data(),
215
243
static_cast<int>(init_buf.size()),
216
- @@ -834 ,12 +878 ,15 @@ int JS2C(const FileList& js_files,
244
+ @@ -846 ,12 +890 ,15 @@ int JS2C(const FileList& js_files,
217
245
}
218
246
}
219
247
@@ -229,7 +257,7 @@ index a536b5dcd857275d3b02e361bd7d37a939f6b573..b2d5678d58a79774d5aeedc15ac5d5fd
229
257
Fragment out = Format(definitions, initializers, registrations);
230
258
return WriteIfChanged(out, dest);
231
259
}
232
- @@ -865 ,6 +912 ,8 @@ int Main(int argc, char* argv[]) {
260
+ @@ -877 ,6 +924 ,8 @@ int Main(int argc, char* argv[]) {
233
261
std::string arg(argv[i]);
234
262
if (arg == "--verbose") {
235
263
is_verbose = true;
@@ -238,7 +266,7 @@ index a536b5dcd857275d3b02e361bd7d37a939f6b573..b2d5678d58a79774d5aeedc15ac5d5fd
238
266
} else if (arg == "--root") {
239
267
if (i == argc - 1) {
240
268
fprintf(stderr, "--root must be followed by a path\n");
241
- @@ -913 ,6 +962 ,14 @@ int Main(int argc, char* argv[]) {
269
+ @@ -925 ,6 +974 ,14 @@ int Main(int argc, char* argv[]) {
242
270
}
243
271
}
244
272
@@ -253,7 +281,7 @@ index a536b5dcd857275d3b02e361bd7d37a939f6b573..b2d5678d58a79774d5aeedc15ac5d5fd
253
281
// Should have exactly 3 types: `.js`, `.mjs` and `.gypi`.
254
282
assert(file_map.size() == 3);
255
283
auto gypi_it = file_map.find(".gypi");
256
- @@ -939 ,6 +996 ,7 @@ int Main(int argc, char* argv[]) {
284
+ @@ -951 ,6 +1008 ,7 @@ int Main(int argc, char* argv[]) {
257
285
std::sort(mjs_it->second.begin(), mjs_it->second.end());
258
286
259
287
return JS2C(js_it->second, mjs_it->second, gypi_it->second[0], output);
@@ -274,26 +302,38 @@ index 65d0e1be42f0a85418491ebb548278cf431aa6a0..d4a31342f1c6107b029394c6e1d00a1d
274
302
except Exception as e:
275
303
print(str(e))
276
304
diff --git a/unofficial.gni b/unofficial.gni
277
- index c3b311e4a7f5444b07d4d7028d4621806959804e..de6ff5548ca5282199b7d85c11941c1fa351a9d9 100644
305
+ index c3b311e4a7f5444b07d4d7028d4621806959804e..f6793b8bf22d6ac911a1977edaa881b6dbbe7ac7 100644
278
306
--- a/unofficial.gni
279
307
+++ b/unofficial.gni
280
- @@ -139,6 +139,7 @@ template("node_gn_build") {
308
+ @@ -22,6 +22,11 @@ template("node_gn_build") {
309
+ } else {
310
+ defines += [ "HAVE_OPENSSL=0" ]
311
+ }
312
+ + if (node_use_amaro) {
313
+ + defines += [ "HAVE_AMARO=1" ]
314
+ + } else {
315
+ + defines += [ "HAVE_AMARO=0" ]
316
+ + }
317
+ if (node_use_v8_platform) {
318
+ defines += [ "NODE_USE_V8_PLATFORM=1" ]
319
+ } else {
320
+ @@ -139,6 +144,7 @@ template("node_gn_build") {
281
321
public_deps = [
282
322
"deps/ada",
283
323
"deps/uv",
284
324
+ "//electron:electron_js2c",
285
325
"deps/simdjson",
286
326
"$node_v8_path",
287
327
]
288
- @@ -150,7 +151 ,6 @@ template("node_gn_build") {
328
+ @@ -150,7 +156 ,6 @@ template("node_gn_build") {
289
329
"deps/llhttp",
290
330
"deps/nbytes",
291
331
"deps/nghttp2",
292
332
- "deps/ngtcp2",
293
333
"deps/postject",
294
334
"deps/simdutf",
295
335
"deps/sqlite",
296
- @@ -159,7 +159 ,11 @@ template("node_gn_build") {
336
+ @@ -159,7 +164 ,11 @@ template("node_gn_build") {
297
337
"$node_v8_path:v8_libplatform",
298
338
]
299
339
@@ -305,7 +345,7 @@ index c3b311e4a7f5444b07d4d7028d4621806959804e..de6ff5548ca5282199b7d85c11941c1f
305
345
"$target_gen_dir/node_javascript.cc",
306
346
] + gypi_values.node_sources
307
347
308
- @@ -178,8 +182 ,10 @@ template("node_gn_build") {
348
+ @@ -178,8 +187 ,10 @@ template("node_gn_build") {
309
349
deps += [ "//third_party/icu" ]
310
350
}
311
351
if (node_use_openssl) {
@@ -318,15 +358,15 @@ index c3b311e4a7f5444b07d4d7028d4621806959804e..de6ff5548ca5282199b7d85c11941c1f
318
358
sources += gypi_values.node_crypto_sources
319
359
}
320
360
if (node_enable_inspector) {
321
- @@ -276,6 +282 ,7 @@ template("node_gn_build") {
361
+ @@ -276,6 +287 ,7 @@ template("node_gn_build") {
322
362
}
323
363
324
364
executable("node_js2c") {
325
365
+ defines = []
326
366
deps = [
327
367
"deps/simdutf",
328
368
"deps/uv",
329
- @@ -286,26 +293 ,75 @@ template("node_gn_build") {
369
+ @@ -286,26 +298 ,75 @@ template("node_gn_build") {
330
370
"src/embedded_data.cc",
331
371
"src/embedded_data.h",
332
372
]
@@ -412,7 +452,7 @@ index c3b311e4a7f5444b07d4d7028d4621806959804e..de6ff5548ca5282199b7d85c11941c1f
412
452
outputs = [ "$target_gen_dir/node_javascript.cc" ]
413
453
414
454
# Get the path to node_js2c executable of the host toolchain.
415
- @@ -319,11 +375 ,11 @@ template("node_gn_build") {
455
+ @@ -319,11 +380 ,11 @@ template("node_gn_build") {
416
456
get_label_info(":node_js2c($host_toolchain)", "name") +
417
457
host_executable_suffix
418
458
0 commit comments