From 9dbb5586b52206d63b60fdec8ff13c6263809fb6 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Mon, 5 Oct 2015 19:28:48 +0000 Subject: [PATCH] [libcxx] Reexport std::bad_array_length symbols from libc++abi on OS X. Summary: On OS X libc++ needs to reexport libc++abi's symbols in order for them to be provided. We explicitly list the symbols to reexport it libcxx/lib/libc++abi2.exp. This patch adds the symbols required by std::bad_array_length which have been missing for some time. However there is a problem. std::bad_array_length was add to libc++abi in September of 2013 by commit r190479, about a year after everything else. Therefore I think older OS X version have libc++abi versions without std::bad_array_length. On those systems libc++ won't build with this change because we will try and export undefined symbols. The workaround I would write to support older systems depends on the amount of people who would need it. If only a small number of developers are affected it might be sufficient to provide a CMake switch like `LIBCPP_LIBCPPABI_HAS_BAD_ARRAY_LENGTH` which is ON by default and can be disabled by those who need it. Otherwise I think we should try to automatically detect if the symbols are present in `/usr/lib/libc++abi.dylib` and configure accordingly. I would prefer the first solution because writing CMake sucks. Reviewers: mclow.lists, aprantl Subscribers: aprantl, cfe-commits Differential Revision: http://reviews.llvm.org/D13445 llvm-svn: 249339 --- libcxx/lib/CMakeLists.txt | 2 +- libcxx/lib/libc++abi2.exp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libcxx/lib/CMakeLists.txt b/libcxx/lib/CMakeLists.txt index 8be050b326d2..28049b5b5ab8 100644 --- a/libcxx/lib/CMakeLists.txt +++ b/libcxx/lib/CMakeLists.txt @@ -107,7 +107,7 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib") endif() else() - set (OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp") + set(OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp") endif() add_link_flags( diff --git a/libcxx/lib/libc++abi2.exp b/libcxx/lib/libc++abi2.exp index bdfe99c3456e..47dcbbb88fcd 100644 --- a/libcxx/lib/libc++abi2.exp +++ b/libcxx/lib/libc++abi2.exp @@ -290,6 +290,16 @@ __ZTISt16invalid_argument __ZTSSt16invalid_argument __ZTVSt16invalid_argument +__ZNKSt16bad_array_length4whatEv +__ZNSt16bad_array_lengthC1Ev +__ZNSt16bad_array_lengthC2Ev +__ZNSt16bad_array_lengthD0Ev +__ZNSt16bad_array_lengthD1Ev +__ZNSt16bad_array_lengthD2Ev +__ZTISt16bad_array_length +__ZTSSt16bad_array_length +__ZTVSt16bad_array_length + __ZTSDi __ZTSDn __ZTSDs