summaryrefslogtreecommitdiff
path: root/sys-libs/compiler-rt-sanitizers
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-sanitizers
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-libs/compiler-rt-sanitizers')
-rw-r--r--sys-libs/compiler-rt-sanitizers/Manifest10
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild127
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.0.ebuild126
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.9999.ebuild134
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild141
-rw-r--r--sys-libs/compiler-rt-sanitizers/metadata.xml7
6 files changed, 545 insertions, 0 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
new file mode 100644
index 000000000000..844fd6cce019
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -0,0 +1,10 @@
+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
+DIST llvm-4.0.1.src.tar.xz 21065652 SHA256 da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51 SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d WHIRLPOOL 1626ff270f7ce4801d02a0797b227fda9314ff5c0c01d653111599e9a4d2854c4d9edc3c698a7abee8d79d6bce8b18dc619fbced3c07ca610d44a248d65830cc
+DIST llvm-5.0.0.src.tar.xz 23411980 SHA256 e35dcbae6084adcf4abb32514127c5eabd7d63b733852ccdb31e06f1373136da SHA512 e6d8fdcb5bf27bded814d02f39f69c6171bc3a512d5957c03e5ac2e231f903b7de87634b059bd5c5da670f7c3a8f7a538f6299225799f15f921857f1452f6b3a WHIRLPOOL 6a99edbdc3e6726dc8ff9126b110fd7560faac46601407722e6dd80b5d894ff242521dc8fda7f4d879de83dac51c65645a37224f7e8def0d8d2f1e564b0531bb
+EBUILD compiler-rt-sanitizers-4.0.1.ebuild 3700 SHA256 e94c8ca46912fae9fd0341e1d04e21a187223aef73ff3fc6d8c2c5266ec9c7f6 SHA512 ded0c49686b4e1cce4ec15f199a913c0668d643a8217ffcdfc1b62dddb28c08754a791a38dcdbdf5defdd6e5fa917b3aa3bed27ac7e6c574a933a8149168f320 WHIRLPOOL edacaff32670287f15f92c357e3ece365c99e3558a17c1ff2d2d9fa954851c7e35207e8b87de0616cd4e98bed09b7dda64bd0c9d4080dcaac50f4be1b0eae28d
+EBUILD compiler-rt-sanitizers-5.0.0.ebuild 3645 SHA256 fed86a6a5176fda58c40b958ec33cb419a1c324d3b6c46aca3dba40eff54ebc0 SHA512 c54db543aafa607484f49bba0171c5e46c30ac461431711baa7ec1f65e81aae633c48bb5c83dc1f0b77a3aacaab539040e3fdadb842c27ae1b1fb4904ff1c95e WHIRLPOOL f34ea544071a0d03c75b435b204a14e19f33ddb0869f9a8bae199a24962a13f5ccb338307f842cb7ff6ecb481139ef0745c260f94efde92d6e6d4300e1c77275
+EBUILD compiler-rt-sanitizers-5.0.9999.ebuild 3862 SHA256 6b82152a67c2f4b82f417c6e97259d03807f6cf2ec357f6ee9bd46b40959e9c8 SHA512 2c79eb1f8c92a420a07b68acefc00b8fbec6032e98aded26faf3045c76961dd5a295463859ac81fc7088770a6df503bcd5ee489d90f6f3268b64b8d3bce58e93 WHIRLPOOL af88861d550afc0f7d80a72584ccefc45f055a5a687aec99721d692c9b26cfa2793383af0bf828dc05c43432b34ea89df3ec729caa008e4bca6acd821fbd0152
+EBUILD compiler-rt-sanitizers-9999.ebuild 4038 SHA256 ab69b8ee1f478316da37c4cc2fc1b309b14bb2234ae273ed3e311a9473e05f98 SHA512 dfab5425724b3bddbb061bacd0e7ac71056e115f3c7676b371e8ff8944e09bbdb3b7a9840a308b8bff8d77c878fb0e9072eb6c20260819effa92d50457d00d09 WHIRLPOOL 21f256ea1f5d8c6a059ea81195b502b52ba1e0db48114761c4e0c244bc3c0c661f7c8e74cba23c5d1d5ebcfbb5daa3aea0ff712d1f24007f656c11f05ad120fe
+MISC ChangeLog 1300 SHA256 acfa9e6834077c600556eea74d2e5f70f0b607877b0edcd88f17388cca5e4f9a SHA512 0f2006ec7f8193506ae6c39995c7b08503fd0b81e5ede648be46e511b5f7168372c40d845ff4936d0d6455970e37fa44212156f43578f4f501c1dbee469ea6b6 WHIRLPOOL 6a0fca5215e7d5aa7a5ee79ebb9a9df00e7473ff78097b0ce5b20d8ee636796b9d60ca6a13cd568450ae3450feb3330d9653c815514478179fbd52865b8b0a1d
+MISC metadata.xml 216 SHA256 e94ba81dd2791908508a3993afdebf723cc617314c53c273b9bcca15a9c48327 SHA512 3485598147c953e72e1785693a489a7e7d73d59620b76054db9c0ce95d8bfa0e8ffec29da7f7a9d73a32e5b77eac07ca3306c56a972dc57fd89d477edaebf3d5 WHIRLPOOL 29145f5721e079e0548c5ef22424c65e6a5b2bfc4428918e923fcfdfc37e9b8749fb63e3c2eb5773c17fab276f7513dd66e326b906f1848911dceba7ae4b419a
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild
new file mode 100644
index 000000000000..5cee6068c3a6
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild
@@ -0,0 +1,127 @@
+# 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 check-reqs cmake-utils flag-o-matic llvm python-any-r1
+
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/compiler-rt-${PV/_/}.src.tar.xz
+ test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="${PV%_*}"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="test"
+
+LLVM_SLOT=${SLOT%%.*}
+RDEPEND="!=sys-libs/compiler-rt-sanitizers-${SLOT}*:0"
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ test? (
+ app-portage/unsandbox
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT}
+ sys-libs/compiler-rt:${SLOT} )
+ ${PYTHON_DEPS}"
+
+S=${WORKDIR}/compiler-rt-${PV/_/}.src
+
+# 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_unpack() {
+ default
+
+ if use test; then
+ mv llvm-* llvm || die
+ fi
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ 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)
+ # built-ins installed by sys-libs/compiler-rt
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF
+ -DCOMPILER_RT_BUILD_SANITIZERS=ON
+ -DCOMPILER_RT_BUILD_XRAY=ON
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/unsandbox;${EPREFIX}/usr/bin/lit"
+
+ # they are created during src_test()
+ -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_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/${LLVM_SLOT}/bin/clang \
+ CXX=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++ \
+ strip-unsupported-flags
+ 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/${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
+ 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/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
+ ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/$(get_libdir)/ || die
+ fi
+ fi
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-all
+}
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.0.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.0.ebuild
new file mode 100644
index 000000000000..8f82822471dd
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.0.ebuild
@@ -0,0 +1,126 @@
+# 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 check-reqs cmake-utils flag-o-matic llvm python-any-r1
+
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/compiler-rt-${PV/_/}.src.tar.xz
+ test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="${PV%_*}"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ test? (
+ app-portage/unsandbox
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT}
+ sys-libs/compiler-rt:${SLOT} )
+ ${PYTHON_DEPS}"
+
+S=${WORKDIR}/compiler-rt-${PV/_/}.src
+
+# 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_unpack() {
+ default
+
+ if use test; then
+ mv llvm-* llvm || die
+ fi
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ 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)
+ # built-ins installed by sys-libs/compiler-rt
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF
+ -DCOMPILER_RT_BUILD_SANITIZERS=ON
+ -DCOMPILER_RT_BUILD_XRAY=ON
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/unsandbox;${EPREFIX}/usr/bin/lit"
+
+ # they are created during src_test()
+ -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_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/${LLVM_SLOT}/bin/clang \
+ CXX=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++ \
+ strip-unsupported-flags
+ 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/${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
+ 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/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
+ ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/$(get_libdir)/ || die
+ fi
+ fi
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-all
+}
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.9999.ebuild
new file mode 100644
index 000000000000..5118f318acd5
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.9999.ebuild
@@ -0,0 +1,134 @@
+# 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 check-reqs cmake-utils flag-o-matic git-r3 llvm python-any-r1
+
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
+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="test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ test? (
+ app-portage/unsandbox
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_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_unpack() {
+ if use test; then
+ # needed for patched gtest
+ git-r3_fetch "https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ if use test; then
+ git-r3_checkout https://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm
+ fi
+ git-r3_checkout
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ 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)
+ # built-ins installed by sys-libs/compiler-rt
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF
+ -DCOMPILER_RT_BUILD_SANITIZERS=ON
+ -DCOMPILER_RT_BUILD_XRAY=ON
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/unsandbox;${EPREFIX}/usr/bin/lit"
+
+ # they are created during src_test()
+ -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_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/${LLVM_SLOT}/bin/clang \
+ CXX=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++ \
+ strip-unsupported-flags
+ 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/${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
+ 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/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
+ ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/$(get_libdir)/ || die
+ fi
+ fi
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-all
+}
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
new file mode 100644
index 000000000000..82ccb7403217
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
@@ -0,0 +1,141 @@
+# 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 check-reqs cmake-utils flag-o-matic git-r3 llvm python-any-r1
+
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
+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="test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ test? (
+ app-portage/unsandbox
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_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_unpack() {
+ if use test; then
+ # needed for patched gtest
+ git-r3_fetch "https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ if use test; then
+ git-r3_checkout https://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm
+ fi
+ git-r3_checkout
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ 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)
+ # built-ins installed by sys-libs/compiler-rt
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF
+ -DCOMPILER_RT_BUILD_LIBFUZZER=ON
+ -DCOMPILER_RT_BUILD_PROFILE=ON
+ -DCOMPILER_RT_BUILD_SANITIZERS=ON
+ -DCOMPILER_RT_BUILD_XRAY=ON
+ )
+ if use test; then
+ cat > "${T}"/unsandbox-lit.py <<-EOF || die
+ import os, sys
+ os.execlp("unsandbox", sys.argv[0], "lit", *sys.argv[1:])
+ EOF
+
+ mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_EXTERNAL_LIT="${T}/unsandbox-lit.py"
+ -DLLVM_LIT_ARGS="-vv"
+
+ # they are created during src_test()
+ -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_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/${LLVM_SLOT}/bin/clang \
+ CXX=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++ \
+ strip-unsupported-flags
+ 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/${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
+ 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/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
+ ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/$(get_libdir)/ || die
+ fi
+ fi
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-all
+}
diff --git a/sys-libs/compiler-rt-sanitizers/metadata.xml b/sys-libs/compiler-rt-sanitizers/metadata.xml
new file mode 100644
index 000000000000..89c4bdb96049
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/metadata.xml
@@ -0,0 +1,7 @@
+<?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>
+</pkgmetadata>