Skip to content

Commit 519a3e9

Browse files
committed
deps: OpenSSL: OpenSSL 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. Fixes: #27925 Refs: #21848 (comment)
1 parent d911789 commit 519a3e9

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
@@ -477,6 +477,18 @@
477477
'-Wl,--export-dynamic',
478478
],
479479
}],
480+
# if node is built as an executable,
481+
# the openssl mechanism for keeping itself "dload"-ed to ensure proper
482+
# atexit cleanup does not apply
483+
['node_shared_openssl!="true" and node_shared!="true"', {
484+
'defines': [
485+
# `OPENSSL_NO_PINSHARED` prevents openssl from dload
486+
# current node executable,
487+
# see https://github.com/nodejs/node/pull/21848
488+
# or https://github.com/nodejs/node/issues/27925
489+
'OPENSSL_NO_PINSHARED'
490+
],
491+
}],
480492
['node_shared_openssl!="true"', {
481493
# `OPENSSL_THREADS` is defined via GYP for openSSL for all architectures.
482494
'defines': [

0 commit comments

Comments
 (0)