3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
PYTHON_COMPAT=( python3_{9..10} )
|
7 |
|
inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs
|
|
6 |
PYTHON_COMPAT=( python3_{9..11} )
|
|
7 |
inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \
|
|
8 |
toolchain-funcs
|
8 |
9 |
|
9 |
10 |
DESCRIPTION="C++ runtime stack unwinder from LLVM"
|
10 |
11 |
HOMEPAGE="https://llvm.org/docs/ExceptionHandling.html"
|
... | ... | |
12 |
13 |
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
|
13 |
14 |
SLOT="0"
|
14 |
15 |
KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv sparc x86 ~x64-macos"
|
15 |
|
IUSE="debug static-libs test"
|
|
16 |
IUSE="+clang debug static-libs test"
|
|
17 |
REQUIRED_USE="test? ( clang )"
|
16 |
18 |
RESTRICT="!test? ( test )"
|
17 |
19 |
|
18 |
20 |
RDEPEND="
|
19 |
21 |
!sys-libs/libunwind
|
20 |
22 |
"
|
21 |
|
# llvm-6 for new lit options
|
22 |
23 |
DEPEND="
|
23 |
|
>=sys-devel/llvm-6
|
|
24 |
sys-devel/llvm:${LLVM_MAJOR}
|
24 |
25 |
"
|
25 |
26 |
BDEPEND="
|
|
27 |
clang? (
|
|
28 |
sys-devel/clang:${LLVM_MAJOR}
|
|
29 |
)
|
26 |
30 |
!test? (
|
27 |
31 |
${PYTHON_DEPS}
|
28 |
32 |
)
|
29 |
33 |
test? (
|
30 |
|
>=sys-devel/clang-3.9.0
|
31 |
34 |
$(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
|
32 |
35 |
)
|
33 |
36 |
"
|
... | ... | |
41 |
44 |
python_has_version "dev-python/lit[${PYTHON_USEDEP}]"
|
42 |
45 |
}
|
43 |
46 |
|
|
47 |
pkg_setup() {
|
|
48 |
LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
|
|
49 |
python-any-r1_pkg_setup
|
|
50 |
}
|
|
51 |
|
44 |
52 |
multilib_src_configure() {
|
45 |
53 |
local libdir=$(get_libdir)
|
46 |
54 |
|
... | ... | |
48 |
56 |
# also separately bug #863917
|
49 |
57 |
filter-lto
|
50 |
58 |
|
|
59 |
if use clang; then
|
|
60 |
local -x CC=${CHOST}-clang
|
|
61 |
local -x CXX=${CHOST}-clang++
|
|
62 |
strip-unsupported-flags
|
|
63 |
fi
|
|
64 |
|
51 |
65 |
# link to compiler-rt
|
52 |
66 |
# https://github.com/gentoo/gentoo/pull/21516
|
53 |
67 |
local use_compiler_rt=OFF
|
54 |
68 |
[[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
|
55 |
69 |
|
56 |
70 |
local mycmakeargs=(
|
|
71 |
-DCMAKE_CXX_COMPILER_TARGET="${CHOST}"
|
57 |
72 |
-DPython3_EXECUTABLE="${PYTHON}"
|
58 |
73 |
-DLLVM_ENABLE_RUNTIMES="libunwind"
|
59 |
74 |
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
|
... | ... | |
62 |
77 |
-DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
|
63 |
78 |
-DLIBUNWIND_INCLUDE_TESTS=$(usex test)
|
64 |
79 |
-DLIBUNWIND_INSTALL_HEADERS=ON
|
65 |
|
-DLIBUNWIND_TARGET_TRIPLE="${CHOST}"
|
66 |
80 |
|
67 |
81 |
# support non-native unwinding; given it's small enough,
|
68 |
82 |
# enable it unconditionally
|
... | ... | |
87 |
101 |
-DLIBCXX_LIBDIR_SUFFIX=
|
88 |
102 |
-DLIBCXX_ENABLE_SHARED=OFF
|
89 |
103 |
-DLIBCXX_ENABLE_STATIC=ON
|
90 |
|
-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
|
91 |
104 |
-DLIBCXX_CXX_ABI=libcxxabi
|
92 |
105 |
-DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
|
93 |
106 |
-DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
|
... | ... | |
98 |
111 |
fi
|
99 |
112 |
|
100 |
113 |
cmake_src_configure
|
101 |
|
|
102 |
|
if use test; then
|
103 |
|
local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
|
104 |
|
[[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
|
105 |
|
|
106 |
|
# meh, we need to override the compiler explicitly
|
107 |
|
sed -e "/%{cxx}/s@, '.*'@, '${clang_path}'@" \
|
108 |
|
-i "${BUILD_DIR}"/libunwind/test/lit.site.cfg || die
|
109 |
|
fi
|
110 |
114 |
}
|
111 |
115 |
|
112 |
116 |
multilib_src_test() {
|