Skip to content

Commit 8736a8e

Browse files
committed
build: re-enable V8 snapshots
Snapshots had been previously disabled because of a security vunerability. This has been fixed (ref: #1631 (comment)) Also, re-enable snapshots for ARMv6 builds. There were previous build issues that have been fixed. Fixes: #1631 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent f07b3b6 commit 8736a8e

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

configure

+8-12
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ parser.add_option('--without-perfctr',
294294
dest='without_perfctr',
295295
help='build without performance counters')
296296

297+
# Dummy option for backwards compatibility
297298
parser.add_option('--with-snapshot',
298299
action='store_true',
299-
dest='with_snapshot',
300+
dest='unused_with_snapshot',
300301
help=optparse.SUPPRESS_HELP)
301302

302-
# Dummy option for backwards compatibility.
303303
parser.add_option('--without-snapshot',
304304
action='store_true',
305-
dest='unused_without_snapshot',
305+
dest='without_snapshot',
306306
help=optparse.SUPPRESS_HELP)
307307

308308
parser.add_option('--without-ssl',
@@ -579,10 +579,6 @@ def configure_arm(o):
579579
o['variables']['arm_fpu'] = 'vfpv3'
580580
o['variables']['arm_version'] = '7'
581581

582-
# Print warning when snapshot is enabled and building on armv6
583-
if is_arch_armv6() and options.with_snapshot:
584-
warn('when building on ARMv6, don\'t use --with-snapshot')
585-
586582

587583
def configure_mips(o):
588584
can_use_fpu_instructions = (options.mips_float_abi != 'soft')
@@ -604,10 +600,10 @@ def configure_node(o):
604600
o['variables']['host_arch'] = host_arch
605601
o['variables']['target_arch'] = target_arch
606602

607-
if target_arch != host_arch and options.with_snapshot:
608-
o['variables']['want_separate_host_toolset'] = 1
609-
else:
610-
o['variables']['want_separate_host_toolset'] = 0
603+
cross_compiling = target_arch != host_arch
604+
want_snapshots = not options.without_snapshot
605+
o['variables']['want_separate_host_toolset'] = int(
606+
cross_compiling and want_snapshots)
611607

612608
if target_arch == 'arm':
613609
configure_arm(o)
@@ -713,7 +709,7 @@ def configure_v8(o):
713709
o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs.
714710
o['variables']['v8_optimized_debug'] = 0 # Compile with -O0 in debug builds.
715711
o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables.
716-
o['variables']['v8_use_snapshot'] = b(options.with_snapshot)
712+
o['variables']['v8_use_snapshot'] = 0 if options.without_snapshot else 1
717713

718714
def configure_openssl(o):
719715
o['variables']['node_use_openssl'] = b(not options.without_ssl)

vcbuild.bat

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set snapshot_arg=
2121
set noprojgen=
2222
set nobuild=
2323
set nosign=
24-
set snapshot=
24+
set nosnapshot=
2525
set test_args=
2626
set msi=
2727
set licensertf=
@@ -47,7 +47,7 @@ if /i "%1"=="x64" set target_arch=x64&goto arg-ok
4747
if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
4848
if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
4949
if /i "%1"=="nosign" set nosign=1&goto arg-ok
50-
if /i "%1"=="snapshot" set snapshot=1&goto arg-ok
50+
if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
5151
if /i "%1"=="noetw" set noetw=1&goto arg-ok
5252
if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok
5353
if /i "%1"=="licensertf" set licensertf=1&goto arg-ok
@@ -76,7 +76,7 @@ goto next-arg
7676
:args-done
7777
if "%config%"=="Debug" set debug_arg=--debug
7878
if "%target_arch%"=="x64" set msiplatform=x64
79-
if defined snapshot set snapshot_arg=--with-snapshot
79+
if defined nosnapshot set snapshot_arg=--without-snapshot
8080
if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1
8181
if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1
8282

0 commit comments

Comments
 (0)