From a3a31ee48a5a2ce431611d666ed98180581636c5 Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Thu, 3 Dec 2026 18:26:03 +0000 Subject: [PATCH] build: build abseil with -fvisibility=hidden The abseil target was split out of v8.gyp into abseil.gyp before v8.gyp started building with -fvisibility=hidden and -fvisibility-inlines-hidden, so it never picked up those flags. As a result, the node executable exports several hundred Abseil symbols. Abseil is an implementation detail of V8 and is not part of Node.js's public API. When exported, its symbols conflict with those of addons that link their own, ABI-incompatible copy of Abseil, which can crash the addon while it is being loaded. Apply the same visibility settings as v8.gyp to the abseil target. Fixes: https://github.com/nodejs/node/issues/67997 Refs: https://github.com/nodejs/node/pull/56290 Refs: https://github.com/nodejs/node/pull/57289 Signed-off-by: Antonio Maiorano --- tools/v8_gypfiles/abseil.gyp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/v8_gypfiles/abseil.gyp b/tools/v8_gypfiles/abseil.gyp index a478711527d0..9f562d2751e5 100644 --- a/tools/v8_gypfiles/abseil.gyp +++ b/tools/v8_gypfiles/abseil.gyp @@ -379,6 +379,19 @@ '<(ABSEIL_ROOT)/absl/time/internal/cctz/src/time_zone_name_win.cc', ], }], + ['OS=="mac"', { + 'xcode_settings': { + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden + 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES' # -fvisibility-inlines-hidden + }, + }, '(OS!="aix" and OS!="os400") and (OS!="win" or clang==1)', { + 'cflags': [ + '-fvisibility=hidden', + ], + 'cflags_cc': [ + '-fvisibility-inlines-hidden' + ], + }], # MSVC hides the non-public symbols by default so no need to configure it. ], }, # abseil ]