mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-20 10:17:08 -08:00
sys-libs/libcxxabi: Default to building w/ clang, fix tests
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user