Skip to content

Commit 4e278f0

Browse files
committed
build: speed up compilation of some V8 files
This introduces a special target to compile some of the 'v8_initializers' files with "-O1" instead of "-O3" to avoid huge compilation times with GCC versions <13. PR-URL: #52083 Fixes: #52068 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daniel Lemire <daniel@lemire.me>
1 parent 978d5a2 commit 4e278f0

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tools/v8_gypfiles/v8.gyp

+36
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,41 @@
253253
'<(V8_ROOT)/src/init/setup-isolate-full.cc',
254254
],
255255
}, # v8_init
256+
{
257+
# This target is used to work around a GCC issue that causes the
258+
# compilation to take several minutes when using -O2 or -O3.
259+
# This is fixed in GCC 13.
260+
'target_name': 'v8_initializers_slow',
261+
'type': 'static_library',
262+
'toolsets': ['host', 'target'],
263+
'dependencies': [
264+
'generate_bytecode_builtins_list',
265+
'run_torque',
266+
],
267+
'cflags!': ['-O3'],
268+
'cflags': ['-O1'],
269+
'sources': [
270+
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/js-to-wasm-tq-csa.h',
271+
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/js-to-wasm-tq-csa.cc',
272+
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/wasm-to-js-tq-csa.h',
273+
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/wasm-to-js-tq-csa.cc',
274+
],
275+
'conditions': [
276+
['v8_enable_i18n_support==1', {
277+
'dependencies': [
278+
'<(icu_gyp_path):icui18n',
279+
'<(icu_gyp_path):icuuc',
280+
],
281+
}],
282+
],
283+
}, # v8_initializers_slow
256284
{
257285
'target_name': 'v8_initializers',
258286
'type': 'static_library',
259287
'toolsets': ['host', 'target'],
260288
'dependencies': [
261289
'torque_generated_initializers',
290+
'v8_initializers_slow',
262291
'v8_base_without_compiler',
263292
'v8_shared_internal_headers',
264293
'v8_pch',
@@ -267,6 +296,13 @@
267296
'<(SHARED_INTERMEDIATE_DIR)',
268297
'<(generate_bytecode_output_root)',
269298
],
299+
# Compiled by v8_initializers_slow target.
300+
'sources!': [
301+
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/js-to-wasm-tq-csa.h',
302+
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/js-to-wasm-tq-csa.cc',
303+
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/wasm-to-js-tq-csa.h',
304+
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/wasm-to-js-tq-csa.cc',
305+
],
270306
'sources': [
271307
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_initializers.*?sources = ")',
272308
],

0 commit comments

Comments
 (0)