diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-07-28 15:09:32 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-07-28 15:58:35 +0200 |
commit | fd80c3800165f622ae6d46de4b6c8bf459e1a5a3 (patch) | |
tree | 6f8e9083fc68ddb404600e5eb99c1f8829a78268 /sys-libs/llvm-libunwind | |
parent | net-misc/connman-notify: drop 0_pre20191003-r2 (diff) | |
download | gentoo-fd80c3800165f622ae6d46de4b6c8bf459e1a5a3.tar.gz gentoo-fd80c3800165f622ae6d46de4b6c8bf459e1a5a3.tar.bz2 gentoo-fd80c3800165f622ae6d46de4b6c8bf459e1a5a3.zip |
sys-libs/llvm-libunwind: Build w/ clang by default, req. for tests
Add IUSE=+clang to force building with clang by default. Require
building with clang to run the test suite, and remove the test compiler
hack that resulted in using clang with gcc-based config. Remove
obsolete cmake args.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'sys-libs/llvm-libunwind')
-rw-r--r-- | sys-libs/llvm-libunwind/llvm-libunwind-15.0.0.9999.ebuild | 26 | ||||
-rw-r--r-- | sys-libs/llvm-libunwind/metadata.xml | 4 |
2 files changed, 17 insertions, 13 deletions
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-15.0.0.9999.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-15.0.0.9999.ebuild index 6d871c89b6b1..3be6f72f0fc7 100644 --- a/sys-libs/llvm-libunwind/llvm-libunwind-15.0.0.9999.ebuild +++ b/sys-libs/llvm-libunwind/llvm-libunwind-15.0.0.9999.ebuild @@ -13,7 +13,8 @@ HOMEPAGE="https://github.com/llvm-mirror/libunwind" LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" SLOT="0" KEYWORDS="" -IUSE="debug static-libs test" +IUSE="+clang debug static-libs test" +REQUIRED_USE="test? ( clang )" RESTRICT="!test? ( test )" RDEPEND=" @@ -24,11 +25,13 @@ DEPEND=" >=sys-devel/llvm-6 " BDEPEND=" + clang? ( + sys-devel/clang + ) !test? ( ${PYTHON_DEPS} ) test? ( - >=sys-devel/clang-3.9.0 $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') ) " @@ -46,6 +49,14 @@ multilib_src_configure() { local use_compiler_rt=OFF local libdir=$(get_libdir) + if use clang && ! tc-is-clang; then + # Only do this conditionally to allow overriding with + # e.g. CC=clang-13 in case of breakage + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + strip-unsupported-flags + fi + # link to compiler-rt # https://github.com/gentoo/gentoo/pull/21516 if tc-is-clang; then @@ -65,7 +76,6 @@ multilib_src_configure() { -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs) -DLIBUNWIND_INCLUDE_TESTS=$(usex test) -DLIBUNWIND_INSTALL_HEADERS=ON - -DLIBUNWIND_TARGET_TRIPLE="${CHOST}" # support non-native unwinding; given it's small enough, # enable it unconditionally @@ -90,7 +100,6 @@ multilib_src_configure() { -DLIBCXX_LIBDIR_SUFFIX= -DLIBCXX_ENABLE_SHARED=OFF -DLIBCXX_ENABLE_STATIC=ON - -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) @@ -101,15 +110,6 @@ multilib_src_configure() { fi cmake_src_configure - - if use test; then - local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) - [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" - - # meh, we need to override the compiler explicitly - sed -e "/%{cxx}/s@, '.*'@, '${clang_path}'@" \ - -i "${BUILD_DIR}"/libunwind/test/lit.site.cfg || die - fi } multilib_src_test() { diff --git a/sys-libs/llvm-libunwind/metadata.xml b/sys-libs/llvm-libunwind/metadata.xml index 072910296ca3..9e58371ca860 100644 --- a/sys-libs/llvm-libunwind/metadata.xml +++ b/sys-libs/llvm-libunwind/metadata.xml @@ -7,4 +7,8 @@ <upstream> <remote-id type="github">llvm/llvm-project</remote-id> </upstream> + <use> + <flag name="clang">Force building using installed clang (rather + than the default CC/CXX; required for testing).</flag> + </use> </pkgmetadata> |