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: #21848 (comment)
Fixes: #29992

Backport-PR-URL: #30005
PR-URL: #28045
Fixes: #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 BethGriggs committed Oct 17, 2019
1 parent 85ce8ef commit 333963e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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'
],
}],
],
}
}

0 comments on commit 333963e

Please sign in to comment.