summaryrefslogtreecommitdiff
path: root/sys-libs/compiler-rt-sanitizers
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-12-15 18:09:03 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-12-15 18:09:03 +0000
commit7bc9c63c9da678a7e6fceb095d56c634afd22c56 (patch)
tree4a67d50a439e9af63947e5f8b6ba3719af98b6c9 /sys-libs/compiler-rt-sanitizers
parentb284a3168fa91a038925d2ecf5e4791011ea5e7d (diff)
gentoo resync : 15.12.2019
Diffstat (limited to 'sys-libs/compiler-rt-sanitizers')
-rw-r--r--sys-libs/compiler-rt-sanitizers/Manifest8
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1_rc2.ebuild (renamed from sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.1.ebuild)61
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1_rc3.ebuild153
3 files changed, 175 insertions, 47 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index 7c055e15c401..ff571d0c4599 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -1,18 +1,18 @@
AUX 7.1.0/0001-sanitizer_common-Fix-using-libtirpc-on-Linux.patch 2583 BLAKE2B be7e9a2cbab8b3bd110346f6c8bda30d104397601950c995b77388fcb91e53ca82f5d3574931c58244403eee698f01209ca9e704fd4c6b9b3ef08e68d41dbea7 SHA512 656a7bbdcf0f678814d0ad0ff56ce43b7fc48c7a549373a4ef77e74490437283c5834e86b1b4e8bcb85578953687d79474ef2bf494c7eed4cf7fa1f17003f385
AUX 7.1.0/0002-test-Support-using-libtirpc-on-Linux.patch 4161 BLAKE2B 3db2dcebf70ca3e7c399dfb22d8ae50d51863f7a8a15a10b0232f73d4fc2ee0b51ff67e8842b0e4d29dd41e60a326c90670f62a431ca593617f566e03bc7f90a SHA512 2f03f4d0232b600861de0c527d6bef26b0e3273865a7d7344e083a6a7de4033de6d30df3a6b22f4d23be74dfa8864ccaebd42c1f0d4474abc83a66f8997e19fb
-DIST compiler-rt-6.0.1.src.tar.xz 1686820 BLAKE2B 59fa3f6e478bd4d6dfa056c85dcdc4349cbce7cea7fc56519feddc9d66c88c9ca48bad7967432ceb81d754213577f12707035afd827cf630a58627575b73b798 SHA512 69850c1ad92c66977fa217cbfb42a6a3f502fbe3d1a08daa7fc4cfeb617a7736d231f8ad8d93b10b1ae29bd753315d2a2d70f9ff1f4d18a9a7cc81758d91f963
DIST compiler-rt-7.1.0.src.tar.xz 1864248 BLAKE2B 42ab86416f7f85c5833cf85dbfb66b18a5d5cf53fa0560ad43b2ef39f5a2cd7ec1dbe4192cc8dac9b3f658b828c8306f26745c4d0e8f846d9f550ac22717eb33 SHA512 54d3ad80936f011dbf2ecebba3f1b7d4a156044b178228411ba855be5ec48eb646155b74dea1a96674adab6f93803456ae1435395e3240a4423a3f65f4566b55
DIST compiler-rt-8.0.1.src.tar.xz 1954204 BLAKE2B cbba1d5fb37385116920da39dea26739d09e3f11c392503f8bc45293f1ef00c97f6a9fbd3ba67094d7f1e532410d0eca461943dadfdb10646110470a8e3b5f1f SHA512 12bf1bdabe25c0c3a84cc73a718fe154573dd729ec3ff5e099bd5f74c6bec9c80521b87ded646d3b20dfdb9aa51dea0234281418c7eb81805e1dd5d3107d3d8e
DIST compiler-rt-9.0.0.src.tar.xz 1993084 BLAKE2B 4aece9570df4cc38aaa58a3740aa0e1b5cbfe0bfc2d1a590e9e95871fda6ba4dcdeab6125d243c31ce5130386235475339f13da9f900b505eb2fec850a711646 SHA512 a7bb0a67165d29317cee58c22ed79f0d6a9cb9279dcd355d4267f3cd6c531a7be455a28267c591d6e2c0f9c56e363d40c10a405391e07d02ab3e30f00ffef2a8
-DIST compiler-rt-sanitizers-6.0.1-patchset.tar.xz 8820 BLAKE2B d53ca357e060d058c7f20c51e74684f4c032fdf3ccec4c9f227dc7a5757206f331b9eda25a72c5c66faf4c44b2cc63eb439bd21bdd55d37a93918ab428fd7cd4 SHA512 782a34c56134bd061da30c1f598ddb9e90cb34a4e4ef058fa9634f6da372fd8693ff5e6cf98b59700942273240f83052b89ee2736b22f4e19bc8b519fbec8cad
-DIST llvm-6.0.1.src.tar.xz 25306628 BLAKE2B 60232d4d22f8096b565cc8d81fea0639f24f14e8fc4f66ade69fa15479181f07f655f26dff3fa24bf105762b495da316c5c9352db234bd0af6b9c3fff6d4d881 SHA512 cbbb00eb99cfeb4aff623ee1a5ba075e7b5a76fc00c5f9f539ff28c108598f5708a0369d5bd92683def5a20c2fe60cab7827b42d628dbfcc79b57e0e91b84dd9
DIST llvm-7.1.0.src.tar.xz 28313784 BLAKE2B b78d9a7fc5ef6e352e77d339e5c4eef5ccedf67c05e7abd949e72619aa8a5ed65e7e5e2008354be8e7916d75581719b99f34227838fcc86c5d0080913c2fb22c SHA512 a7dbd5693d1f2dae6b6e52893a100f9349cbfcfb25c5fdcad46364acbff0dbd3573f8fbc026c68eb9fd56335198aa94b866cc3dd7ea0cbd2cbfb5f8fe3444a7a
DIST llvm-8.0.1.src.tar.xz 30477608 BLAKE2B 4319c837b36111401e3b0f9659b8d875c89463bcc7816df1aefe1e3ff989860bbaa92504718f8e15416cfd9f3491c13777cd5cb661877b237b342b0e515b93f5 SHA512 82e120be5cabdfd5111aebbea68a663fe229c8861d73802d6ab09a3bf48f60de333e07e61f8fb61beaa14ac2bea24fcd74fa6f761acaf62469f536b79fcb1e16
DIST llvm-9.0.0.src.tar.xz 32994768 BLAKE2B 7f09bff9bcada95ab9c920c78aef92b57e665d9188bab39c734084ceb03a801c942fed48ea77fabeeb6110c648cb69363c659a6ce93ebf67dbba5c187219b13b SHA512 1bb3341e1d231559b948f1505b33c2e2e03989f9b8bbfef0e0cdaff5ac43f85574c9ec5ac53399b914f497d6899425d861411024e8d7e1d1a338c1c6951ac658
+DIST llvmorg-9.0.1-rc2.tar.gz 113203311 BLAKE2B 6e426060853e1587febedb75189444a1451236b713f800a4f3401c54318e48b0f5e0c484e9e4ef261faceed9b43b445a4153b061d4dadcc617047f9320b4f56a SHA512 fececd9365645920b9afdad1e94d5e10553ad4a39d84b3ac811b86014c395d51f7e4dabe54bb095a99481400c408bee3c9a2044168724d5e094e3258587a5d2c
+DIST llvmorg-9.0.1-rc3.tar.gz 113205740 BLAKE2B 3ca81e812833ecc2ac1bacfdeb86f54609ee125ba7390ce6af0113e949496149102360f35a9a0194dff93fb5cb6ade40a68382a03a7e55771a13198abb7ca9de SHA512 ea56a4ee57aacdd00a1d6551cdc768ecce3124a0eb6a9d09fe060bb147019a5119b2a9eaca576474be42e0296293daa923edd86dadb6759df0c2d7fc7a74f9f1
EBUILD compiler-rt-sanitizers-10.0.0.9999.ebuild 4690 BLAKE2B 6af6661f0ea4c83cf103d0ce21a1bbd360c7497512fde80e7fb77fbc4ff564b5c6a89bf3123bde7a368efe3c656640a66dbb6f79373aa2c68df8ec678798ad52 SHA512 46a2ded095d2e0f0c6433acb76c8bfee8ec2c8b1b32b4cb33936015db6a915bb660377ba9b679d6f6a9f0132d1f8748b254529ed044cc19fd61e3523909057a1
-EBUILD compiler-rt-sanitizers-6.0.1.ebuild 5441 BLAKE2B aee706d982849e61b7fc87a63812131c41eead7135740385719610bee8ba1e3e10823e36ea9ffc2041f15c70a51a56c902e887507aabc2dc02c04a23672bd721 SHA512 aae5f86ab86a09e64a5a07e3432c78478eaf6c9faf3c57101806af49746672d95dd78481f31356286f4c0ceed09ba305d7a0dcf1922d849ebedec87ef6769426
EBUILD compiler-rt-sanitizers-7.1.0.ebuild 5388 BLAKE2B 63d9681596e72e8df4c04046d5ad5277402957ebea29f2ceca0e3252a69ef8498998b710bc5be8a66efde59087223e5bd23fb5c2ffa1ef644a07577032e1330f SHA512 f94e76d0bdc8d99c09d4e9d1bfc3f566f45b0c7e42242cd76ba1d61d46f8d244ff971a154693980753a0323ece57138285a5f7e42af1f41f662f32f6ac09b23b
EBUILD compiler-rt-sanitizers-8.0.1.ebuild 5186 BLAKE2B fb334e5216a59f76afb035414e1d145c3780fa672439a728b37e34c63f73516b0c5a55efc75dc6abe59b7f47240dc5969016eeb597cc00a873ff77a16dba72d9 SHA512 305c3018df76a6c55f1d0121f02b87d821d1645145bda6ab631ddfbc23714ee3879e9c5f2e6fbee12872c0a05a8730216120b1a141b722fd36cafdaffb5773eb
EBUILD compiler-rt-sanitizers-9.0.0.ebuild 4740 BLAKE2B fb32526d40411bfc5989a6d6c86271ff514920a84260c0a29e370d3ea9f7c2edc734e2fb74b9f1af24ed2fa1aebe7dd06c28cba8d45cfa2275918b5ef505fc9b SHA512 457f032b1b8ce3f2c181fa7cc79c07c13552f59090c4b544120fddb0ad376bfadaff7377d0a4bf0d980f9e585a35fbcb8a5165e5edab1a223fe2f2e6d637670f
EBUILD compiler-rt-sanitizers-9.0.1.9999.ebuild 4689 BLAKE2B 21ba79f3b045b5738ea187035606dbbf28ba464cef95fd84c83bb937a2a6286f688e58ced5fd3399c801681a115e4daa96302cac5763a0cc25e63f2abcb0ab6b SHA512 508c98f4aaabb84793f500240abf830686352d361f7cab7051d5a3ba76c497a6e5897d415fddba65a54f4e73d804236d0a2746993522f0cc1c5e5ddd050166c8
+EBUILD compiler-rt-sanitizers-9.0.1_rc2.ebuild 4765 BLAKE2B 91652ad73616197b2b22be1e04c490ef4561896a53bf285b0726684978a9e74d7a0e261b5193da4ed4ecbde0d2a4b3200664086ee75c6848619cbd7f9ba3ef9a SHA512 326ee7b8869adcd3a8bfec5801552b03d4f8151d06be5d47fd5125105d817cc241106911c7cdb7426d0f51a074f680d99b113a40d802c5f7022cfbf3f02f5218
+EBUILD compiler-rt-sanitizers-9.0.1_rc3.ebuild 4765 BLAKE2B 91652ad73616197b2b22be1e04c490ef4561896a53bf285b0726684978a9e74d7a0e261b5193da4ed4ecbde0d2a4b3200664086ee75c6848619cbd7f9ba3ef9a SHA512 326ee7b8869adcd3a8bfec5801552b03d4f8151d06be5d47fd5125105d817cc241106911c7cdb7426d0f51a074f680d99b113a40d802c5f7022cfbf3f02f5218
MISC metadata.xml 547 BLAKE2B 6f9d8b65c12797fd3d168e9b3948c604265db135bda5493d9f1d8b1d01fd73a79d07e5241afc3a7fa1672827fac23d3d9dc4d7ae42371a0de892a900c8c28269 SHA512 fb73a96b1ffbc7ff2fecfba35c9acd3e54ade0154016ae04423217f5c000eee2b0b821cc626908647551a0aa7b7f462d42d56cde3993ddd52248bc373b117c3e
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1_rc2.ebuild
index 10bf0f5035a3..4c388d97887c 100644
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.1.ebuild
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1_rc2.ebuild
@@ -1,28 +1,21 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=7
-: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
-# (needed due to CMAKE_BUILD_TYPE != Gentoo)
-CMAKE_MIN_VERSION=3.7.0-r1
-PYTHON_COMPAT=( python2_7 )
-
-inherit check-reqs cmake-utils flag-o-matic llvm \
+PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
+inherit check-reqs cmake-utils flag-o-matic llvm llvm.org \
multiprocessing python-any-r1
-MY_P=compiler-rt-${PV/_/}.src
-LLVM_P=llvm-${PV/_/}.src
-
DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
HOMEPAGE="https://llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz
- https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.xz
- test? ( https://releases.llvm.org/${PV/_//}/${LLVM_P}.tar.xz )"
+LLVM_COMPONENTS=( compiler-rt )
+LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest )
+llvm.org_set_globals
-LICENSE="|| ( UoI-NCSA MIT )"
-SLOT="${PV%_*}"
-KEYWORDS="amd64 ~arm64 ~ppc64 x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
+SLOT="$(ver_cut 1-3)"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
IUSE="+clang +libfuzzer +profile +sanitize test +xray elibc_glibc"
# FIXME: libfuzzer does not enable all its necessary dependencies
REQUIRED_USE="libfuzzer? ( || ( sanitize xray ) )"
@@ -31,8 +24,10 @@ RESTRICT="!test? ( test ) !clang? ( test )"
CLANG_SLOT=${SLOT%%.*}
# llvm-6 for new lit options
DEPEND="
- >=sys-devel/llvm-6
+ >=sys-devel/llvm-6"
+BDEPEND="
clang? ( sys-devel/clang )
+ elibc_glibc? ( net-libs/libtirpc )
test? (
!<sys-apps/sandbox-2.13
$(python_gen_any_dep ">=dev-python/lit-5[\${PYTHON_USEDEP}]")
@@ -40,8 +35,6 @@ DEPEND="
sys-libs/compiler-rt:${SLOT} )
${PYTHON_DEPS}"
-S=${WORKDIR}/${MY_P}
-
# least intrusive of all
CMAKE_BUILD_TYPE=RelWithDebInfo
@@ -62,40 +55,21 @@ pkg_setup() {
python-any-r1_pkg_setup
}
-src_unpack() {
- einfo "Unpacking ${MY_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die
- einfo "Unpacking ${P}-patchset.tar.xz ..."
- tar -xf "${DISTDIR}/${P}-patchset.tar.xz" || die
-
- if use test; then
- einfo "Unpacking parts of ${LLVM_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${LLVM_P}.tar.xz" \
- "${LLVM_P}"/utils/{lit,unittest} || die
- mv "${LLVM_P}" llvm || die
- fi
-}
-
src_prepare() {
cmake-utils_src_prepare
- # apply the patchset (new glibc fixes)
- eapply "${WORKDIR}/${P}-patchset"
-
if use test; then
- # remove tests that are broken by new glibc
+ # remove tests that are (still) broken by new glibc
# https://bugs.llvm.org/show_bug.cgi?id=36065
if use elibc_glibc && has_version '>=sys-libs/glibc-2.25'; then
- rm test/lsan/TestCases/Linux/use_tls_dynamic.cc || die
- rm test/msan/dtls_test.c || die
- rm test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc || die
+ rm test/lsan/TestCases/Linux/fork_and_leak.cc || die
fi
fi
}
src_configure() {
# pre-set since we need to pass it to cmake
- BUILD_DIR=${WORKDIR}/${P}_build
+ BUILD_DIR=${WORKDIR}/compiler-rt_build
if use clang; then
local -x CC=${CHOST}-clang
@@ -110,8 +84,9 @@ src_configure() {
-DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}"
-DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
- # built-ins installed by sys-libs/compiler-rt
+ # builtins & crt installed by sys-libs/compiler-rt
-DCOMPILER_RT_BUILD_BUILTINS=OFF
+ -DCOMPILER_RT_BUILD_CRT=OFF
-DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer)
-DCOMPILER_RT_BUILD_PROFILE=$(usex profile)
-DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize)
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1_rc3.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1_rc3.ebuild
new file mode 100644
index 000000000000..4c388d97887c
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1_rc3.ebuild
@@ -0,0 +1,153 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
+inherit check-reqs cmake-utils flag-o-matic llvm llvm.org \
+ multiprocessing python-any-r1
+
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
+HOMEPAGE="https://llvm.org/"
+LLVM_COMPONENTS=( compiler-rt )
+LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest )
+llvm.org_set_globals
+
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
+SLOT="$(ver_cut 1-3)"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="+clang +libfuzzer +profile +sanitize test +xray elibc_glibc"
+# FIXME: libfuzzer does not enable all its necessary dependencies
+REQUIRED_USE="libfuzzer? ( || ( sanitize xray ) )"
+RESTRICT="!test? ( test ) !clang? ( test )"
+
+CLANG_SLOT=${SLOT%%.*}
+# llvm-6 for new lit options
+DEPEND="
+ >=sys-devel/llvm-6"
+BDEPEND="
+ clang? ( sys-devel/clang )
+ elibc_glibc? ( net-libs/libtirpc )
+ test? (
+ !<sys-apps/sandbox-2.13
+ $(python_gen_any_dep ">=dev-python/lit-5[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${CLANG_SLOT}
+ sys-libs/compiler-rt:${SLOT} )
+ ${PYTHON_DEPS}"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+check_space() {
+ if use test; then
+ local CHECKREQS_DISK_BUILD=11G
+ check-reqs_pkg_pretend
+ fi
+}
+
+pkg_pretend() {
+ check_space
+}
+
+pkg_setup() {
+ check_space
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ if use test; then
+ # remove tests that are (still) broken by new glibc
+ # https://bugs.llvm.org/show_bug.cgi?id=36065
+ if use elibc_glibc && has_version '>=sys-libs/glibc-2.25'; then
+ rm test/lsan/TestCases/Linux/fork_and_leak.cc || die
+ fi
+ fi
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/compiler-rt_build
+
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ strip-unsupported-flags
+ fi
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+ # use a build dir structure consistent with install
+ # this makes it possible to easily deploy test-friendly clang
+ -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}"
+
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+ # builtins & crt installed by sys-libs/compiler-rt
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF
+ -DCOMPILER_RT_BUILD_CRT=OFF
+ -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer)
+ -DCOMPILER_RT_BUILD_PROFILE=$(usex profile)
+ -DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize)
+ -DCOMPILER_RT_BUILD_XRAY=$(usex xray)
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
+
+ # they are created during src_test()
+ -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${CLANG_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${CLANG_SLOT}/bin/clang++"
+ )
+
+ # same flags are passed for build & tests, so we need to strip
+ # them down to a subset supported by clang
+ CC=${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang \
+ CXX=${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang++ \
+ strip-unsupported-flags
+ fi
+
+ if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then
+ mycmakeargs+=(
+ # disable use of SDK for the system itself
+ -DDARWIN_macosx_CACHED_SYSROOT=/
+ )
+ fi
+
+ cmake-utils_src_configure
+
+ if use test; then
+ local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* )
+ [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}"
+ [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}"
+
+ # copy clang over since resource_dir is located relatively to binary
+ # therefore, we can put our new libraries in it
+ mkdir -p "${BUILD_DIR}"/lib/{llvm/${CLANG_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die
+ cp "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/bin/clang{,++} \
+ "${BUILD_DIR}"/lib/llvm/${CLANG_SLOT}/bin/ || die
+ cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \
+ "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die
+ cp "${sys_dir}"/*builtins*.a \
+ "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die
+ # we also need LLVMgold.so for gold-based tests
+ if [[ -f ${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
+ ln -s "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so \
+ "${BUILD_DIR}"/lib/llvm/${CLANG_SLOT}/$(get_libdir)/ || die
+ fi
+ fi
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ # disable sandbox to have it stop clobbering LD_PRELOAD
+ local -x SANDBOX_ON=0
+ # wipe LD_PRELOAD to make ASAN happy
+ local -x LD_PRELOAD=
+
+ cmake-utils_src_make check-all
+}