diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 9acad07d966a35..88c1297b9a09ec 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -41,6 +41,19 @@ 'AdditionalOptions': ['/utf-8'] } }, + '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 + }, + 'defines': [ + 'BUILDING_V8_SHARED', # Make V8_EXPORT visible. + ], + }], + ], }, 'targets': [ {