Skip to content

Commit 77ca394

Browse files
committed
sea: add --build-sea to generate SEA directly with Node.js binary
Instead of relying on a WASM build of postject to perform the injection, add LIEF as dependency and generate the SEA directly from core via a new CLI option --build-sea which takes the SEA config. This simplifies SEA generation for users and makes it easier to debug/maintain the SEA building process.
1 parent 26bb243 commit 77ca394

File tree

13 files changed

+1230
-135
lines changed

13 files changed

+1230
-135
lines changed

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,8 @@ The externally maintained libraries used by Node.js are:
12281228
SOFTWARE.
12291229
"""
12301230

1231-
- postject, located at test/fixtures/postject-copy, is licensed as follows:
1231+
- postject, located at test/fixtures/postject-copy and used as a basis for
1232+
src/node_sea_bin.cc, is licensed as follows:
12321233
"""
12331234
Postject is licensed for use as follows:
12341235

configure.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,12 @@
835835
default=None,
836836
help='do not install the bundled Amaro (TypeScript utils)')
837837

838+
parser.add_argument('--without-lief',
839+
action='store_true',
840+
dest='without_lief',
841+
default=None,
842+
help='build without LIEF (Library for instrumenting executable formats)')
843+
838844
parser.add_argument('--without-npm',
839845
action='store_true',
840846
dest='without_npm',
@@ -1701,6 +1707,12 @@ def configure_node(o):
17011707
o['variables']['single_executable_application'] = b(not options.disable_single_executable_application)
17021708
if options.disable_single_executable_application:
17031709
o['defines'] += ['DISABLE_SINGLE_EXECUTABLE_APPLICATION']
1710+
o['variables']['node_use_lief'] = 'false'
1711+
else:
1712+
if (options.without_lief is not None):
1713+
o['variables']['node_use_lief'] = b(not options.without_lief)
1714+
else:
1715+
o['variables']['node_use_lief'] = 'true'
17041716

17051717
o['variables']['node_with_ltcg'] = b(options.with_ltcg)
17061718
if flavor != 'win' and options.with_ltcg:

0 commit comments

Comments
 (0)