0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 13:09:21 +01:00

build,v8: sync V8 gypfiles with 7.5

Co-authored-by: Ujjwal Sharma <usharma1998@gmail.com>
Co-authored-by: Michaël Zasso <targos@protonmail.com>

PR-URL: https://github.com/nodejs/node/pull/27375
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Refael Ackermann 2019-03-29 03:38:12 -04:00
parent e3cd79ef8e
commit 417c18e834
8 changed files with 1515 additions and 981 deletions

View File

@ -70,6 +70,11 @@
# https://github.com/nodejs/node/pull/22920/files#r222779926
'v8_enable_fast_mksnapshot': 0,
'v8_win64_unwinding_info': 0,
# TODO(refack): make v8-perfetto happen
'v8_use_perfetto': 0,
##### end V8 defaults #####
'conditions': [
@ -81,23 +86,23 @@
}],
['GENERATOR=="ninja"', {
'obj_dir': '<(PRODUCT_DIR)/obj',
'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_base.a',
'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_snapshot.a',
}, {
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_base.a',
'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a',
}],
['OS == "win"', {
'os_posix': 0,
'v8_postmortem_support%': 0,
'obj_dir': '<(PRODUCT_DIR)/obj',
'v8_base': '<(PRODUCT_DIR)/lib/v8_libbase.lib',
'v8_base': '<(PRODUCT_DIR)/lib/libv8_snapshot.a',
}, {
'os_posix': 1,
'v8_postmortem_support%': 1,
}],
['OS == "mac"', {
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
'v8_base': '<(PRODUCT_DIR)/libv8_base.a',
'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a',
}],
['openssl_fips != ""', {
'openssl_product': '<(STATIC_LIB_PREFIX)crypto<(STATIC_LIB_SUFFIX)',
@ -225,39 +230,29 @@
'msvs_settings': {
'VCCLCompilerTool': {
'BufferSecurityCheck': 'true',
'DebugInformationFormat': 1, # /Z7 embed info in .obj files
'ExceptionHandling': 0, # /EHsc
'DebugInformationFormat': 1, # /Z7 embed info in .obj files
'ExceptionHandling': 0, # /EHsc
'MultiProcessorCompilation': 'true',
'StringPooling': 'true', # pool string literals
'StringPooling': 'true', # pool string literals
'SuppressStartupBanner': 'true',
'WarnAsError': 'false',
'WarningLevel': 3, # /W3
'WarningLevel': 3, # /W3
},
'VCLinkerTool': {
'target_conditions': [
['_type=="executable"', {
'SubSystem': 1, # /SUBSYSTEM:CONSOLE
}],
],
'conditions': [
['target_arch=="ia32"', {
'TargetMachine' : 1, # /MACHINE:X86
'target_conditions': [
['_type=="executable"', {
'AdditionalOptions': [ '/SubSystem:Console,"5.01"' ],
}],
],
'TargetMachine' : 1, # /MACHINE:X86
}],
['target_arch=="x64"', {
'TargetMachine' : 17, # /MACHINE:AMD64
'target_conditions': [
['_type=="executable"', {
'AdditionalOptions': [ '/SubSystem:Console,"5.02"' ],
}],
],
'TargetMachine' : 17, # /MACHINE:X64
}],
['target_arch=="arm64"', {
'TargetMachine' : 0, # /MACHINE:ARM64 is inferred from the input files.
'target_conditions': [
['_type=="executable"', {
'AdditionalOptions': [ '/SubSystem:Console' ],
}],
],
'TargetMachine' : 0, # NotSet. MACHINE:ARM64 is inferred from the input files.
}],
],
'GenerateDebugInformation': 'true',

View File

@ -615,6 +615,13 @@ def b(value):
else:
return 'false'
def B(value):
"""Returns 1 if value is truthy, 0 otherwise."""
if value:
return 1
else:
return 0
def pkg_config(pkg):
"""Run pkg-config on the specified package
@ -1594,6 +1601,7 @@ configure_inspector(output)
# move everything else to target_defaults
variables = output['variables']
del output['variables']
variables['is_debug'] = B(options.debug)
# make_global_settings for special FIPS linking
# should not be used to compile modules in node-gyp

View File

@ -344,22 +344,24 @@
[ 'node_intermediate_lib_type=="static_library" and node_shared=="false"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)'
'<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)',
],
},
'msvs_settings': {
'VCLinkerTool': {
'AdditionalOptions': [
'/WHOLEARCHIVE:<(node_lib_target_name)<(STATIC_LIB_SUFFIX)',
'/WHOLEARCHIVE:<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)',
],
},
},
'conditions': [
['OS!="aix"', {
['OS != "aix" and OS != "mac"', {
'ldflags': [
'-Wl,--whole-archive,<(obj_dir)/<(STATIC_LIB_PREFIX)'
'<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
'-Wl,--whole-archive',
'<(obj_dir)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
'<(obj_dir)/tools/v8_gypfiles/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)',
'-Wl,--no-whole-archive',
],
}],
@ -386,10 +388,12 @@
'NODE_ARCH="<(target_arch)"',
'NODE_PLATFORM="<(OS)"',
],
'conditions': [
['OS=="win"', {
'libraries': [ 'Ws2_32' ],
}],
}],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',
'winmm.lib',
'Ws2_32.lib',
],
}],
['node_with_ltcg=="true"', {
@ -986,7 +990,7 @@
{
'action_name': 'node_dtrace_ustack_constants',
'inputs': [
'<(v8_base)'
'<(obj_dir)/tools/v8_gypfiles/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)'
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
@ -1140,8 +1144,16 @@
}],
],
}],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',
'winmm.lib',
'Ws2_32.lib',
],
}],
],
}, # cctest
# TODO(joyeecheung): do not depend on node_lib,
# instead create a smaller static library node_lib_base that does
# just enough for node_native_module.cc and the cache builder to
@ -1181,20 +1193,12 @@
],
'conditions': [
[ 'node_report=="true"', {
'conditions': [
['OS=="win"', {
'libraries': [
'dbghelp.lib',
'PsApi.lib',
'Ws2_32.lib',
],
'dll_files': [
'dbghelp.dll',
'PsApi.dll',
'Ws2_32.dll',
],
}],
['OS=="win"', {
'libraries': [
'dbghelp.lib',
'PsApi.lib',
'winmm.lib',
'Ws2_32.lib',
],
}],
],
@ -1231,11 +1235,11 @@
],
'conditions': [
[ 'node_report=="true"', {
'conditions': [
['OS=="win"', {
'libraries': [ 'Ws2_32' ],
}],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',
'winmm.lib',
'Ws2_32.lib',
],
}],
],

View File

@ -70,7 +70,7 @@
}],
[ 'node_use_bundled_v8=="true"', {
'dependencies': [
'tools/v8_gypfiles/v8.gyp:v8',
'tools/v8_gypfiles/v8.gyp:v8_snapshot',
'tools/v8_gypfiles/v8.gyp:v8_libplatform',
],
}],
@ -116,21 +116,13 @@
[ 'node_no_browser_globals=="true"', {
'defines': [ 'NODE_NO_BROWSER_GLOBALS' ],
} ],
[ 'node_use_bundled_v8=="true" and v8_postmortem_support==1 and force_load=="true"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-force_load,<(v8_base)',
],
},
}],
[ 'node_shared_zlib=="false"', {
'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
'conditions': [
[ 'force_load=="true"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)'
'zlib<(STATIC_LIB_SUFFIX)',
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)zlib<(STATIC_LIB_SUFFIX)',
],
},
'msvs_settings': {
@ -143,7 +135,7 @@
'conditions': [
['OS!="aix" and node_shared=="false"', {
'ldflags': [
'-Wl,--whole-archive,'
'-Wl,--whole-archive',
'<(obj_dir)/deps/zlib/<(STATIC_LIB_PREFIX)zlib<(STATIC_LIB_SUFFIX)',
'-Wl,--no-whole-archive',
],
@ -170,8 +162,7 @@
[ 'force_load=="true"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)'
'uv<(STATIC_LIB_SUFFIX)',
'-Wl,-force_load,<(PRODUCT_DIR)/libuv<(STATIC_LIB_SUFFIX)',
],
},
'msvs_settings': {
@ -184,7 +175,7 @@
'conditions': [
['OS!="aix" and node_shared=="false"', {
'ldflags': [
'-Wl,--whole-archive,'
'-Wl,--whole-archive',
'<(obj_dir)/deps/uv/<(STATIC_LIB_PREFIX)uv<(STATIC_LIB_SUFFIX)',
'-Wl,--no-whole-archive',
],
@ -269,9 +260,18 @@
}],
[ '(OS=="freebsd" or OS=="linux") and node_shared=="false"'
' and force_load=="true"', {
'ldflags': [ '-Wl,-z,noexecstack',
'-Wl,--whole-archive <(v8_base)',
'-Wl,--no-whole-archive' ]
'ldflags': [
'-Wl,-z,noexecstack',
'-Wl,--whole-archive <(v8_base)',
'-Wl,--no-whole-archive',
]
}],
[ 'node_use_bundled_v8=="true" and v8_postmortem_support==1 and force_load=="true"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-force_load,<(v8_base)',
],
},
}],
[ 'coverage=="true" and node_shared=="false" and OS in "mac freebsd linux"', {
'cflags!': [ '-O3' ],

View File

@ -1,3 +1,19 @@
#include "src/api-inl.h"
#include "src/ast/ast.h"
#include "src/builtins/builtins-definitions.h"
#include "src/code-stub-assembler.h"
#include "src/globals.h"
#include "src/objects-inl.h"
#include "src/objects/dictionary-inl.h"
#include "src/objects/js-objects-inl.h"
#include "src/objects/fixed-array-inl.h"
#include "src/utils.h"
#include "src/vector.h"
#include <algorithm>
#include <cstring>
#include <iterator>
#include <iosfwd>
#include <memory>
#include <string>

View File

@ -34,13 +34,36 @@
'v8_current_cpu%': '<(target_arch)',
# Emulate GN variables
# https://chromium.googlesource.com/chromium/src/build/+/556c524beb09c332698debe1b47b065d5d029cd0/config/BUILDCONFIG.gn#269
'conditions': [
['OS == "win" or OS == "winuwp"', {
'is_win': 1,
}, {
'is_win': 0,
}],
['OS == "fuchsia"', {
'is_fuchsia': 1,
}, {
'is_fuchsia': 0,
}],
['OS=="android"', { # GYP reverts OS to linux so use `-D OS=android`
'is_android': 1,
}, {
'is_android': 0,
}],
# flattened (!is_win && !is_fuchsia) because of GYP evaluation order
['not (OS == "win" or OS == "winuwp") and not (OS == "fuchsia")', {
'is_posix': 1,
}, {
'is_posix': 0,
}],
['component and "library" in component', {
'is_component_build': 1,
}, {
'is_component_build': 0,
}],
],
'is_debug%': 0,
# Variables from BUILD.gn
@ -92,9 +115,18 @@
# Enable embedded builtins.
'v8_enable_embedded_builtins%': 1,
# Enable the registration of unwinding info for Windows/x64.
'v8_win64_unwinding_info%': 0,
# Enable code comments for builtins in the snapshot (impacts performance).
'v8_enable_snapshot_code_comments%': 0,
# Enable native counters from the snapshot (impacts performance, sets
# -dV8_SNAPSHOT_NATIVE_CODE_COUNTERS).
# This option will generate extra code in the snapshot to increment counters,
# as per the --native-code-counters flag.
'v8_enable_snapshot_native_code_counters%': 0,
# Enable code-generation-time checking of types in the CodeStubAssembler.
'v8_enable_verify_csa%': 0,
@ -123,6 +155,10 @@
# Enables various testing features.
'v8_enable_test_features%': 0,
# Enables raw heap snapshots containing internals. Used for debugging memory
# on platform and embedder level.
'v8_enable_raw_heap_snapshots%': 0,
# With post mortem support enabled, metadata is embedded into libv8 that
# describes various parameters of the VM for use by debuggers. See
# tools/gen-postmortem-metadata.py for details.
@ -131,6 +167,10 @@
# Use Siphash as added protection against hash flooding attacks.
'v8_use_siphash%': 0,
# Use Perfetto (https://perfetto.dev) as the default TracingController. Not
# currently implemented.
'v8_use_perfetto%': 0,
# Controls the threshold for on-heap/off-heap Typed Arrays.
'v8_typed_array_max_size_in_heap%': 64,
@ -170,6 +210,9 @@
['v8_promise_internal_field_count!=0', {
'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT=<(v8_promise_internal_field_count)'],
}],
['v8_enable_raw_heap_snapshots==1', {
'defines': ['V8_ENABLE_RAW_HEAP_SNAPSHOTS',],
}],
['v8_enable_future==1', {
'defines': ['V8_ENABLE_FUTURE',],
}],
@ -240,6 +283,11 @@
# }],
['v8_use_snapshot==1', {
'defines': ['V8_USE_SNAPSHOT',],
'conditions': [
['v8_enable_snapshot_native_code_counters==1', {
'defines': ['V8_SNAPSHOT_NATIVE_CODE_COUNTERS',],
}],
],
}],
['v8_use_external_startup_data==1', {
'defines': ['V8_USE_EXTERNAL_STARTUP_DATA',],
@ -265,6 +313,12 @@
['v8_untrusted_code_mitigations==0', {
'defines': ['DISABLE_UNTRUSTED_CODE_MITIGATIONS',],
}],
['v8_use_perfetto==1', {
'defines': ['V8_USE_PERFETTO',],
}],
['v8_win64_unwinding_info==1', {
'defines': ['V8_WIN64_UNWINDING_INFO',],
}],
], # conditions
'defines': [
'V8_GYP_BUILD',

View File

@ -135,6 +135,8 @@
# Indicates if gcmole tools are downloaded by a hook.
'gcmole%': 0,
},
# [GYP] this needs to be outside of the top level 'variables'
'conditions': [
['host_arch=="ia32" or host_arch=="x64" or \
host_arch=="ppc" or host_arch=="ppc64" or \
@ -166,6 +168,12 @@
'<(V8_ROOT)/include',
],
'conditions': [
['clang', {
'cflags': [ '-Werror', '-Wno-unknown-pragmas' ],
},{
'cflags!': [ '-Wall', '-Wextra' ],
'cflags': [ '-Wno-return-type' ],
}],
['v8_target_arch=="arm"', {
'defines': [
'V8_TARGET_ARCH_ARM',
@ -1089,7 +1097,7 @@
}],
],
}],
['_toolset=="target"', {
['_toolset=="target"', {
'conditions': [
['target_cxx_is_biarch==1', {
'cflags': [ '-m64' ],
@ -1398,24 +1406,20 @@
], # conditions
}, # Release
}, # configurations
'cflags!': [ '-Wall', '-Wextra' ],
'msvs_disabled_warnings': [
4129, # unrecognized character escape sequence (torque-generated)
4245, # Conversion with signed/unsigned mismatch.
4267, # Conversion with possible loss of data.
4324, # Padding structure due to alignment.
4351,
4355,
# 4351, # [refack] Old issue with array init.
4355, # 'this' used in base member initializer list
4661, # no suitable definition provided for explicit template instantiation request
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.
# 4714, # Function marked forceinline not inlined.
4715, # Not all control paths return a value. (see https://crbug.com/v8/7658)
4718, # Recursive call has no side-effect.
4723, # https://crbug.com/v8/7771
4724, # https://crbug.com/v8/7771

File diff suppressed because it is too large Load Diff