Skip to content

Commit

Permalink
build: re-enable V8 snapshots
Browse files Browse the repository at this point in the history
Snapshots had been previously disabled because of a security
vunerability. This has been fixed (ref:
nodejs#1631 (comment))

Also, re-enable snapshots for ARMv6 builds. There were previous build
issues that have been fixed.

Fixes: nodejs#1631
PR-URL: nodejs#1663
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
trevnorris committed May 11, 2015
1 parent f07b3b6 commit 36cdc7c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
20 changes: 8 additions & 12 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,15 @@ parser.add_option('--without-perfctr',
dest='without_perfctr',
help='build without performance counters')

# Dummy option for backwards compatibility
parser.add_option('--with-snapshot',
action='store_true',
dest='with_snapshot',
dest='unused_with_snapshot',
help=optparse.SUPPRESS_HELP)

# Dummy option for backwards compatibility.
parser.add_option('--without-snapshot',
action='store_true',
dest='unused_without_snapshot',
dest='without_snapshot',
help=optparse.SUPPRESS_HELP)

parser.add_option('--without-ssl',
Expand Down Expand Up @@ -579,10 +579,6 @@ def configure_arm(o):
o['variables']['arm_fpu'] = 'vfpv3'
o['variables']['arm_version'] = '7'

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


def configure_mips(o):
can_use_fpu_instructions = (options.mips_float_abi != 'soft')
Expand All @@ -604,10 +600,10 @@ def configure_node(o):
o['variables']['host_arch'] = host_arch
o['variables']['target_arch'] = target_arch

if target_arch != host_arch and options.with_snapshot:
o['variables']['want_separate_host_toolset'] = 1
else:
o['variables']['want_separate_host_toolset'] = 0
cross_compiling = target_arch != host_arch
want_snapshots = not options.without_snapshot
o['variables']['want_separate_host_toolset'] = int(
cross_compiling and want_snapshots)

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

def configure_openssl(o):
o['variables']['node_use_openssl'] = b(not options.without_ssl)
Expand Down
6 changes: 3 additions & 3 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set snapshot_arg=
set noprojgen=
set nobuild=
set nosign=
set snapshot=
set nosnapshot=
set test_args=
set msi=
set licensertf=
Expand All @@ -47,7 +47,7 @@ if /i "%1"=="x64" set target_arch=x64&goto arg-ok
if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
if /i "%1"=="nosign" set nosign=1&goto arg-ok
if /i "%1"=="snapshot" set snapshot=1&goto arg-ok
if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
if /i "%1"=="noetw" set noetw=1&goto arg-ok
if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok
if /i "%1"=="licensertf" set licensertf=1&goto arg-ok
Expand Down Expand Up @@ -76,7 +76,7 @@ goto next-arg
:args-done
if "%config%"=="Debug" set debug_arg=--debug
if "%target_arch%"=="x64" set msiplatform=x64
if defined snapshot set snapshot_arg=--with-snapshot
if defined nosnapshot set snapshot_arg=--without-snapshot
if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1
if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1

Expand Down

0 comments on commit 36cdc7c

Please sign in to comment.