From e9fdfd868a0c19c6c3f33f7a946ad919f7426570 Mon Sep 17 00:00:00 2001 From: Ben Craig Date: Tue, 19 Apr 2016 12:47:38 +0000 Subject: [PATCH] Enable testing for static libc++abi This change leverages framework changes made in libcxx. See those changes for more details. (http://reviews.llvm.org/D16544) Some Mac specific logic for testing against libc++abi had to be moved from libcxxabi's config.py, as it was overriding choices made in libcxx's config.py. That logic is now in libcxx's target_info.py. http://reviews.llvm.org/D16545 llvm-svn: 266729 --- libcxxabi/test/CMakeLists.txt | 12 +++++++++++- libcxxabi/test/libcxxabi/test/config.py | 10 ---------- libcxxabi/test/lit.site.cfg.in | 2 ++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt index c61d4ad..aee9ffa 100644 --- a/libcxxabi/test/CMakeLists.txt +++ b/libcxxabi/test/CMakeLists.txt @@ -6,7 +6,12 @@ macro(pythonize_bool var) endif() endmacro() +if (NOT DEFINED LIBCXX_ENABLE_SHARED) + set(LIBCXX_ENABLE_SHARED ON) +endif() + pythonize_bool(LLVM_BUILD_32_BITS) +pythonize_bool(LIBCXX_ENABLE_SHARED) pythonize_bool(LIBCXXABI_ENABLE_SHARED) pythonize_bool(LIBCXXABI_ENABLE_THREADS) pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER) @@ -22,7 +27,12 @@ configure_file( ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg @ONLY) -set(LIBCXXABI_TEST_DEPS cxxabi_shared) +if (LIBCXXABI_ENABLE_SHARED) + set(LIBCXXABI_TEST_DEPS cxxabi_shared) +else() + set(LIBCXXABI_TEST_DEPS cxxabi_static) +endif() + if (NOT LIBCXXABI_BUILT_STANDALONE) list(APPEND LIBCXXABI_TEST_DEPS cxx) endif() diff --git a/libcxxabi/test/libcxxabi/test/config.py b/libcxxabi/test/libcxxabi/test/config.py index c167de5..766cdfa 100644 --- a/libcxxabi/test/libcxxabi/test/config.py +++ b/libcxxabi/test/libcxxabi/test/config.py @@ -68,13 +68,3 @@ class Configuration(LibcxxConfiguration): def configure_compile_flags_rtti(self): pass - - # TODO(ericwf): Remove this. This is a hack for OS X. - # libc++ *should* export all of the symbols found in libc++abi on OS X. - # For this reason LibcxxConfiguration will not link libc++abi in OS X. - # However __cxa_throw_bad_new_array_length doesn't get exported into libc++ - # yet so we still need to explicitly link libc++abi. - # See PR22654. - def configure_link_flags_abi_library(self): - self.cxx.link_flags += ['-lc++abi'] - diff --git a/libcxxabi/test/lit.site.cfg.in b/libcxxabi/test/lit.site.cfg.in index 1b6967f..7a58369 100644 --- a/libcxxabi/test/lit.site.cfg.in +++ b/libcxxabi/test/lit.site.cfg.in @@ -14,6 +14,8 @@ config.enable_32bit = "@LLVM_BUILD_32_BITS@" config.target_info = "@LIBCXXABI_TARGET_INFO@" config.executor = "@LIBCXXABI_EXECUTOR@" config.thread_atexit = "@LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL@" +config.libcxxabi_shared = "@LIBCXXABI_ENABLE_SHARED@" +config.enable_shared = "@LIBCXX_ENABLE_SHARED@" # Let the main config do the real work. lit_config.load_config(config, "@LIBCXXABI_SOURCE_DIR@/test/lit.cfg") -- 2.7.4