diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-03-16 10:30:22 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-03-16 10:32:50 +0100 |
commit | f05b02c57d0282b587d4a9b3d8ac7c00d0efc075 (patch) | |
tree | 0c5796ed7dd8c21c48301a5c035a61ad2b3e67fc /sys-libs/llvm-libunwind/llvm-libunwind-6.0.9999.ebuild | |
parent | sys-libs/libcxxabi: Move built libc++ instead of copying it (tests) (diff) | |
download | gentoo-f05b02c57d0282b587d4a9b3d8ac7c00d0efc075.tar.gz gentoo-f05b02c57d0282b587d4a9b3d8ac7c00d0efc075.tar.bz2 gentoo-f05b02c57d0282b587d4a9b3d8ac7c00d0efc075.zip |
sys-libs/llvm-libunwind: Build local copy of libcxx for tests
Build a local copy of libcxx+libcxxabi for tests. This avoids a circular
dependency between llvm-libunwind and libcxx/libcxxabi, and also makes
it possible to run tests while building libcxx/libcxxabi against
different backends.
Diffstat (limited to 'sys-libs/llvm-libunwind/llvm-libunwind-6.0.9999.ebuild')
-rw-r--r-- | sys-libs/llvm-libunwind/llvm-libunwind-6.0.9999.ebuild | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-6.0.9999.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-6.0.9999.ebuild index 367803c62f09..303cfec21c9c 100644 --- a/sys-libs/llvm-libunwind/llvm-libunwind-6.0.9999.ebuild +++ b/sys-libs/llvm-libunwind/llvm-libunwind-6.0.9999.ebuild @@ -24,13 +24,9 @@ RESTRICT="!test? ( test )" RDEPEND="!sys-libs/libunwind" # llvm-6 for new lit options -# tests need libcxx with implicit -lunwind and libcxxabi -# (but libcxx does not need to be built against it) DEPEND=" >=sys-devel/llvm-6 test? ( >=sys-devel/clang-3.9.0 - sys-libs/libcxx[libunwind,${MULTILIB_USEDEP}] - sys-libs/libcxxabi[${MULTILIB_USEDEP}] $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )" # least intrusive of all @@ -45,16 +41,19 @@ pkg_setup() { } src_unpack() { - # we need headers & test utilities if use test; then git-r3_fetch "https://git.llvm.org/git/libcxx.git https://github.com/llvm-mirror/libcxx.git" + git-r3_fetch "https://git.llvm.org/git/libcxxabi.git + https://github.com/llvm-mirror/libcxxabi.git" fi git-r3_fetch if use test; then git-r3_checkout https://llvm.org/git/libcxx.git \ - "${WORKDIR}"/libcxx '' include utils/libcxx + "${WORKDIR}"/libcxx + git-r3_checkout https://llvm.org/git/libcxxabi.git \ + "${WORKDIR}"/libcxxabi fi git-r3_checkout } @@ -88,7 +87,54 @@ multilib_src_configure() { cmake-utils_src_configure } +build_libcxxabi() { + local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/$(get_libdir)" + local CMAKE_USE_DIR=${WORKDIR}/libcxxabi + local BUILD_DIR=${BUILD_DIR}/libcxxabi + local mycmakeargs=( + -DLIBCXXABI_LIBDIR_SUFFIX= + -DLIBCXXABI_ENABLE_SHARED=ON + -DLIBCXXABI_ENABLE_STATIC=OFF + -DLIBCXXABI_USE_LLVM_UNWINDER=ON + -DLIBCXXABI_INCLUDE_TESTS=OFF + + -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx/include + -DLIBCXXABI_LIBUNWIND_INCLUDES="${S}"/include + ) + + cmake-utils_src_configure + cmake-utils_src_compile +} + +build_libcxx() { + local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/libcxxabi/lib -L${BUILD_DIR}/$(get_libdir)" + local CMAKE_USE_DIR=${WORKDIR}/libcxx + local BUILD_DIR=${BUILD_DIR}/libcxx + local mycmakeargs=( + -DLIBCXX_LIBDIR_SUFFIX= + -DLIBCXX_ENABLE_SHARED=ON + -DLIBCXX_ENABLE_STATIC=OFF + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF + -DLIBCXXABI_USE_LLVM_UNWINDER=ON + -DLIBCXX_CXX_ABI=libcxxabi + -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${WORKDIR}"/libcxxabi/include + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) + -DLIBCXX_HAS_GCC_S_LIB=OFF + -DLIBCXX_INCLUDE_TESTS=OFF + ) + + cmake-utils_src_configure + cmake-utils_src_compile +} + multilib_src_test() { + # build local copies of libc++ & libc++abi for testing to avoid + # circular deps + build_libcxxabi + build_libcxx + mv "${BUILD_DIR}"/libcxx*/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die + cmake-utils_src_make check-unwind } |