Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build,deps: refactor and fix v8.gyp #23182

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 16 additions & 27 deletions deps/v8/gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@

{
'variables': {
'variables': {
'v8_target_arch%': '<(target_arch)',
},
'v8_target_arch%': '<(target_arch)',

# Emulate GN variables
'conditions': [
['OS=="android"', { # GYP reverts OS to linux so use `-D OS=android`
'is_android': 1,
}, {
'is_android': 0,
}],
],

# Allows the embedder to add a custom suffix to the version string.
'v8_embedder_string%': '',
Expand Down Expand Up @@ -95,6 +102,8 @@

# Enable mitigations for executing untrusted code.
'v8_untrusted_code_mitigations%': 'true',

'v8_enable_handle_zapping%': 1,
},
'target_defaults': {
'conditions': [
Expand All @@ -105,7 +114,7 @@
'defines': ['ENABLE_DISASSEMBLER',],
}],
['v8_promise_internal_field_count!=0', {
'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT','v8_promise_internal_field_count'],
'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT=<(v8_promise_internal_field_count)'],
}],
['v8_enable_gdbjit==1', {
'defines': ['ENABLE_GDB_JIT_INTERFACE',],
Expand Down Expand Up @@ -155,30 +164,10 @@
['v8_untrusted_code_mitigations=="false"', {
'defines': ['DISABLE_UNTRUSTED_CODE_MITIGATIONS',],
}],
['v8_enable_handle_zapping==1', {
'defines': ['ENABLE_HANDLE_ZAPPING',],
}],
], # conditions
'configurations': {
'DebugBaseCommon': {
'abstract': 1,
'variables': {
'v8_enable_handle_zapping%': 1,
},
'conditions': [
['v8_enable_handle_zapping==1', {
'defines': ['ENABLE_HANDLE_ZAPPING',],
}],
],
}, # Debug
'Release': {
'variables': {
'v8_enable_handle_zapping%': 1,
},
'conditions': [
['v8_enable_handle_zapping==1', {
'defines': ['ENABLE_HANDLE_ZAPPING',],
}],
], # conditions
}, # Release
}, # configurations
'defines': [
'V8_GYP_BUILD',
'V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=<(v8_typed_array_max_size_in_heap)',
Expand Down
89 changes: 0 additions & 89 deletions deps/v8/gypfiles/inspector.gyp

This file was deleted.

66 changes: 63 additions & 3 deletions deps/v8/gypfiles/inspector.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

{
'variables': {
'protocol_path': '../third_party/inspector_protocol',
'inspector_path': '../src/inspector',

'inspector_generated_sources': [
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Forward.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Protocol.cpp',
Expand All @@ -29,8 +32,6 @@
'inspector_generated_injected_script': '<(SHARED_INTERMEDIATE_DIR)/src/inspector/injected-script-source.h',

'inspector_all_sources': [
'<@(inspector_generated_sources)',
'<(inspector_generated_injected_script)',
'../include/v8-inspector.h',
'../include/v8-inspector-protocol.h',
'../src/inspector/injected-script.cc',
Expand Down Expand Up @@ -86,5 +87,64 @@
'../src/inspector/wasm-translation.cc',
'../src/inspector/wasm-translation.h',
]
}
},
'includes': [
'../third_party/inspector_protocol/inspector_protocol.gypi',
],
'actions': [
{
'action_name': 'protocol_compatibility',
'inputs': [
'<(inspector_path)/js_protocol.json',
],
'outputs': [
'<@(SHARED_INTERMEDIATE_DIR)/src/js_protocol.stamp',
],
'action': [
'python',
'<(protocol_path)/CheckProtocolCompatibility.py',
'--stamp', '<@(_outputs)',
'<(inspector_path)/js_protocol.json',
],
'message': 'Checking inspector protocol compatibility',
},
{
'action_name': 'protocol_generated_sources',
'inputs': [
'<(inspector_path)/js_protocol.json',
'<(inspector_path)/inspector_protocol_config.json',
'<@(inspector_protocol_files)',
],
'outputs': [
'<@(inspector_generated_sources)',
],
'process_outputs_as_sources': 1,
'action': [
'python',
'<(protocol_path)/CodeGenerator.py',
'--jinja_dir', '../third_party',
'--output_base', '<(SHARED_INTERMEDIATE_DIR)/src/inspector',
'--config', '<(inspector_path)/inspector_protocol_config.json',
],
'message': 'Generating inspector protocol sources from protocol json',
},
{
'action_name': 'convert_js_to_cpp_char_array',
'inputs': [
'<(inspector_path)/build/xxd.py',
'<(inspector_injected_script_source)',
],
'outputs': [
'<(inspector_generated_injected_script)',
],
'process_outputs_as_sources': 1,
'action': [
'python',
'<(inspector_path)/build/xxd.py',
'InjectedScriptSource_js',
'<(inspector_path)/injected-script-source.js',
'<@(_outputs)'
],
},
],
}
19 changes: 19 additions & 0 deletions deps/v8/gypfiles/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1425,5 +1425,24 @@
}],
],
}, # configurations
'msvs_disabled_warnings': [
4245, # Conversion with signed/unsigned mismatch.
4267, # Conversion with possible loss of data.
4324, # Padding structure due to alignment.
4701, # Potentially uninitialized local variable.
4702, # Unreachable code.
4703, # Potentially uninitialized local pointer variable.
4709, # Comma operator within array index expr (bugged).
4714, # Function marked forceinline not inlined.

# MSVC assumes that control can get past an exhaustive switch and then
# warns if there's no return there (see https://crbug.com/v8/7658)
4715, # Not all control paths return a value.

4718, # Recursive call has no side-effect.
4723, # https://crbug.com/v8/7771
4724, # https://crbug.com/v8/7771
4800, # Forcing value to bool.
],
}, # target_defaults
}
Loading