Skip to content

Commit 333963e

Browse files
lal12BethGriggs
authored andcommitted
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: #21848 (comment) Fixes: #29992 Backport-PR-URL: #30005 PR-URL: #28045 Fixes: #27925 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 85ce8ef commit 333963e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

common.gypi

+13-1
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,19 @@
521521
'ldflags': [
522522
'-Wl,--export-dynamic',
523523
],
524-
}]
524+
}],
525+
# if node is built as an executable,
526+
# the openssl mechanism for keeping itself "dload"-ed to ensure proper
527+
# atexit cleanup does not apply
528+
['node_shared_openssl!="true" and node_shared!="true"', {
529+
'defines': [
530+
# `OPENSSL_NO_PINSHARED` prevents openssl from dload
531+
# current node executable,
532+
# see https://github.com/nodejs/node/pull/21848
533+
# or https://github.com/nodejs/node/issues/27925
534+
'OPENSSL_NO_PINSHARED'
535+
],
536+
}],
525537
],
526538
}
527539
}

0 commit comments

Comments
 (0)