summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-07-28 15:49:53 +0200
committerMichał Górny <mgorny@gentoo.org>2022-07-28 15:58:35 +0200
commit3420b2ccc28fa7f30f36db98a997afa35ba4fec8 (patch)
treed94dd91982f438c729708c1ed8d2bb63e93a5fb0 /sys-libs
parentsys-libs/llvm-libunwind: Build w/ clang by default, req. for tests (diff)
downloadgentoo-3420b2ccc28fa7f30f36db98a997afa35ba4fec8.tar.gz
gentoo-3420b2ccc28fa7f30f36db98a997afa35ba4fec8.tar.bz2
gentoo-3420b2ccc28fa7f30f36db98a997afa35ba4fec8.zip
sys-libs/libcxxabi: Default to building w/ clang, fix tests
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/libcxxabi/libcxxabi-15.0.0.9999.ebuild19
-rw-r--r--sys-libs/libcxxabi/metadata.xml2
2 files changed, 17 insertions, 4 deletions
diff --git a/sys-libs/libcxxabi/libcxxabi-15.0.0.9999.ebuild b/sys-libs/libcxxabi/libcxxabi-15.0.0.9999.ebuild
index 6655441055a6..d16cb515b1e6 100644
--- a/sys-libs/libcxxabi/libcxxabi-15.0.0.9999.ebuild
+++ b/sys-libs/libcxxabi/libcxxabi-15.0.0.9999.ebuild
@@ -13,7 +13,8 @@ HOMEPAGE="https://libcxxabi.llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
SLOT="0"
KEYWORDS=""
-IUSE="+libunwind static-libs test"
+IUSE="+clang +libunwind static-libs test"
+REQUIRED_USE="test? ( clang )"
RESTRICT="!test? ( test )"
RDEPEND="
@@ -34,11 +35,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}]')
)
"
@@ -62,6 +65,14 @@ pkg_setup() {
}
multilib_src_configure() {
+ 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 against compiler-rt instead of libgcc if we are using clang with libunwind
local want_compiler_rt=OFF
if use libunwind && tc-is-clang; then
@@ -74,6 +85,7 @@ multilib_src_configure() {
local libdir=$(get_libdir)
local mycmakeargs=(
+ -DCMAKE_CXX_COMPILER_TARGET="${CHOST}"
-DPython3_EXECUTABLE="${PYTHON}"
-DLLVM_ENABLE_RUNTIMES="libcxxabi;libcxx"
-DLLVM_INCLUDE_TESTS=OFF
@@ -97,7 +109,6 @@ multilib_src_configure() {
-DLIBCXX_HAS_GCC_S_LIB=OFF
-DLIBCXX_INCLUDE_BENCHMARKS=OFF
-DLIBCXX_INCLUDE_TESTS=OFF
- -DLIBCXX_TARGET_TRIPLE="${CHOST}"
)
if use test; then
local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
@@ -105,7 +116,7 @@ multilib_src_configure() {
mycmakeargs+=(
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
- -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
-DPython3_EXECUTABLE="${PYTHON}"
)
fi
diff --git a/sys-libs/libcxxabi/metadata.xml b/sys-libs/libcxxabi/metadata.xml
index 5ae427d0d694..6aba5e09cd41 100644
--- a/sys-libs/libcxxabi/metadata.xml
+++ b/sys-libs/libcxxabi/metadata.xml
@@ -5,6 +5,8 @@
<email>llvm@gentoo.org</email>
</maintainer>
<use>
+ <flag name="clang">Force building using installed clang (rather
+ than the default CC/CXX; required for testing).</flag>
<flag name="libunwind">Use libunwind instead of libgcc_s for stack unwinding, thus avoiding dependency on gcc</flag>
</use>
<upstream>