diff options
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt index 5d9cc01d165..4f6e2b4aa62 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -349,7 +349,12 @@ if (LIBCXX_ENABLE_STATIC) if (LIBCXX_HERMETIC_STATIC_LIBRARY) append_flags_if_supported(CXX_STATIC_LIBRARY_FLAGS -fvisibility=hidden) - append_flags_if_supported(CXX_STATIC_LIBRARY_FLAGS -fvisibility-global-new-delete-hidden) + # If the hermetic library doesn't define the operator new/delete functions + # then its code shouldn't declare them with hidden visibility. They might + # actually be provided by a shared library at link time. + if (LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS) + append_flags_if_supported(CXX_STATIC_LIBRARY_FLAGS -fvisibility-global-new-delete-hidden) + endif() target_compile_options(cxx_static PRIVATE ${CXX_STATIC_LIBRARY_FLAGS}) target_compile_definitions(cxx_static PRIVATE _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) endif() |