Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b2fb829

Browse filesBrowse files
committed
build: add --shared-lief configure flag
PR-URL: #61536 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 4a2e184 commit b2fb829
Copy full SHA for b2fb829

6 files changed

+48-2Lines changed: 48 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/test-shared.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/test-shared.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ jobs:
198198
--arg ccache '(import <nixpkgs> {}).sccache' \
199199
--arg devTools '[]' \
200200
--arg benchmarkTools '[]' \
201-
${{ endsWith(matrix.system, '-darwin') && '--arg withAmaro false --arg withSQLite false --arg extraConfigFlags ''["--without-inspector" "--without-node-options"]'' \' || '\' }}
201+
${{ endsWith(matrix.system, '-darwin') && '--arg withAmaro false --arg withLief false --arg withSQLite false --arg extraConfigFlags ''["--without-inspector" "--without-node-options"]'' \' || '\' }}
202202
--run '
203203
make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
204204
'
Collapse file

‎Makefile‎

Copy file name to clipboardExpand all lines: Makefile
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
12391239
$(RM) -r $(TARNAME)/deps/histogram
12401240
$(RM) -r $(TARNAME)/deps/icu-small
12411241
$(RM) -r $(TARNAME)/deps/icu-tmp
1242+
$(RM) -r $(TARNAME)/deps/LIEF
12421243
$(RM) -r $(TARNAME)/deps/llhttp
12431244
$(RM) -r $(TARNAME)/deps/nbytes
12441245
$(RM) -r $(TARNAME)/deps/nghttp2
Collapse file

‎configure.py‎

Copy file name to clipboardExpand all lines: configure.py
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,28 @@
357357
dest='shared_libuv_libpath',
358358
help='a directory to search for the shared libuv DLL')
359359

360+
shared_optgroup.add_argument('--shared-lief',
361+
action='store_true',
362+
dest='shared_lief',
363+
default=None,
364+
help='link to a shared lief DLL instead of static linking')
365+
366+
shared_optgroup.add_argument('--shared-lief-includes',
367+
action='store',
368+
dest='shared_lief_includes',
369+
help='directory containing lief header files')
370+
371+
shared_optgroup.add_argument('--shared-lief-libname',
372+
action='store',
373+
dest='shared_lief_libname',
374+
default='LIEF',
375+
help='alternative lib name to link to [default: %(default)s]')
376+
377+
shared_optgroup.add_argument('--shared-lief-libpath',
378+
action='store',
379+
dest='shared_lief_libpath',
380+
help='a directory to search for the shared lief DLL')
381+
360382
shared_optgroup.add_argument('--shared-nbytes',
361383
action='store_true',
362384
dest='shared_nbytes',
@@ -2038,6 +2060,14 @@ def without_ssl_error(option):
20382060

20392061
o['variables']['openssl_version'] = get_openssl_version(o)
20402062

2063+
def configure_lief(o):
2064+
if options.without_lief:
2065+
if options.shared_lief:
2066+
error('--without-lief is incompatible with --shared-lief')
2067+
return
2068+
2069+
configure_library('lief', o, pkgname='LIEF')
2070+
20412071
def configure_sqlite(o):
20422072
o['variables']['node_use_sqlite'] = b(not options.without_sqlite)
20432073
if options.without_sqlite:
@@ -2499,6 +2529,7 @@ def make_bin_override():
24992529
configure_library('nghttp2', output, pkgname='libnghttp2')
25002530
configure_library('nghttp3', output, pkgname='libnghttp3')
25012531
configure_library('ngtcp2', output, pkgname='libngtcp2')
2532+
configure_lief(output);
25022533
configure_sqlite(output);
25032534
configure_library('temporal_capi', output)
25042535
configure_library('uvwasi', output)
Collapse file

‎node.gyp‎

Copy file name to clipboardExpand all lines: node.gyp
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
'node_shared_hdr_histogram%': 'false',
1919
'node_shared_http_parser%': 'false',
2020
'node_shared_libuv%': 'false',
21+
'node_shared_lief%': 'false',
2122
'node_shared_nbytes%': 'false',
2223
'node_shared_nghttp2%': 'false',
2324
'node_shared_openssl%': 'false',
@@ -1000,10 +1001,13 @@
10001001
'deps/ncrypto/ncrypto.gyp:ncrypto',
10011002
],
10021003
}],
1003-
[ 'node_use_lief=="true"', {
1004+
[ 'node_use_lief=="true" and node_shared_lief=="false"', {
10041005
'defines': [ 'HAVE_LIEF=1' ],
10051006
'dependencies': [ 'deps/LIEF/lief.gyp:liblief' ],
10061007
}],
1008+
[ 'node_use_lief=="true" and node_shared_lief=="true"', {
1009+
'defines': [ 'HAVE_LIEF=1' ],
1010+
}],
10071011
[ 'node_use_sqlite=="true"', {
10081012
'sources': [
10091013
'<@(node_sqlite_sources)',
Collapse file

‎shell.nix‎

Copy file name to clipboardExpand all lines: shell.nix
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
# Build options
1313
icu ? pkgs.icu,
1414
withAmaro ? true,
15+
withLief ? true,
1516
withQuic ? false,
1617
withSQLite ? true,
1718
withSSL ? true,
1819
withTemporal ? false,
1920
sharedLibDeps ? import ./tools/nix/sharedLibDeps.nix {
2021
inherit
2122
pkgs
23+
withLief
2224
withQuic
2325
withSQLite
2426
withSSL
@@ -82,6 +84,7 @@ pkgs.mkShell {
8284
]
8385
++ extraConfigFlags
8486
++ pkgs.lib.optional (!withAmaro) "--without-amaro"
87+
++ pkgs.lib.optional (!withLief) "--without-lief"
8588
++ pkgs.lib.optional withQuic "--experimental-quic"
8689
++ pkgs.lib.optional (!withSQLite) "--without-sqlite"
8790
++ pkgs.lib.optional (!withSSL) "--without-ssl"
Collapse file

‎tools/nix/sharedLibDeps.nix‎

Copy file name to clipboardExpand all lines: tools/nix/sharedLibDeps.nix
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
pkgs ? import ./pkgs.nix { },
3+
withLief ? true,
34
withQuic ? false,
45
withSQLite ? true,
56
withSSL ? true,
@@ -32,6 +33,12 @@
3233
}
3334
}/pkgs/by-name/nb/nbytes/package.nix" { };
3435
}
36+
// (pkgs.lib.optionalAttrs withLief {
37+
lief = pkgs.callPackage (builtins.fetchurl {
38+
url = "https://github.com/NixOS/nixpkgs/raw/8368442cb2c52e6b7badf0467b454c461ffc981f/pkgs/by-name/li/lief/package.nix";
39+
sha256 = "0isxv5rw7m1x10k06rgwimmcbl6a1w18v8k6dqp60jr4i66lac08";
40+
}) { };
41+
})
3542
// (pkgs.lib.optionalAttrs withQuic {
3643
inherit (pkgs)
3744
nghttp3

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.