Skip to content

Commit 7334024

Browse files
authored
[libc++] Always build the dylib with hidden visibility (#131313)
The comment seems to be wrong by now. The only difference this makes for GCC is that there are fewer private symbols exported from the dylib, which can't ever be accessed by user code anyways.
1 parent fedac3b commit 7334024

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

libcxx/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -522,13 +522,7 @@ function(cxx_add_basic_build_flags target)
522522
# the dylib when get ODR used by another function.
523523
target_add_compile_flags_if_supported(${target} PRIVATE -fvisibility-inlines-hidden)
524524

525-
# Our visibility annotations are not quite right for non-Clang compilers,
526-
# so we end up not exporting all the symbols we should. In the future, we
527-
# can improve the situation by providing an explicit list of exported
528-
# symbols on all compilers.
529-
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
530-
target_add_compile_flags_if_supported(${target} PRIVATE -fvisibility=hidden)
531-
endif()
525+
target_add_compile_flags_if_supported(${target} PRIVATE -fvisibility=hidden)
532526

533527
# Build with -fsized-deallocation, which is default in recent versions of Clang.
534528
# TODO(LLVM 21): This can be dropped once we only support Clang >= 19.

0 commit comments

Comments
 (0)