From b8c972d12d43363f53564bac47d461690c5a402f Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 16 Dec 2024 22:10:24 +0100 Subject: [PATCH] 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. --- tools/v8_gypfiles/v8.gyp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 9acad07d966a35..f1cdbe41718ba3 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -42,6 +42,9 @@ } }, }, + 'xcode_settings': { + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden + }, 'targets': [ { 'target_name': 'v8_pch',