Skip to content

Commit

Permalink
build: do not build mksnapshot and mkcodecache for --shared
Browse files Browse the repository at this point in the history
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.
#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: #30647
Refs: #28845
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
joyeecheung authored and BethGriggs committed Feb 6, 2020
1 parent 30096ef commit ca432d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions configure.py
Expand Up @@ -979,13 +979,14 @@ def configure_node(o):

if not options.without_node_snapshot:
o['variables']['node_use_node_snapshot'] = b(
not cross_compiling and want_snapshots)
not cross_compiling and want_snapshots 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'

Expand Down

0 comments on commit ca432d7

Please sign in to comment.