Skip to content

Commit 8afd2ef

Browse files
committed
build: keep addon exports in the macOS binary
-Wl,-dead_strip on the Release executable removed napi_* and other globals that nothing in the executable calls. Addons resolve those symbols from the host, so doc-kit's lightningcss addon called a null pointer inside napi_register_module_v1 and macOS CI died with SIGSEGV while generating docs. -x and -S stay; they only drop local and debug symbols. Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com> Assisted-by: Grok
1 parent b094ea9 commit 8afd2ef

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎node.gyp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -661,16 +661,16 @@
661661
'WARNING_CFLAGS': [ '-Werror' ],
662662
},
663663
}],
664-
# The Release executable force-loads several static libraries, so
665-
# unreferenced objects and the symbol table dominate the file.
666-
# -dead_strip drops unreferenced .o files, -x drops local symbols,
667-
# and -S drops STABS. Debug keeps symbols.
664+
# The Release executable's local symbol table and STABS dominate
665+
# LINKEDIT. -x drops local symbols and -S drops STABS. Debug keeps
666+
# them. Do not pass -dead_strip: N-API and libuv symbols are reached
667+
# only from addons loaded at runtime, and dead-stripping removes
668+
# those exports from the executable.
668669
['OS=="mac" or OS=="ios"', {
669670
'configurations': {
670671
'Release': {
671672
'xcode_settings': {
672673
'OTHER_LDFLAGS': [
673-
'-Wl,-dead_strip',
674674
'-Wl,-x',
675675
'-Wl,-S',
676676
],

0 commit comments

Comments
 (0)