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 1cc8d69

Browse filesBrowse files
joyeecheungmarco-ippolito
authored andcommitted
build: build v8 with -fvisibility=hidden on macOS
V8 should be built with -fvisibility=hidden, otherwise the resulting binary would contain unnecessary symbols. In particular, on macOS, this leads to 5000+ weak symbols resolved at runtime, leading to a startup regression. On macOS this also reduces the binary size about ~10MB. It's only enabled on macOS in this patch as gcc can time out or run out of memory on some machines in the CI with -fvisibility=hidden. PR-URL: #56275 Fixes: nodejs/performance#180 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
1 parent 4d72412 commit 1cc8d69
Copy full SHA for 1cc8d69

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

‎tools/v8_gypfiles/v8.gyp‎

Copy file name to clipboardExpand all lines: tools/v8_gypfiles/v8.gyp
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@
4141
'AdditionalOptions': ['/utf-8']
4242
}
4343
},
44+
'conditions': [
45+
['OS=="mac"', {
46+
# Hide symbols that are not explicitly exported with V8_EXPORT.
47+
# TODO(joyeecheung): enable it on other platforms. Currently gcc times out
48+
# or run out of memory with -fvisibility=hidden on some machines in the CI.
49+
'xcode_settings': {
50+
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
51+
},
52+
'defines': [
53+
'BUILDING_V8_SHARED', # Make V8_EXPORT visible.
54+
],
55+
}],
56+
],
4457
},
4558
'targets': [
4659
{

0 commit comments

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