Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,19 @@
['clang==0 and OS!="win"', {
'cflags': [ '-Wno-restrict', ],
}],
# TODO(joyeecheung): investigate if it breaks addons.
# ['OS=="mac"', {
# 'xcode_settings': {
# 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
# 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES' # -fvisibility-inlines-hidden
# },
# }],
# ['OS!="win" or clang==1', {
# 'cflags': [
# '-fvisibility=hidden',
# '-fvisibility-inlines-hidden'
# ],
# }],
# Pointer authentication for ARM64.
['target_arch=="arm64"', {
'target_conditions': [
Expand Down
25 changes: 17 additions & 8 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,31 @@
}
},
'conditions': [
['OS=="mac"', {
# Hide symbols that are not explicitly exported with V8_EXPORT.
# TODO(joyeecheung): enable it on other platforms. Currently gcc times out
# or run out of memory with -fvisibility=hidden on some machines in the CI.
'xcode_settings': {
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
},
# Build with -fvisibility=hidden and -fvisibility-inlines-hidden to avoid
# including unnecessary internal symbols, which may lead to run-time fixups.
# This is not done on AIX where symbols are exported by tools/create_expfile.sh
# see https://github.com/nodejs/node/pull/56290#issuecomment-2582703109
['OS!="aix"', {
'defines': [
'BUILDING_V8_SHARED', # Make V8_EXPORT visible.
],
]
}],
['node_shared=="true"', {
'defines': [
'V8_TLS_USED_IN_LIBRARY', # Enable V8_TLS_LIBRARY_MODE.
],
}],
['OS=="mac"', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be moved up above the V8_TLS_USED_IN_LIBRARY? So that this can be closer to the comments above, which is less relevant with V8_TLS_USED_IN_LIBRARY.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind if I leave it to a follow-up PR? Trying to get the cache of it into the CI first instead of retrying for flakes and make the cache a mess in the CI...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged it to put the cache in, feel free to open another PR to move them closer

'xcode_settings': {
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES' # -fvisibility-inlines-hidden
},
}, 'OS!="aix" and (OS!="win" or clang==1)', {
'cflags': [
'-fvisibility=hidden',
'-fvisibility-inlines-hidden'
],
}], # MSVC hides the non-public symbols by default so no need to configure it.
],
},
'targets': [
Expand Down
Loading