Skip to content

Commit

Permalink
deps: dlloads node static linked executable
Browse files Browse the repository at this point in the history
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: nodejs#21848 (comment)
PR-URL: nodejs#28045
Fixes: nodejs#27925
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
lal12 authored and Trott committed Jul 30, 2019
1 parent 99879ca commit 1567461
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions common.gypi
Expand Up @@ -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': [
Expand Down

0 comments on commit 1567461

Please sign in to comment.