aboutsummaryrefslogtreecommitdiffstats
path: root/main/nodejs/disable-v8-snapshots.patch
blob: 05315cb05ab75e5bc85ad374fb8014550ddf4b80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From: Ali Ijaz Sheikh <ofrobots@google.com>
Date: Thu, 1 Jun 2017 17:55:42 -0700
Subject: [PATCH] build: disable V8 snapshots

PR-URL: https://github.com/nodejs/node-private/pull/84
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>

Patch-Source: https://github.com/nodejs/node/commit/86c0eae524
See: https://nodejs.org/en/blog/vulnerability/july-2017-security-releases/

--- a/configure
+++ b/configure
@@ -394,12 +394,12 @@
 # Dummy option for backwards compatibility
 parser.add_option('--with-snapshot',
     action='store_true',
-    dest='unused_with_snapshot',
+    dest='with_snapshot',
     help=optparse.SUPPRESS_HELP)
 
 parser.add_option('--without-snapshot',
     action='store_true',
-    dest='without_snapshot',
+    dest='unused_without_snapshot',
     help=optparse.SUPPRESS_HELP)
 
 parser.add_option('--without-ssl',
@@ -766,7 +766,7 @@
   o['variables']['node_byteorder'] = sys.byteorder
 
   cross_compiling = target_arch != host_arch
-  want_snapshots = not options.without_snapshot
+  want_snapshots = 1 if options.with_snapshot else 0
   o['variables']['want_separate_host_toolset'] = int(
       cross_compiling and want_snapshots)
 
@@ -911,7 +911,7 @@
   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'] = 'false' if options.without_snapshot else 'true'
+  o['variables']['v8_use_snapshot'] = b(options.with_snapshot)
   o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)
   o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8)
   o['variables']['force_dynamic_crt'] = 1 if options.shared else 0