Skip to content

[libc++] Always build the dylib with hidden visibility #131313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -522,13 +522,7 @@ function(cxx_add_basic_build_flags target)
# the dylib when get ODR used by another function.
target_add_compile_flags_if_supported(${target} PRIVATE -fvisibility-inlines-hidden)

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

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