Skip to content

Commit

Permalink
build: speed up compilation of some V8 files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
targos committed Mar 19, 2024
1 parent 978d5a2 commit 4e278f0
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,41 @@
'<(V8_ROOT)/src/init/setup-isolate-full.cc',
],
}, # v8_init
{
# This target is used to work around a GCC issue that causes the
# compilation to take several minutes when using -O2 or -O3.
# This is fixed in GCC 13.
'target_name': 'v8_initializers_slow',
'type': 'static_library',
'toolsets': ['host', 'target'],
'dependencies': [
'generate_bytecode_builtins_list',
'run_torque',
],
'cflags!': ['-O3'],
'cflags': ['-O1'],
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/js-to-wasm-tq-csa.h',
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/js-to-wasm-tq-csa.cc',
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/wasm-to-js-tq-csa.h',
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/wasm-to-js-tq-csa.cc',
],
'conditions': [
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
],
}, # v8_initializers_slow
{
'target_name': 'v8_initializers',
'type': 'static_library',
'toolsets': ['host', 'target'],
'dependencies': [
'torque_generated_initializers',
'v8_initializers_slow',
'v8_base_without_compiler',
'v8_shared_internal_headers',
'v8_pch',
Expand All @@ -267,6 +296,13 @@
'<(SHARED_INTERMEDIATE_DIR)',
'<(generate_bytecode_output_root)',
],
# Compiled by v8_initializers_slow target.
'sources!': [
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/js-to-wasm-tq-csa.h',
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/js-to-wasm-tq-csa.cc',
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/wasm-to-js-tq-csa.h',
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/wasm-to-js-tq-csa.cc',
],
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_initializers.*?sources = ")',
],
Expand Down

0 comments on commit 4e278f0

Please sign in to comment.