Skip to content

Commit

Permalink
build,v8: sync V8 gypfiles with 7.5
Browse files Browse the repository at this point in the history
Co-authored-by: Ujjwal Sharma <[email protected]>
Co-authored-by: Michaël Zasso <[email protected]>

Backport-PR-URL: #28005
PR-URL: #27375
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
refack authored and targos committed Jun 4, 2019
1 parent 21bcfb6 commit 5101e4c
Show file tree
Hide file tree
Showing 8 changed files with 1,499 additions and 965 deletions.
47 changes: 21 additions & 26 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand All @@ -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)',
Expand Down Expand Up @@ -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',
Expand Down
8 changes: 8 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1594,6 +1601,7 @@ def make_bin_override():
# 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
Expand Down
62 changes: 33 additions & 29 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
}],
Expand All @@ -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"', {
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -1141,8 +1145,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
Expand Down Expand Up @@ -1182,20 +1194,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',
],
}],
],
Expand Down Expand Up @@ -1232,11 +1236,11 @@
],

'conditions': [
[ 'node_report=="true"', {
'conditions': [
['OS=="win"', {
'libraries': [ 'Ws2_32' ],
}],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',
'winmm.lib',
'Ws2_32.lib',
],
}],
],
Expand Down
34 changes: 17 additions & 17 deletions node.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
}],
Expand Down Expand Up @@ -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': {
Expand All @@ -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',
],
Expand All @@ -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': {
Expand All @@ -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',
],
Expand Down Expand Up @@ -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' ],
Expand Down
16 changes: 16 additions & 0 deletions tools/msvs/pch/v8_pch.h
Original file line number Diff line number Diff line change
@@ -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>
Loading

0 comments on commit 5101e4c

Please sign in to comment.