Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 22a78a7

Browse filesBrowse files
jesecrichardlau
authored andcommitted
build: preserves symbols during LTO with macOS linker
man ld -export_dynamic: ``` Preserves all global symbols in main executables during LTO. Without this option, Link Time Optimization is allowed to inline and remove global functions. This option is used when a main executable may load a plug-in which requires certain symbols from the main executable. ``` Bug: vercel/pkg#1155 Signed-off-by: Jesse Chan <jc@linux.com> PR-URL: #39839 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 97f3072 commit 22a78a7
Copy full SHA for 22a78a7

File tree

Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Open diff view settings
Collapse file

‎node.gyp‎

Copy file name to clipboardExpand all lines: node.gyp
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,19 @@
236236
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
237237
},
238238
}],
239+
[ 'enable_lto=="true"', {
240+
'xcode_settings': {
241+
'OTHER_LDFLAGS': [
242+
# man ld -export_dynamic:
243+
# Preserves all global symbols in main executables during LTO.
244+
# Without this option, Link Time Optimization is allowed to
245+
# inline and remove global functions. This option is used when
246+
# a main executable may load a plug-in which requires certain
247+
# symbols from the main executable.
248+
'-Wl,-export_dynamic',
249+
],
250+
},
251+
}],
239252
['OS=="win"', {
240253
'libraries': [
241254
'Dbghelp.lib',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.