Skip to content

Commit 9b02f36

Browse files
lal12targos
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 b282c85 commit 9b02f36

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

common.gypi

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

0 commit comments

Comments
 (0)