Skip to content

Commit 970f133

Browse files
committed
build: build v8 with -fvisibility=hidden
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. On Linux the size reduction is around 8MB.
1 parent 938a581 commit 970f133

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/v8_gypfiles/v8.gyp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
'AdditionalOptions': ['/utf-8']
4242
}
4343
},
44+
'cflags': ['-fvisibility=hidden'],
45+
'xcode_settings': {
46+
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
47+
},
4448
},
4549
'targets': [
4650
{

0 commit comments

Comments
 (0)