From 648766bccffa5e4712bddfd5b21297279ee62daf Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 26 Nov 2019 13:30:28 +0800 Subject: [PATCH] build: do not build mksnapshot and mkcodecache for --shared To build mkcodecache and mksnapshot (they are executables), we currently build libnode with unresolved symbols, then build the two exectuables with src/node_snapshot_stub.cc and src/node_code_cache_stub.cc. Each of them write a C++ file to disk when being run. We then use the generated C++ files & libnode (with unresolved symbols) to build the final Node executable. However, if libnode itself is the final product, then we should not build it with unresolved symbols. https://github.com/nodejs/node/pull/28897 added the two stubs for the libnode target when the --shared configure option is used, but it did not get rid of the actions to build and run mksnapshot and mkcodecache for --shared, so to get it working we also need a patch to make sure --shared imply --without-node-code-cache and --without-node-snapshot, until we actually fix the TODO so that mksnapshot and mkcodecache do not use the libnode that way. PR-URL: https://github.com/nodejs/node/pull/30647 Refs: https://github.com/nodejs/node/issues/28845 Reviewed-By: Ben Noordhuis Reviewed-By: Anna Henningsen Reviewed-By: David Carlier Reviewed-By: James M Snell --- configure.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py index 61708a4447d125..48624aba92bf19 100755 --- a/configure.py +++ b/configure.py @@ -981,13 +981,15 @@ def configure_node(o): o['variables']['want_separate_host_toolset'] = int(cross_compiling) if not options.without_node_snapshot: - o['variables']['node_use_node_snapshot'] = b(not cross_compiling) + o['variables']['node_use_node_snapshot'] = b( + not cross_compiling and not options.shared) else: o['variables']['node_use_node_snapshot'] = 'false' if not options.without_node_code_cache: # TODO(refack): fix this when implementing embedded code-cache when cross-compiling. - o['variables']['node_use_node_code_cache'] = b(not cross_compiling) + o['variables']['node_use_node_code_cache'] = b( + not cross_compiling and not options.shared) else: o['variables']['node_use_node_code_cache'] = 'false'