From 2c59f9bbe29df1ee3e714671de1433369992eba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 11 Feb 2020 13:54:38 +0100 Subject: [PATCH] tools: update V8 gypfiles for V8 8.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport-PR-URL: https://github.com/nodejs/node/pull/33376 PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso Reviewed-By: Jiawen Geng Reviewed-By: Colin Ihrig --- tools/v8_gypfiles/features.gypi | 17 ++++++- tools/v8_gypfiles/inspector.gypi | 13 +++-- tools/v8_gypfiles/toolchain.gypi | 14 ++++-- tools/v8_gypfiles/v8.gyp | 86 ++++++++++++++++++++++++++++---- 4 files changed, 107 insertions(+), 23 deletions(-) diff --git a/tools/v8_gypfiles/features.gypi b/tools/v8_gypfiles/features.gypi index ecfef26bb3ac9c..b2ff6d4e107a80 100644 --- a/tools/v8_gypfiles/features.gypi +++ b/tools/v8_gypfiles/features.gypi @@ -126,7 +126,7 @@ # Enable pointer compression (sets -dV8_COMPRESS_POINTERS). 'v8_enable_pointer_compression%': 0, - 'v8_enable_31bit_smis_on_64bit_arch%': 1, + 'v8_enable_31bit_smis_on_64bit_arch%': 0, # Sets -dOBJECT_PRINT. 'v8_enable_object_print%': 0, @@ -147,7 +147,7 @@ 'v8_enable_concurrent_marking%': 1, # Sets -dV8_ARRAY_BUFFER_EXTENSION - 'v8_enable_array_buffer_extension%': 0, + 'v8_enable_array_buffer_extension%': 1, # Enables various testing features. 'v8_enable_test_features%': 0, @@ -196,6 +196,13 @@ # Use switch-based dispatch if this is false. 'v8_enable_regexp_interpreter_threaded_dispatch%': 1, + # Disable all snapshot compression. + 'v8_enable_snapshot_compression%': 1, + + # Enable control-flow integrity features, such as pointer authentication + # for ARM64. + 'v8_control_flow_integrity%': 0, + # Variables from v8.gni # Enable ECMAScript Internationalization API. Enabling this feature will @@ -325,6 +332,12 @@ ['v8_enable_regexp_interpreter_threaded_dispatch==1', { 'defines': ['V8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH',], }], + ['v8_enable_snapshot_compression==1', { + 'defines': ['V8_SNAPSHOT_COMPRESSION',], + }], + ['v8_control_flow_integrity==1', { + 'defines': ['V8_ENABLE_CONTROL_FLOW_INTEGRITY',], + }], ], # conditions 'defines': [ 'V8_EMBEDDED_BUILTINS', diff --git a/tools/v8_gypfiles/inspector.gypi b/tools/v8_gypfiles/inspector.gypi index 0ffc7cf8392249..27e2014132a671 100644 --- a/tools/v8_gypfiles/inspector.gypi +++ b/tools/v8_gypfiles/inspector.gypi @@ -8,16 +8,9 @@ 'inspector_protocol_files': [ '<(inspector_protocol_path)/lib/base_string_adapter_cc.template', '<(inspector_protocol_path)/lib/base_string_adapter_h.template', - '<(inspector_protocol_path)/lib/DispatcherBase_cpp.template', - '<(inspector_protocol_path)/lib/DispatcherBase_h.template', - '<(inspector_protocol_path)/lib/ErrorSupport_cpp.template', - '<(inspector_protocol_path)/lib/ErrorSupport_h.template', '<(inspector_protocol_path)/lib/Forward_h.template', - '<(inspector_protocol_path)/lib/FrontendChannel_h.template', '<(inspector_protocol_path)/lib/Object_cpp.template', '<(inspector_protocol_path)/lib/Object_h.template', - '<(inspector_protocol_path)/lib/Parser_cpp.template', - '<(inspector_protocol_path)/lib/Parser_h.template', '<(inspector_protocol_path)/lib/Protocol_cpp.template', '<(inspector_protocol_path)/lib/ValueConversions_h.template', '<(inspector_protocol_path)/lib/Values_cpp.template', @@ -111,7 +104,12 @@ # Flat merge `third_party/inspector_protocol:crdtp` '<(inspector_protocol_path)/crdtp/cbor.cc', '<(inspector_protocol_path)/crdtp/cbor.h', + '<(inspector_protocol_path)/crdtp/dispatch.cc', + '<(inspector_protocol_path)/crdtp/dispatch.h', + '<(inspector_protocol_path)/crdtp/error_support.cc', + '<(inspector_protocol_path)/crdtp/error_support.h', '<(inspector_protocol_path)/crdtp/export.h', + '<(inspector_protocol_path)/crdtp/find_by_first.h', '<(inspector_protocol_path)/crdtp/glue.h', '<(inspector_protocol_path)/crdtp/json.cc', '<(inspector_protocol_path)/crdtp/json.h', @@ -119,6 +117,7 @@ '<(inspector_protocol_path)/crdtp/serializable.cc', '<(inspector_protocol_path)/crdtp/serializable.h', '<(inspector_protocol_path)/crdtp/serializer_traits.h', + '<(inspector_protocol_path)/crdtp/span.cc', '<(inspector_protocol_path)/crdtp/span.h', '<(inspector_protocol_path)/crdtp/status.cc', '<(inspector_protocol_path)/crdtp/status.h', diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi index 10709fab1fbc0c..196196a4e2d65b 100644 --- a/tools/v8_gypfiles/toolchain.gypi +++ b/tools/v8_gypfiles/toolchain.gypi @@ -298,11 +298,17 @@ 'defines': [ 'V8_TARGET_ARCH_ARM64', ], + 'conditions': [ + ['v8_control_flow_integrity==1', { + 'cflags': [ '-mbranch-protection=standard' ], + }], + ], }], ['v8_target_arch=="s390x"', { 'defines': [ 'V8_TARGET_ARCH_S390', ], + 'cflags': [ '-ffp-contract=off' ], 'conditions': [ ['v8_target_arch=="s390x"', { 'defines': [ @@ -319,10 +325,12 @@ ], }], # s390x ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', { - 'defines': [ - 'V8_TARGET_ARCH_PPC', - ], 'conditions': [ + ['v8_target_arch=="ppc"', { + 'defines': [ + 'V8_TARGET_ARCH_PPC', + ], + }], ['v8_target_arch=="ppc64"', { 'defines': [ 'V8_TARGET_ARCH_PPC64', diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index e8263663114c0d..87384d8233db75 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -221,11 +221,14 @@ '<(torque_output_root)/torque-generated/bit-fields-tq.h', '<(torque_output_root)/torque-generated/builtin-definitions-tq.h', '<(torque_output_root)/torque-generated/interface-descriptors-tq.inc', + '<(torque_output_root)/torque-generated/factory-tq.cc', + '<(torque_output_root)/torque-generated/factory-tq.inc', '<(torque_output_root)/torque-generated/field-offsets-tq.h', '<(torque_output_root)/torque-generated/class-verifiers-tq.cc', '<(torque_output_root)/torque-generated/class-verifiers-tq.h', '<(torque_output_root)/torque-generated/enum-verifiers-tq.cc', '<(torque_output_root)/torque-generated/objects-printer-tq.cc', + '<(torque_output_root)/torque-generated/objects-body-descriptors-tq-inl.h', '<(torque_output_root)/torque-generated/class-definitions-tq.cc', '<(torque_output_root)/torque-generated/class-definitions-tq-inl.h', '<(torque_output_root)/torque-generated/class-definitions-tq.h', @@ -309,6 +312,7 @@ '<(torque_output_root)/torque-generated/class-definitions-tq.cc', '<(torque_output_root)/torque-generated/class-verifiers-tq.cc', '<(torque_output_root)/torque-generated/class-verifiers-tq.h', + '<(torque_output_root)/torque-generated/factory-tq.cc', '<(torque_output_root)/torque-generated/objects-printer-tq.cc', ], 'include_dirs': [ @@ -425,7 +429,12 @@ '<(V8_ROOT)/src/builtins/mips64/builtins-mips64.cc', ], }], - ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', { + ['v8_target_arch=="ppc"', { + 'sources': [ + '<(V8_ROOT)/src/builtins/ppc/builtins-ppc.cc', + ], + }], + ['v8_target_arch=="ppc64"', { 'sources': [ '<(V8_ROOT)/src/builtins/ppc/builtins-ppc.cc', ], @@ -595,6 +604,7 @@ ], 'direct_dependent_settings': { 'sources': [ + '<(V8_ROOT)/include/v8-fast-api-calls.h', '<(V8_ROOT)/include/v8-internal.h', '<(V8_ROOT)/include/v8.h', '<(V8_ROOT)/include/v8config.h', @@ -738,6 +748,15 @@ ['want_separate_host_toolset', { 'toolsets': ['host', 'target'], }], + ['v8_control_flow_integrity==1', { + 'sources': [ + '<(V8_ROOT)/src/execution/arm64/pointer-authentication-arm64.h', + ], + }, { + 'sources': [ + '<(V8_ROOT)/src/execution/pointer-authentication-dummy.h', + ], + }], ['v8_target_arch=="ia32"', { 'sources': [ ### gcmole(arch:ia32) ### '