diff options
author | Luca Lindhorst <info@lucalindhorst.de> | 2019-06-04 21:15:50 +0300 |
---|---|---|
committer | Beth Griggs <Bethany.Griggs@uk.ibm.com> | 2019-10-17 18:35:41 +0300 |
commit | 333963ef73794e94ee5815a1b6c280f48cf9ac4a (patch) | |
tree | 247e8d690df1753a75012c588209b277295a054a | |
parent | 85ce8ef19ab84ff57a1483f3af545b2336f111c1 (diff) |
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: https://github.com/nodejs/node/pull/21848#issuecomment-498396551
Fixes: https://github.com/nodejs/node/issues/29992
Backport-PR-URL: https://github.com/nodejs/node/pull/30005
PR-URL: https://github.com/nodejs/node/pull/28045
Fixes: https://github.com/nodejs/node/issues/27925
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
-rw-r--r-- | common.gypi | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/common.gypi b/common.gypi index 97fe1f9e92a..770f99955a2 100644 --- a/common.gypi +++ b/common.gypi @@ -521,7 +521,19 @@ 'ldflags': [ '-Wl,--export-dynamic', ], - }] + }], + # if node is built as an executable, + # the openssl mechanism for keeping itself "dload"-ed to ensure proper + # atexit cleanup does not apply + ['node_shared_openssl!="true" and node_shared!="true"', { + 'defines': [ + # `OPENSSL_NO_PINSHARED` prevents openssl from dload + # current node executable, + # see https://github.com/nodejs/node/pull/21848 + # or https://github.com/nodejs/node/issues/27925 + 'OPENSSL_NO_PINSHARED' + ], + }], ], } } |