Skip to content
This repository was archived by the owner on May 2, 2023. It is now read-only.

Commit 417c18e

Browse files
committed
build,v8: sync V8 gypfiles with 7.5
Co-authored-by: Ujjwal Sharma <[email protected]> Co-authored-by: Michaël Zasso <[email protected]> PR-URL: nodejs#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]>
1 parent e3cd79e commit 417c18e

File tree

8 files changed

+1499
-965
lines changed

8 files changed

+1499
-965
lines changed

common.gypi

+21-26
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
# https://github.com/nodejs/node/pull/22920/files#r222779926
7171
'v8_enable_fast_mksnapshot': 0,
7272

73+
'v8_win64_unwinding_info': 0,
74+
75+
# TODO(refack): make v8-perfetto happen
76+
'v8_use_perfetto': 0,
77+
7378
##### end V8 defaults #####
7479

7580
'conditions': [
@@ -81,23 +86,23 @@
8186
}],
8287
['GENERATOR=="ninja"', {
8388
'obj_dir': '<(PRODUCT_DIR)/obj',
84-
'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_base.a',
89+
'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_snapshot.a',
8590
}, {
8691
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
87-
'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_base.a',
92+
'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a',
8893
}],
8994
['OS == "win"', {
9095
'os_posix': 0,
9196
'v8_postmortem_support%': 0,
9297
'obj_dir': '<(PRODUCT_DIR)/obj',
93-
'v8_base': '<(PRODUCT_DIR)/lib/v8_libbase.lib',
98+
'v8_base': '<(PRODUCT_DIR)/lib/libv8_snapshot.a',
9499
}, {
95100
'os_posix': 1,
96101
'v8_postmortem_support%': 1,
97102
}],
98103
['OS == "mac"', {
99104
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
100-
'v8_base': '<(PRODUCT_DIR)/libv8_base.a',
105+
'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a',
101106
}],
102107
['openssl_fips != ""', {
103108
'openssl_product': '<(STATIC_LIB_PREFIX)crypto<(STATIC_LIB_SUFFIX)',
@@ -225,39 +230,29 @@
225230
'msvs_settings': {
226231
'VCCLCompilerTool': {
227232
'BufferSecurityCheck': 'true',
228-
'DebugInformationFormat': 1, # /Z7 embed info in .obj files
229-
'ExceptionHandling': 0, # /EHsc
233+
'DebugInformationFormat': 1, # /Z7 embed info in .obj files
234+
'ExceptionHandling': 0, # /EHsc
230235
'MultiProcessorCompilation': 'true',
231-
'StringPooling': 'true', # pool string literals
236+
'StringPooling': 'true', # pool string literals
232237
'SuppressStartupBanner': 'true',
233238
'WarnAsError': 'false',
234-
'WarningLevel': 3, # /W3
239+
'WarningLevel': 3, # /W3
235240
},
236241
'VCLinkerTool': {
242+
'target_conditions': [
243+
['_type=="executable"', {
244+
'SubSystem': 1, # /SUBSYSTEM:CONSOLE
245+
}],
246+
],
237247
'conditions': [
238248
['target_arch=="ia32"', {
239-
'TargetMachine' : 1, # /MACHINE:X86
240-
'target_conditions': [
241-
['_type=="executable"', {
242-
'AdditionalOptions': [ '/SubSystem:Console,"5.01"' ],
243-
}],
244-
],
249+
'TargetMachine' : 1, # /MACHINE:X86
245250
}],
246251
['target_arch=="x64"', {
247-
'TargetMachine' : 17, # /MACHINE:AMD64
248-
'target_conditions': [
249-
['_type=="executable"', {
250-
'AdditionalOptions': [ '/SubSystem:Console,"5.02"' ],
251-
}],
252-
],
252+
'TargetMachine' : 17, # /MACHINE:X64
253253
}],
254254
['target_arch=="arm64"', {
255-
'TargetMachine' : 0, # /MACHINE:ARM64 is inferred from the input files.
256-
'target_conditions': [
257-
['_type=="executable"', {
258-
'AdditionalOptions': [ '/SubSystem:Console' ],
259-
}],
260-
],
255+
'TargetMachine' : 0, # NotSet. MACHINE:ARM64 is inferred from the input files.
261256
}],
262257
],
263258
'GenerateDebugInformation': 'true',

configure.py

+8
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,13 @@ def b(value):
615615
else:
616616
return 'false'
617617

618+
def B(value):
619+
"""Returns 1 if value is truthy, 0 otherwise."""
620+
if value:
621+
return 1
622+
else:
623+
return 0
624+
618625

619626
def pkg_config(pkg):
620627
"""Run pkg-config on the specified package
@@ -1594,6 +1601,7 @@ def make_bin_override():
15941601
# move everything else to target_defaults
15951602
variables = output['variables']
15961603
del output['variables']
1604+
variables['is_debug'] = B(options.debug)
15971605

15981606
# make_global_settings for special FIPS linking
15991607
# should not be used to compile modules in node-gyp

node.gyp

+33-29
Original file line numberDiff line numberDiff line change
@@ -344,22 +344,24 @@
344344
[ 'node_intermediate_lib_type=="static_library" and node_shared=="false"', {
345345
'xcode_settings': {
346346
'OTHER_LDFLAGS': [
347-
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)'
348-
'<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
347+
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
348+
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)',
349349
],
350350
},
351351
'msvs_settings': {
352352
'VCLinkerTool': {
353353
'AdditionalOptions': [
354354
'/WHOLEARCHIVE:<(node_lib_target_name)<(STATIC_LIB_SUFFIX)',
355+
'/WHOLEARCHIVE:<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)',
355356
],
356357
},
357358
},
358359
'conditions': [
359-
['OS!="aix"', {
360+
['OS != "aix" and OS != "mac"', {
360361
'ldflags': [
361-
'-Wl,--whole-archive,<(obj_dir)/<(STATIC_LIB_PREFIX)'
362-
'<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
362+
'-Wl,--whole-archive',
363+
'<(obj_dir)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
364+
'<(obj_dir)/tools/v8_gypfiles/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)',
363365
'-Wl,--no-whole-archive',
364366
],
365367
}],
@@ -386,10 +388,12 @@
386388
'NODE_ARCH="<(target_arch)"',
387389
'NODE_PLATFORM="<(OS)"',
388390
],
389-
'conditions': [
390-
['OS=="win"', {
391-
'libraries': [ 'Ws2_32' ],
392-
}],
391+
}],
392+
['OS=="win"', {
393+
'libraries': [
394+
'Dbghelp.lib',
395+
'winmm.lib',
396+
'Ws2_32.lib',
393397
],
394398
}],
395399
['node_with_ltcg=="true"', {
@@ -986,7 +990,7 @@
986990
{
987991
'action_name': 'node_dtrace_ustack_constants',
988992
'inputs': [
989-
'<(v8_base)'
993+
'<(obj_dir)/tools/v8_gypfiles/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)'
990994
],
991995
'outputs': [
992996
'<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
@@ -1140,8 +1144,16 @@
11401144
}],
11411145
],
11421146
}],
1147+
['OS=="win"', {
1148+
'libraries': [
1149+
'Dbghelp.lib',
1150+
'winmm.lib',
1151+
'Ws2_32.lib',
1152+
],
1153+
}],
11431154
],
11441155
}, # cctest
1156+
11451157
# TODO(joyeecheung): do not depend on node_lib,
11461158
# instead create a smaller static library node_lib_base that does
11471159
# just enough for node_native_module.cc and the cache builder to
@@ -1181,20 +1193,12 @@
11811193
],
11821194

11831195
'conditions': [
1184-
[ 'node_report=="true"', {
1185-
'conditions': [
1186-
['OS=="win"', {
1187-
'libraries': [
1188-
'dbghelp.lib',
1189-
'PsApi.lib',
1190-
'Ws2_32.lib',
1191-
],
1192-
'dll_files': [
1193-
'dbghelp.dll',
1194-
'PsApi.dll',
1195-
'Ws2_32.dll',
1196-
],
1197-
}],
1196+
['OS=="win"', {
1197+
'libraries': [
1198+
'dbghelp.lib',
1199+
'PsApi.lib',
1200+
'winmm.lib',
1201+
'Ws2_32.lib',
11981202
],
11991203
}],
12001204
],
@@ -1231,11 +1235,11 @@
12311235
],
12321236

12331237
'conditions': [
1234-
[ 'node_report=="true"', {
1235-
'conditions': [
1236-
['OS=="win"', {
1237-
'libraries': [ 'Ws2_32' ],
1238-
}],
1238+
['OS=="win"', {
1239+
'libraries': [
1240+
'Dbghelp.lib',
1241+
'winmm.lib',
1242+
'Ws2_32.lib',
12391243
],
12401244
}],
12411245
],

node.gypi

+17-17
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
}],
7171
[ 'node_use_bundled_v8=="true"', {
7272
'dependencies': [
73-
'tools/v8_gypfiles/v8.gyp:v8',
73+
'tools/v8_gypfiles/v8.gyp:v8_snapshot',
7474
'tools/v8_gypfiles/v8.gyp:v8_libplatform',
7575
],
7676
}],
@@ -116,21 +116,13 @@
116116
[ 'node_no_browser_globals=="true"', {
117117
'defines': [ 'NODE_NO_BROWSER_GLOBALS' ],
118118
} ],
119-
[ 'node_use_bundled_v8=="true" and v8_postmortem_support==1 and force_load=="true"', {
120-
'xcode_settings': {
121-
'OTHER_LDFLAGS': [
122-
'-Wl,-force_load,<(v8_base)',
123-
],
124-
},
125-
}],
126119
[ 'node_shared_zlib=="false"', {
127120
'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
128121
'conditions': [
129122
[ 'force_load=="true"', {
130123
'xcode_settings': {
131124
'OTHER_LDFLAGS': [
132-
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)'
133-
'zlib<(STATIC_LIB_SUFFIX)',
125+
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)zlib<(STATIC_LIB_SUFFIX)',
134126
],
135127
},
136128
'msvs_settings': {
@@ -143,7 +135,7 @@
143135
'conditions': [
144136
['OS!="aix" and node_shared=="false"', {
145137
'ldflags': [
146-
'-Wl,--whole-archive,'
138+
'-Wl,--whole-archive',
147139
'<(obj_dir)/deps/zlib/<(STATIC_LIB_PREFIX)zlib<(STATIC_LIB_SUFFIX)',
148140
'-Wl,--no-whole-archive',
149141
],
@@ -170,8 +162,7 @@
170162
[ 'force_load=="true"', {
171163
'xcode_settings': {
172164
'OTHER_LDFLAGS': [
173-
'-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)'
174-
'uv<(STATIC_LIB_SUFFIX)',
165+
'-Wl,-force_load,<(PRODUCT_DIR)/libuv<(STATIC_LIB_SUFFIX)',
175166
],
176167
},
177168
'msvs_settings': {
@@ -184,7 +175,7 @@
184175
'conditions': [
185176
['OS!="aix" and node_shared=="false"', {
186177
'ldflags': [
187-
'-Wl,--whole-archive,'
178+
'-Wl,--whole-archive',
188179
'<(obj_dir)/deps/uv/<(STATIC_LIB_PREFIX)uv<(STATIC_LIB_SUFFIX)',
189180
'-Wl,--no-whole-archive',
190181
],
@@ -269,9 +260,18 @@
269260
}],
270261
[ '(OS=="freebsd" or OS=="linux") and node_shared=="false"'
271262
' and force_load=="true"', {
272-
'ldflags': [ '-Wl,-z,noexecstack',
273-
'-Wl,--whole-archive <(v8_base)',
274-
'-Wl,--no-whole-archive' ]
263+
'ldflags': [
264+
'-Wl,-z,noexecstack',
265+
'-Wl,--whole-archive <(v8_base)',
266+
'-Wl,--no-whole-archive',
267+
]
268+
}],
269+
[ 'node_use_bundled_v8=="true" and v8_postmortem_support==1 and force_load=="true"', {
270+
'xcode_settings': {
271+
'OTHER_LDFLAGS': [
272+
'-Wl,-force_load,<(v8_base)',
273+
],
274+
},
275275
}],
276276
[ 'coverage=="true" and node_shared=="false" and OS in "mac freebsd linux"', {
277277
'cflags!': [ '-O3' ],

tools/msvs/pch/v8_pch.h

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
#include "src/api-inl.h"
2+
#include "src/ast/ast.h"
3+
#include "src/builtins/builtins-definitions.h"
4+
#include "src/code-stub-assembler.h"
5+
#include "src/globals.h"
26
#include "src/objects-inl.h"
7+
#include "src/objects/dictionary-inl.h"
8+
#include "src/objects/js-objects-inl.h"
9+
#include "src/objects/fixed-array-inl.h"
310
#include "src/utils.h"
11+
#include "src/vector.h"
12+
13+
14+
#include <algorithm>
15+
#include <cstring>
16+
#include <iterator>
17+
#include <iosfwd>
18+
#include <memory>
19+
#include <string>

0 commit comments

Comments
 (0)