diff --git a/common.gypi b/common.gypi index 634909c1ad4..c1752f823b2 100644 --- a/common.gypi +++ b/common.gypi @@ -496,6 +496,18 @@ '-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' + ], + }], ['node_shared_openssl!="true"', { # `OPENSSL_THREADS` is defined via GYP for openSSL for all architectures. 'defines': [