summaryrefslogtreecommitdiff
path: root/sys-libs/compiler-rt
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-libs/compiler-rt
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-libs/compiler-rt')
-rw-r--r--sys-libs/compiler-rt/Manifest8
-rw-r--r--sys-libs/compiler-rt/compiler-rt-4.0.1.ebuild144
-rw-r--r--sys-libs/compiler-rt/compiler-rt-5.0.0.ebuild97
-rw-r--r--sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild99
-rw-r--r--sys-libs/compiler-rt/compiler-rt-9999.ebuild101
-rw-r--r--sys-libs/compiler-rt/metadata.xml11
6 files changed, 460 insertions, 0 deletions
diff --git a/sys-libs/compiler-rt/Manifest b/sys-libs/compiler-rt/Manifest
new file mode 100644
index 000000000000..272b576c0b15
--- /dev/null
+++ b/sys-libs/compiler-rt/Manifest
@@ -0,0 +1,8 @@
+DIST compiler-rt-4.0.1.src.tar.xz 1434100 SHA256 a3c87794334887b93b7a766c507244a7cdcce1d48b2e9249fc9a94f2c3beb440 SHA512 cfeb625884b273f7c0e6767b81a8d3e5f24e0b96a510d5764d9d47a0e215fc841b4cb9d1843c8fb428cd21def720cfbfe8d3593ff5bb390548ebc8c32a902649 WHIRLPOOL 8b33c6841cacefe98da92435418b13b8f8ed97a982903be827e5c37f937dc9001975d6a709d60423b21509dd5670ee2e90cb34c96473fb4a66c2ab6f47af09e5
+DIST compiler-rt-5.0.0.src.tar.xz 1507996 SHA256 d5ad5266462134a482b381f1f8115b6cad3473741b3bb7d1acc7f69fd0f0c0b3 SHA512 5f3fd49736fba35232b0baa19a5f03c4ab3bf85ec16f23355eb3c516fe6d861c14272c224ca2f2092a80636df4307e49a3df1b60a3791949b3f1ba4a0c8c81fb WHIRLPOOL 7ac0eb36b59a7917b694e4b5e9a425a3ffed7c48eda0c211a7d1c52596b2d39fa4bc0a84db5f58492bf7b5b64c22b81cd2fcd8dee2bceb89583b6e190c70d2d8
+EBUILD compiler-rt-4.0.1.ebuild 4140 SHA256 9545c010bbaeb42c0c0ffe5ceedba2ffb43da080c0d967e5eda4c9156f189e4b SHA512 1045366ba80a89af9f0b86825da1040b315234b81a756b350f6156aabfcac371e305d92eaef7d83374ce6475589cc7799517b09b52e26569cb2ce4171e6f512d WHIRLPOOL 3a693783df5dce274dc215fda8338b958499b3e242db47d1433f0d0f5f3f8366d79c84a45d6af1a599b421ca62eda1179393b1417bae82be26191f9fb0467d4c
+EBUILD compiler-rt-5.0.0.ebuild 2465 SHA256 b9642f659ee7b7cc261941165af3cc678e2b2039e9d4b9fa7ca1899b42b6625f SHA512 a6b6cc988d66efa33917031c30edac1685a2421250182b74e3ae50f86ad30e60b088b43697d256a77cc3e5a0ca44dd111801dd191f20563e35c5620f5d28580a WHIRLPOOL 2134438e2f28b6db0eeb590da42f775458f93f2bba48792b3ce6f1c9e7d17ce9b888cb42290a5669dc08e0fecc4d45c4b454a3369f7751e89f3829cd2fc7e0be
+EBUILD compiler-rt-5.0.9999.ebuild 2565 SHA256 b2fba465b88e6db46910f3d1ba1979d0d8d47d439c350ef719bd30a9ce002d86 SHA512 f7a1a7db0cec09ffefa9c8d96f603b86d388f8eb94f3e8fcb26dc85046d58c9a42e7ade0c869a54e6e427980f82bc67f4ad0b6f8c8d1349e3ccfc7b0ffee84c4 WHIRLPOOL 67d79931765a6d135fd14f9162634f054ad4cbcdf0bce7849a739aafd9f6994f82c979c05e8c9af7b8e2335834d1819cc2539f9fecf19b78d5a28bdbda314a42
+EBUILD compiler-rt-9999.ebuild 2641 SHA256 6daa15e9cb05625706bebd5d88521bc2cc8aa61a71e0899308214bc8726790d2 SHA512 a3abf71a684f1d208b18c9fc805296a445c5cdafb945384b19eba05bc53d61942c18d4f21bb8c86d0a2f1edd3daa4ffaa4d89696e4b146e94f7bcb991b85697d WHIRLPOOL cfe3861cc95587951b3ab8eb8a2e0efd65409e96d5a85ee27febe48b145c1114f1362b5a0879cae7a32608e145eaa3ac5fbec65a74e84c3877ee1d18c72b5d79
+MISC ChangeLog 1484 SHA256 d4460f2dfc06bb597b20da8e44d333c86d8282e7bee9a5cdb5f77ebb666d93b6 SHA512 60a0c5178b9f219b9e411e30a8a8b8b550e1e8c8dd477579044b72b8f8fbfa52c350dff871e43ad71ec1e71b50d72472c8bbdc85bd4d88549f334a3da5389c98 WHIRLPOOL 47b2acab1f3a6f2f95c043ce05b8cd209aafe56e199e617c991672d7046f7f34271eb9bc91d0146b17659b3fc9dd7cb3bcc46967add50aedf7f26ba1acc12e5f
+MISC metadata.xml 333 SHA256 358db03e7c65d9f9ac1ce9d4db64f695300fe1bb684249a3a9cc70c94567950b SHA512 97daa7452a696b7297c47f5f637a33425f82b51426060a75b3de6bc812f9ddcd3c70ae068bc3e88ce937ab1eb10d59b0ab48a2d2c0397a112b8b6a754e333bdc WHIRLPOOL d7d22a6bdfe1827698250cc3cd9e1911808fff08e5d13b348103607718bd48ef807b965bcc7ab5b12da56df5d6a3cd6a6d56d091b6975701e45bf2a8db766026
diff --git a/sys-libs/compiler-rt/compiler-rt-4.0.1.ebuild b/sys-libs/compiler-rt/compiler-rt-4.0.1.ebuild
new file mode 100644
index 000000000000..bc1e65eb314f
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-4.0.1.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+# TODO: fix unnecessary dep on Python upstream
+inherit cmake-utils flag-o-matic llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="${PV%_*}"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="+clang test"
+
+LLVM_SLOT=${SLOT%%.*}
+RDEPEND="!=sys-libs/compiler-rt-${SLOT}*:0"
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ clang? ( sys-devel/clang )
+ test? ( =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} )
+ ${PYTHON_DEPS}"
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_pretend() {
+ if ! use clang && ! tc-is-clang; then
+ ewarn "Building using a compiler other than clang may result in broken atomics"
+ ewarn "library. Enable USE=clang unless you have a very good reason not to."
+ fi
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+test_compiler() {
+ $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
+ <<<'int main() { return 0; }' &>/dev/null
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local nolib_flags=( -nodefaultlibs -lc )
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ # ensure we can use clang before installing compiler-rt
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ strip-unsupported-flags
+ elif ! test_compiler; then
+ if test_compiler "${nolib_flags[@]}"; then
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
+ fi
+ 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}"
+
+ # currently lit covers only sanitizer tests
+ -DCOMPILER_RT_INCLUDE_TESTS=OFF
+ -DCOMPILER_RT_BUILD_SANITIZERS=OFF
+ -DCOMPILER_RT_BUILD_XRAY=OFF
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # prepare a test compiler
+ # 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/${LLVM_SLOT}{/bin,$(get_libdir)},clang/${SLOT}/include} || die
+ cp "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/bin/clang{,++} \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/bin/ || die
+ cp "${EPREFIX}/usr/lib/clang/${SLOT}/include"/*.h \
+ "${BUILD_DIR}/lib/clang/${SLOT}/include/" || die
+
+ # builtins are not converted to lit yet, so run them manually
+ local tests=() f
+ cd "${S}"/test/builtins/Unit || die
+ while read -r -d '' f; do
+ # ppc subdir is unmaintained and lacks proper guards
+ # (and ppc builtins do not seem to be used anyway)
+ [[ ${f} == ./ppc/* ]] && continue
+ # these are special
+ [[ ${f} == ./cpu_model_test.c ]] && continue
+ [[ ${f} == ./gcc_personality_test.c ]] && continue
+ # unsupported
+ [[ ${f} == ./trampoline_setup_test.c ]] && continue
+ tests+=( "${f%.c}" )
+ done < <(find -name '*.c' -print0)
+
+ {
+ echo "check: ${tests[*]/#/check-}" &&
+ echo ".PHONY: check ${tests[*]/#/check-}" &&
+ for f in "${tests[@]}"; do
+ echo "check-${f}: ${f}" &&
+ echo " ${f}"
+ done
+ } > Makefile || die
+
+ local ABI
+ for ABI in $(get_all_abis); do
+ # not supported at all at the moment
+ [[ ${ABI} == x32 ]] && continue
+
+ rm -f "${tests[@]}" || die
+
+ einfo "Running tests for ABI=${ABI}"
+ # use -k to run all tests even if some fail
+ emake -k \
+ CC="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang" \
+ CFLAGS="$(get_abi_CFLAGS)" \
+ CPPFLAGS='-I../../../lib/builtins' \
+ LDFLAGS='-rtlib=compiler-rt' \
+ LDLIBS='-lm'
+ done
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # includes are mistakenly installed for all sanitizers and xray
+ rm -rf "${ED}"usr/lib/clang/*/include || die
+}
diff --git a/sys-libs/compiler-rt/compiler-rt-5.0.0.ebuild b/sys-libs/compiler-rt/compiler-rt-5.0.0.ebuild
new file mode 100644
index 000000000000..9b135a41b328
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-5.0.0.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils flag-o-matic llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="${PV%_*}"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="+clang test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ clang? ( sys-devel/clang )
+ test? (
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} )
+ ${PYTHON_DEPS}"
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_pretend() {
+ if ! use clang && ! tc-is-clang; then
+ ewarn "Building using a compiler other than clang may result in broken atomics"
+ ewarn "library. Enable USE=clang unless you have a very good reason not to."
+ fi
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+test_compiler() {
+ $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
+ <<<'int main() { return 0; }' &>/dev/null
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local nolib_flags=( -nodefaultlibs -lc )
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ # ensure we can use clang before installing compiler-rt
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ strip-unsupported-flags
+ elif ! test_compiler; then
+ if test_compiler "${nolib_flags[@]}"; then
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
+ fi
+ fi
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+ -DCOMPILER_RT_BUILD_SANITIZERS=OFF
+ -DCOMPILER_RT_BUILD_XRAY=OFF
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+
+ -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++"
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-builtins
+}
diff --git a/sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild b/sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild
new file mode 100644
index 000000000000..d53f8561e00a
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils flag-o-matic git-r3 llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/compiler-rt.git
+ https://github.com/llvm-mirror/compiler-rt.git"
+EGIT_BRANCH="release_50"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+# Note: this needs to be updated to match version of clang-9999
+SLOT="5.0.1"
+KEYWORDS=""
+IUSE="+clang test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ clang? ( sys-devel/clang )
+ test? (
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} )
+ ${PYTHON_DEPS}"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_pretend() {
+ if ! use clang && ! tc-is-clang; then
+ ewarn "Building using a compiler other than clang may result in broken atomics"
+ ewarn "library. Enable USE=clang unless you have a very good reason not to."
+ fi
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+test_compiler() {
+ $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
+ <<<'int main() { return 0; }' &>/dev/null
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local nolib_flags=( -nodefaultlibs -lc )
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ # ensure we can use clang before installing compiler-rt
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ strip-unsupported-flags
+ elif ! test_compiler; then
+ if test_compiler "${nolib_flags[@]}"; then
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
+ fi
+ fi
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+ -DCOMPILER_RT_BUILD_SANITIZERS=OFF
+ -DCOMPILER_RT_BUILD_XRAY=OFF
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+
+ -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++"
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-builtins
+}
diff --git a/sys-libs/compiler-rt/compiler-rt-9999.ebuild b/sys-libs/compiler-rt/compiler-rt-9999.ebuild
new file mode 100644
index 000000000000..3f8cb77ef772
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-9999.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils flag-o-matic git-r3 llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/compiler-rt.git
+ https://github.com/llvm-mirror/compiler-rt.git"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+# Note: this needs to be updated to match version of clang-9999
+SLOT="6.0.0"
+KEYWORDS=""
+IUSE="+clang test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ clang? ( sys-devel/clang )
+ test? (
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} )
+ ${PYTHON_DEPS}"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_pretend() {
+ if ! use clang && ! tc-is-clang; then
+ ewarn "Building using a compiler other than clang may result in broken atomics"
+ ewarn "library. Enable USE=clang unless you have a very good reason not to."
+ fi
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+test_compiler() {
+ $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
+ <<<'int main() { return 0; }' &>/dev/null
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local nolib_flags=( -nodefaultlibs -lc )
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ # ensure we can use clang before installing compiler-rt
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ strip-unsupported-flags
+ elif ! test_compiler; then
+ if test_compiler "${nolib_flags[@]}"; then
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
+ fi
+ fi
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+ -DCOMPILER_RT_BUILD_LIBFUZZER=OFF
+ -DCOMPILER_RT_BUILD_PROFILE=OFF
+ -DCOMPILER_RT_BUILD_SANITIZERS=OFF
+ -DCOMPILER_RT_BUILD_XRAY=OFF
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="-vv"
+
+ -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++"
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-builtins
+}
diff --git a/sys-libs/compiler-rt/metadata.xml b/sys-libs/compiler-rt/metadata.xml
new file mode 100644
index 000000000000..3b996021381a
--- /dev/null
+++ b/sys-libs/compiler-rt/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='clang'>Force building using installed clang (rather
+ than the default CC/CXX).</flag>
+ </use>
+</pkgmetadata>