Skip to content

Commit 1567461

Browse files
lal12Trott
authored andcommitted
deps: dlloads node static linked executable
OpenSSL dlloads itself to prevent unloading, in case it might be dynamically loaded. However when linked statically this will lead to dloading the main executable. Refs: #21848 (comment) PR-URL: #28045 Fixes: #27925 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 99879ca commit 1567461

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

common.gypi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,18 @@
496496
'-Wl,--export-dynamic',
497497
],
498498
}],
499+
# if node is built as an executable,
500+
# the openssl mechanism for keeping itself "dload"-ed to ensure proper
501+
# atexit cleanup does not apply
502+
['node_shared_openssl!="true" and node_shared!="true"', {
503+
'defines': [
504+
# `OPENSSL_NO_PINSHARED` prevents openssl from dload
505+
# current node executable,
506+
# see https://github.com/nodejs/node/pull/21848
507+
# or https://github.com/nodejs/node/issues/27925
508+
'OPENSSL_NO_PINSHARED'
509+
],
510+
}],
499511
['node_shared_openssl!="true"', {
500512
# `OPENSSL_THREADS` is defined via GYP for openSSL for all architectures.
501513
'defines': [

0 commit comments

Comments
 (0)