This commit is contained in:
Jesse Chan 2021-08-24 14:11:31 +08:00
parent d0e97881d6
commit 19ddcec2ba
3 changed files with 66 additions and 0 deletions

View File

@ -646,3 +646,25 @@ index 0000000000..fb2d47f52b
'cflags_cc!': [ '-fno-rtti' ],
}],
[ 'OS == "mac" or OS == "ios"', {
--- node/node.gyp
+++ node/node.gyp
@@ -236,6 +236,19 @@
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
},
}],
+ [ 'enable_lto=="true"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ # 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.
+ '-Wl,-export_dynamic',
+ ],
+ },
+ }],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',

View File

@ -523,3 +523,25 @@ index 0000000000..fb2d47f52b
'cflags_cc!': [ '-fno-rtti' ],
}],
[ 'OS == "mac" or OS == "ios"', {
--- node/node.gyp
+++ node/node.gyp
@@ -236,6 +236,19 @@
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
},
}],
+ [ 'enable_lto=="true"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ # 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.
+ '-Wl,-export_dynamic',
+ ],
+ },
+ }],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',

View File

@ -487,3 +487,25 @@ index 0000000000..fb2d47f52b
'cflags_cc!': [ '-fno-rtti' ],
}],
[ 'OS == "mac" or OS == "ios"', {
--- node/node.gyp
+++ node/node.gyp
@@ -236,6 +236,19 @@
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
},
}],
+ [ 'enable_lto=="true"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ # 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.
+ '-Wl,-export_dynamic',
+ ],
+ },
+ }],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',