summaryrefslogtreecommitdiff
path: root/sys-libs/compiler-rt
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-01-29 18:03:51 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-01-29 18:03:51 +0000
commitd7ed2b01311f15ba54fe8ea872aab7d59ab2b193 (patch)
tree1814dd2b5bbf2e7639fdafbeef48d228cfaf5e9b /sys-libs/compiler-rt
parentabaa75b10f899ada8dd05b23cc03205064394bc6 (diff)
gentoo resync : 29.01.2021
Diffstat (limited to 'sys-libs/compiler-rt')
-rw-r--r--sys-libs/compiler-rt/Manifest14
-rw-r--r--sys-libs/compiler-rt/compiler-rt-11.0.0.ebuild2
-rw-r--r--sys-libs/compiler-rt/compiler-rt-11.0.1.ebuild2
-rw-r--r--sys-libs/compiler-rt/compiler-rt-11.1.0_rc1.ebuild2
-rw-r--r--sys-libs/compiler-rt/compiler-rt-11.1.0_rc2.ebuild126
-rw-r--r--sys-libs/compiler-rt/compiler-rt-12.0.0_rc1.ebuild126
-rw-r--r--sys-libs/compiler-rt/compiler-rt-13.0.0.9999.ebuild126
-rw-r--r--sys-libs/compiler-rt/files/11.1.0/compiler-rt-prefix-paths.patch79
-rw-r--r--sys-libs/compiler-rt/files/9999/compiler-rt-prefix-paths.patch79
9 files changed, 470 insertions, 86 deletions
diff --git a/sys-libs/compiler-rt/Manifest b/sys-libs/compiler-rt/Manifest
index 51f79177d1fd..e96a9f000231 100644
--- a/sys-libs/compiler-rt/Manifest
+++ b/sys-libs/compiler-rt/Manifest
@@ -1,13 +1,19 @@
-AUX 9999/compiler-rt-prefix-paths.patch 3794 BLAKE2B f6e8992658e665bd9cc13bae00c9d7757d01438a73ffd8809be67bbcd1c6d3956e9965890fd84e573c9ef6cc74a7fc7a349e2e5eec21387150c8ef2ae2bf055d SHA512 23a05ce3805678e855be2a4678102e72fe81cb86208357df0dc95b85c7268fe95025603908dd114b27742f39432c4c860859904b287cf52f5a5b337b131bcb9e
+AUX 11.1.0/compiler-rt-prefix-paths.patch 3794 BLAKE2B f6e8992658e665bd9cc13bae00c9d7757d01438a73ffd8809be67bbcd1c6d3956e9965890fd84e573c9ef6cc74a7fc7a349e2e5eec21387150c8ef2ae2bf055d SHA512 23a05ce3805678e855be2a4678102e72fe81cb86208357df0dc95b85c7268fe95025603908dd114b27742f39432c4c860859904b287cf52f5a5b337b131bcb9e
+AUX 9999/compiler-rt-prefix-paths.patch 0 BLAKE2B 786a02f742015903c6c6fd852552d272912f4740e15847618a86e217f71f5419d25e1031afee585313896444934eb04b903a685b1448b755d56f701afe9be2ce SHA512 cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
DIST llvmorg-10.0.1.tar.gz 120880730 BLAKE2B 30f19f56c4d1f6abcda5fec76256219d1e3c8a6ff1a1f152f94bfe362c07884339fe571ff7fe903ed3b3deb150b2fa868c387887a0dea2930dc08b81db71a5b1 SHA512 48078fff9293a87f1a973f3348f79506f04c3da774295f5eb67d74dd2d1aa94f0973f8ced3f4ab9e8339902071f82c603b43d5608ad7227046c4da769c5d2151
DIST llvmorg-11.0.0.tar.gz 122743665 BLAKE2B 3f95570240789fd68ddb747df817f5c6cdc9da40911bbe9ee3531c15ada9165e5002b1c2f778cf8735858485ea05a8754e3d3a5f4b15bdd6cb33d64a14692984 SHA512 b6d38871ccce0e086e27d35e42887618d68e57d8274735c59e3eabc42dee352412489296293f8d5169fe0044936345915ee7da61ebdc64ec10f7737f6ecd90f2
DIST llvmorg-11.0.1.tar.gz 122790338 BLAKE2B 0130996b4a8c4d9f757136fd7fb318068c9bfdc565060dec0d4336480c4ab66c4ae3185a7fdb05f13cf9ee8fd4123b09df938881b75d6e5d3689595114b7e32a SHA512 f5e6ef0b3111aae08a89cd01adb2ff4abfa9ef779c68b9190421d0447efd25c2cc00e5aae9f4764805f5fa31434866043d1510ae7389817e28ae53a5442e2fdf
DIST llvmorg-11.1.0-rc1.tar.gz 122793491 BLAKE2B f4777455f5903cffea284eaffd872be6c287c6c1ebbd0c4b5b5473f146d7f5476f3551998a58d3e976ab90cde7b0d05db2b3be97f4e8e2c3474755ff38739268 SHA512 44e281486c44fa1611042ab658b9833a75f9613b7f896863613cfb99de66d13607fb1e9064f42ea3d89ca7951113465a90fd96ca4544262f165f78bd5261f5a8
+DIST llvmorg-11.1.0-rc2.tar.gz 122794772 BLAKE2B ab533f078d9d6c37e27c578866a07896344a0b4cf4ebf6402f4fa490213e017310d1c882bf63e552e99a5b4f6d1d8c01413420713b200bfa6732eff64f3c47a9 SHA512 88d8f1d938f0ba7ec39478d03a35c09a30bea51735276205494265b1061621b3ebcda8ee4211e896783b1b99a377c9fa68046118b0d6cb7fcb7bea1e960f95b7
+DIST llvmorg-12.0.0-rc1.tar.gz 134164708 BLAKE2B d4261ff7d9586b47f4cfda3d2cda4b76534f9e17fbd5cdb8861895b8eb466021962f4608bfcdeb52f8fce78850a994fd5eda0560f7211e5c8d1ac9330a738a36 SHA512 3d07d013d0705bb99f56898cc55d054d0d95aeb53b3c756cfab80b4c9097cc4935bcea89b9efde2e503a899b9fccf0dacc0073c9991c8ea352755c5ec68a757a
DIST llvmorg-9.0.1.tar.gz 113193320 BLAKE2B b86e405f2b8e00436045fd409fe19cdde75c797b1192c62a22b5ec75e6b4dc8e874a0f33008dc31562445e4cbe53a992b6f48c684255a6a1ef261e595b8b161f SHA512 fa88beeaae94b6d0cd9b5ba38658d0ffed8004035d7d8a4f95c3d31a709b88b581ae9bd7761333c8e5375c44b8f6be01768b5a3be901163159d7e6c43b71da59
EBUILD compiler-rt-10.0.1.ebuild 2759 BLAKE2B cd3d82e769518251919cbf0ae26aa6f65e471516b6900623ba12decd10a1db2cf790c6e57b5288897ec098489c1d49214b1e4453c420aac23c6296dc5825e0fc SHA512 1e5da6022416bbca99a02200d11ffe9beb41e3c7c08678ee8ddf4190db0b7686b24b1b9703688222f7913118bf1ff3985464a01c5cbe7222313596cb19a50016
-EBUILD compiler-rt-11.0.0.ebuild 3539 BLAKE2B d17b23eba68cc3e70a256e9bc770e9b89fdc292fc91aa48e2f20b4cbe79b0d305cfb4e93682936c5803200e108981d6006579b91d70f3c9da49ffb31c6d07526 SHA512 933e0bfdfe68ee6c020266e999146ea29df634e8c3809a7c213a063af1ec3a63da822157e4be068a768644fd232681f6085adb8f95a4ae834a0df83798e60169
-EBUILD compiler-rt-11.0.1.ebuild 3546 BLAKE2B 99348a1f7c105e8c9f338bdebd436c9c4ceb9876afb0b90b873ab107c27c24f65e5c1676dc3c0e0adb804db7d79495fcda854f351f9ab2720f2c8b1f4f2f9909 SHA512 6f8cd77e9fd4b719cf9f4b1f59b7e9a8e0008caa24bbc6135576f88e3922a75a40bdee85e90275d2fd19e53bc0f8f4402d21c96efc922a75e0d066b3b34bdb50
-EBUILD compiler-rt-11.1.0_rc1.ebuild 3474 BLAKE2B d82405d0c344cd1eb33d45cb8377519111166f67328b39e654ea3ba10d5ee2d96c3bbfac370e58f3afef3b83d046490b5a8c4edbc7080485cf97ea72c9a00ca2 SHA512 270be5b046b5892d6e2d795505e6b869af9f5afc91b05785708377828cf0ab624ce22c01da775bf43c287c647d22732f7638b3455cd55716bd203833cfdd113a
+EBUILD compiler-rt-11.0.0.ebuild 3541 BLAKE2B 27e5660a3f1e9eded0ab935c3f5e3595fc517fc85a31694572d7a2b5e1c05dd7909ffc4952925b5b0815bd58a40c48f7e659e5818f5c2e51ff66a0aaef1eddae SHA512 c0835bf7cd9db1b908af46d5095697fb555948e3324f178bb94b7ae18fe60e20a7d7c42b953e8d1223b5ed767c34360025b534c406ddacf75935f6f8a7d22d15
+EBUILD compiler-rt-11.0.1.ebuild 3548 BLAKE2B 9cbcccff97f631d7f695d05b5418b09b99bf31984a59639271b76251ab5b64d64eb39f5712d06db85f8fe3f830c0edfd88d2d6cbb073736c9d37d2bc359b916b SHA512 187066c07d5e9dc8c8568a568a52d55ecd890a5480f7e7bf499c1bceab025f5a2a68e72ba1b39ec6d1450b6ebc3237acd991f4de6500b2d1b9fdafb27ef288b6
+EBUILD compiler-rt-11.1.0_rc1.ebuild 3476 BLAKE2B ac94a81bc25e034d29fab052b1530fa491c9969a7485fc07db4d9e12f75e4a461d7d4e6592aa921524eae6e956621445fad4a3911a45f93fa1755b86c1d02b6c SHA512 960cc47056ca154df08147f6c4026d455af5b99215f5db3d2d840c25f42bbea0236cdef477946dbaf481bef211fc55350856cb68846ef34fcf58564e21cf66d9
+EBUILD compiler-rt-11.1.0_rc2.ebuild 3476 BLAKE2B ac94a81bc25e034d29fab052b1530fa491c9969a7485fc07db4d9e12f75e4a461d7d4e6592aa921524eae6e956621445fad4a3911a45f93fa1755b86c1d02b6c SHA512 960cc47056ca154df08147f6c4026d455af5b99215f5db3d2d840c25f42bbea0236cdef477946dbaf481bef211fc55350856cb68846ef34fcf58564e21cf66d9
EBUILD compiler-rt-12.0.0.9999.ebuild 3474 BLAKE2B d82405d0c344cd1eb33d45cb8377519111166f67328b39e654ea3ba10d5ee2d96c3bbfac370e58f3afef3b83d046490b5a8c4edbc7080485cf97ea72c9a00ca2 SHA512 270be5b046b5892d6e2d795505e6b869af9f5afc91b05785708377828cf0ab624ce22c01da775bf43c287c647d22732f7638b3455cd55716bd203833cfdd113a
+EBUILD compiler-rt-12.0.0_rc1.ebuild 3474 BLAKE2B d82405d0c344cd1eb33d45cb8377519111166f67328b39e654ea3ba10d5ee2d96c3bbfac370e58f3afef3b83d046490b5a8c4edbc7080485cf97ea72c9a00ca2 SHA512 270be5b046b5892d6e2d795505e6b869af9f5afc91b05785708377828cf0ab624ce22c01da775bf43c287c647d22732f7638b3455cd55716bd203833cfdd113a
+EBUILD compiler-rt-13.0.0.9999.ebuild 3474 BLAKE2B d82405d0c344cd1eb33d45cb8377519111166f67328b39e654ea3ba10d5ee2d96c3bbfac370e58f3afef3b83d046490b5a8c4edbc7080485cf97ea72c9a00ca2 SHA512 270be5b046b5892d6e2d795505e6b869af9f5afc91b05785708377828cf0ab624ce22c01da775bf43c287c647d22732f7638b3455cd55716bd203833cfdd113a
EBUILD compiler-rt-9.0.1.ebuild 2905 BLAKE2B b11b34d97678685ea6885da501993dcbb5a43e775bd438e85b5db8d1027c2aa0d5da4865a7e291e951773ba41f5eee67dafe9dca92433c7523b5741cb348996e SHA512 71d391941c237c752690c696f5d7007b12c1d813ade115b6e46a6d1f8b986549833d411c9880e652049754f129054750ee55fa758ee58d09dde497adf268d060
MISC metadata.xml 333 BLAKE2B 24e417cb7b8ab7730b18a3e1e5e29d008042e4fd53cf1ba3cc9d18719160b0410854ddfae52315c690138e61fb0196015968fa09b98af6470cd8bdecc09205ef SHA512 97daa7452a696b7297c47f5f637a33425f82b51426060a75b3de6bc812f9ddcd3c70ae068bc3e88ce937ab1eb10d59b0ab48a2d2c0397a112b8b6a754e333bdc
diff --git a/sys-libs/compiler-rt/compiler-rt-11.0.0.ebuild b/sys-libs/compiler-rt/compiler-rt-11.0.0.ebuild
index 88873e2d9371..03faac95341f 100644
--- a/sys-libs/compiler-rt/compiler-rt-11.0.0.ebuild
+++ b/sys-libs/compiler-rt/compiler-rt-11.0.0.ebuild
@@ -30,7 +30,7 @@ BDEPEND="
${PYTHON_DEPS}"
PATCHES=(
- "${FILESDIR}/9999/${PN}-prefix-paths.patch"
+ "${FILESDIR}/11.1.0/${PN}-prefix-paths.patch"
)
python_check_deps() {
diff --git a/sys-libs/compiler-rt/compiler-rt-11.0.1.ebuild b/sys-libs/compiler-rt/compiler-rt-11.0.1.ebuild
index 01907446d0fe..a24b2a25ff81 100644
--- a/sys-libs/compiler-rt/compiler-rt-11.0.1.ebuild
+++ b/sys-libs/compiler-rt/compiler-rt-11.0.1.ebuild
@@ -32,7 +32,7 @@ LLVM_COMPONENTS=( compiler-rt )
llvm.org_set_globals
PATCHES=(
- "${FILESDIR}/9999/${PN}-prefix-paths.patch"
+ "${FILESDIR}/11.1.0/${PN}-prefix-paths.patch"
)
python_check_deps() {
diff --git a/sys-libs/compiler-rt/compiler-rt-11.1.0_rc1.ebuild b/sys-libs/compiler-rt/compiler-rt-11.1.0_rc1.ebuild
index 07412646ab2a..fb43d386c332 100644
--- a/sys-libs/compiler-rt/compiler-rt-11.1.0_rc1.ebuild
+++ b/sys-libs/compiler-rt/compiler-rt-11.1.0_rc1.ebuild
@@ -32,7 +32,7 @@ LLVM_COMPONENTS=( compiler-rt )
llvm.org_set_globals
PATCHES=(
- "${FILESDIR}/9999/${PN}-prefix-paths.patch"
+ "${FILESDIR}/11.1.0/${PN}-prefix-paths.patch"
)
python_check_deps() {
diff --git a/sys-libs/compiler-rt/compiler-rt-11.1.0_rc2.ebuild b/sys-libs/compiler-rt/compiler-rt-11.1.0_rc2.ebuild
new file mode 100644
index 000000000000..fb43d386c332
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-11.1.0_rc2.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
+SLOT="$(ver_cut 1-3)"
+KEYWORDS=""
+IUSE="+clang test"
+RESTRICT="!test? ( test ) !clang? ( test )"
+
+CLANG_SLOT=${SLOT%%.*}
+# llvm-6 for new lit options
+DEPEND="
+ >=sys-devel/llvm-6"
+BDEPEND="
+ >=dev-util/cmake-3.16
+ clang? ( sys-devel/clang )
+ test? (
+ $(python_gen_any_dep ">=dev-python/lit-9.0.1[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${CLANG_SLOT}
+ )
+ ${PYTHON_DEPS}"
+
+LLVM_COMPONENTS=( compiler-rt )
+llvm.org_set_globals
+
+PATCHES=(
+ "${FILESDIR}/11.1.0/${PN}-prefix-paths.patch"
+)
+
+python_check_deps() {
+ use test || return 0
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+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() {
+ # Darwin Prefix builds do not have llvm installed yet, so rely on
+ # bootstrap-prefix to set the appropriate path vars to LLVM instead
+ # of using llvm_pkg_setup.
+ if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
+ llvm_pkg_setup
+ fi
+ 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++
+ strip-unsupported-flags
+ # ensure we can use clang before installing compiler-rt
+ local -x LDFLAGS="${LDFLAGS} ${nolib_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
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then
+ mycmakeargs+=(
+ # setting -isysroot is disabled with compiler-rt-prefix-paths.patch
+ # this allows adding arm64 support using SDK in EPREFIX
+ -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk"
+ # Set version based on the SDK in EPREFIX.
+ # This disables i386 for SDK >= 10.15
+ -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')"
+ # Use our libtool instead of looking it up with xcrun
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+ )
+ fi
+
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+
+ -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang++"
+ )
+ fi
+
+ cmake_src_configure
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake_build check-builtins
+}
diff --git a/sys-libs/compiler-rt/compiler-rt-12.0.0_rc1.ebuild b/sys-libs/compiler-rt/compiler-rt-12.0.0_rc1.ebuild
new file mode 100644
index 000000000000..07412646ab2a
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-12.0.0_rc1.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
+SLOT="$(ver_cut 1-3)"
+KEYWORDS=""
+IUSE="+clang test"
+RESTRICT="!test? ( test ) !clang? ( test )"
+
+CLANG_SLOT=${SLOT%%.*}
+# llvm-6 for new lit options
+DEPEND="
+ >=sys-devel/llvm-6"
+BDEPEND="
+ >=dev-util/cmake-3.16
+ clang? ( sys-devel/clang )
+ test? (
+ $(python_gen_any_dep ">=dev-python/lit-9.0.1[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${CLANG_SLOT}
+ )
+ ${PYTHON_DEPS}"
+
+LLVM_COMPONENTS=( compiler-rt )
+llvm.org_set_globals
+
+PATCHES=(
+ "${FILESDIR}/9999/${PN}-prefix-paths.patch"
+)
+
+python_check_deps() {
+ use test || return 0
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+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() {
+ # Darwin Prefix builds do not have llvm installed yet, so rely on
+ # bootstrap-prefix to set the appropriate path vars to LLVM instead
+ # of using llvm_pkg_setup.
+ if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
+ llvm_pkg_setup
+ fi
+ 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++
+ strip-unsupported-flags
+ # ensure we can use clang before installing compiler-rt
+ local -x LDFLAGS="${LDFLAGS} ${nolib_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
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then
+ mycmakeargs+=(
+ # setting -isysroot is disabled with compiler-rt-prefix-paths.patch
+ # this allows adding arm64 support using SDK in EPREFIX
+ -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk"
+ # Set version based on the SDK in EPREFIX.
+ # This disables i386 for SDK >= 10.15
+ -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')"
+ # Use our libtool instead of looking it up with xcrun
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+ )
+ fi
+
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+
+ -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang++"
+ )
+ fi
+
+ cmake_src_configure
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake_build check-builtins
+}
diff --git a/sys-libs/compiler-rt/compiler-rt-13.0.0.9999.ebuild b/sys-libs/compiler-rt/compiler-rt-13.0.0.9999.ebuild
new file mode 100644
index 000000000000..07412646ab2a
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-13.0.0.9999.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
+SLOT="$(ver_cut 1-3)"
+KEYWORDS=""
+IUSE="+clang test"
+RESTRICT="!test? ( test ) !clang? ( test )"
+
+CLANG_SLOT=${SLOT%%.*}
+# llvm-6 for new lit options
+DEPEND="
+ >=sys-devel/llvm-6"
+BDEPEND="
+ >=dev-util/cmake-3.16
+ clang? ( sys-devel/clang )
+ test? (
+ $(python_gen_any_dep ">=dev-python/lit-9.0.1[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${CLANG_SLOT}
+ )
+ ${PYTHON_DEPS}"
+
+LLVM_COMPONENTS=( compiler-rt )
+llvm.org_set_globals
+
+PATCHES=(
+ "${FILESDIR}/9999/${PN}-prefix-paths.patch"
+)
+
+python_check_deps() {
+ use test || return 0
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+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() {
+ # Darwin Prefix builds do not have llvm installed yet, so rely on
+ # bootstrap-prefix to set the appropriate path vars to LLVM instead
+ # of using llvm_pkg_setup.
+ if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
+ llvm_pkg_setup
+ fi
+ 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++
+ strip-unsupported-flags
+ # ensure we can use clang before installing compiler-rt
+ local -x LDFLAGS="${LDFLAGS} ${nolib_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
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then
+ mycmakeargs+=(
+ # setting -isysroot is disabled with compiler-rt-prefix-paths.patch
+ # this allows adding arm64 support using SDK in EPREFIX
+ -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk"
+ # Set version based on the SDK in EPREFIX.
+ # This disables i386 for SDK >= 10.15
+ -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')"
+ # Use our libtool instead of looking it up with xcrun
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+ )
+ fi
+
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+
+ -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang++"
+ )
+ fi
+
+ cmake_src_configure
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake_build check-builtins
+}
diff --git a/sys-libs/compiler-rt/files/11.1.0/compiler-rt-prefix-paths.patch b/sys-libs/compiler-rt/files/11.1.0/compiler-rt-prefix-paths.patch
new file mode 100644
index 000000000000..c27e3c44f684
--- /dev/null
+++ b/sys-libs/compiler-rt/files/11.1.0/compiler-rt-prefix-paths.patch
@@ -0,0 +1,79 @@
+--- a/compiler-rt/cmake/config-ix.cmake 2020-10-07 05:10:48.000000000 -0500
++++ b/compiler-rt/cmake/config-ix.cmake 2020-12-13 16:17:43.000000000 -0600
+@@ -424,10 +424,7 @@
+ ${DARWIN_COMMON_LINK_FLAGS}
+ ${DARWIN_osx_MIN_VER_FLAG}=${SANITIZER_MIN_OSX_VERSION})
+
+- if(DARWIN_osx_SYSROOT)
+- list(APPEND DARWIN_osx_CFLAGS -isysroot ${DARWIN_osx_SYSROOT})
+- list(APPEND DARWIN_osx_LINK_FLAGS -isysroot ${DARWIN_osx_SYSROOT})
+- endif()
++ # Do not add -isysroot flag on Gentoo Prefix (search paths handled by cmake)
+
+ # Figure out which arches to use for each OS
+ darwin_get_toolchain_supported_archs(toolchain_arches)
+--- a/compiler-rt/cmake/base-config-ix.cmake 2020-12-13 16:17:13.000000000 -0600
++++ b/compiler-rt/cmake/base-config-ix.cmake 2020-12-13 16:18:59.000000000 -0600
+@@ -102,23 +102,8 @@
+ endif()
+
+ if(APPLE)
+- # On Darwin if /usr/include/c++ doesn't exist, the user probably has Xcode but
+- # not the command line tools (or is using macOS 10.14 or newer). If this is
+- # the case, we need to find the OS X sysroot to pass to clang.
+- if(NOT EXISTS /usr/include/c++)
+- execute_process(COMMAND xcrun -sdk macosx --show-sdk-path
+- OUTPUT_VARIABLE OSX_SYSROOT
+- ERROR_QUIET
+- OUTPUT_STRIP_TRAILING_WHITESPACE)
+- if (NOT OSX_SYSROOT OR NOT EXISTS ${OSX_SYSROOT})
+- message(WARNING "Detected OSX_SYSROOT ${OSX_SYSROOT} does not exist")
+- else()
+- message(STATUS "Found OSX_SYSROOT: ${OSX_SYSROOT}")
+- set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}")
+- endif()
+- else()
+- set(OSX_SYSROOT_FLAG "")
+- endif()
++ # Do not add -isysroot flag on Gentoo Prefix (search paths handled by cmake)
++ set(OSX_SYSROOT_FLAG "")
+
+ option(COMPILER_RT_ENABLE_IOS "Enable building for iOS" On)
+ option(COMPILER_RT_ENABLE_WATCHOS "Enable building for watchOS - Experimental" Off)
+--- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake 2020-10-07 05:10:48.000000000 -0500
++++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake 2020-12-13 16:21:32.000000000 -0600
+@@ -273,7 +273,8 @@
+ ${ARGN})
+ set(libname "${name}.${suffix}_${LIB_ARCH}_${LIB_OS}")
+ add_library(${libname} STATIC ${LIB_SOURCES})
+- if(DARWIN_${LIB_OS}_SYSROOT)
++ # Do not add -isysroot flag on Gentoo Prefix (search paths handled by cmake)
++ if(DARWIN_${LIB_OS}_SYSROOT AND NOT "${LIB_OS}" STREQUAL "osx")
+ set(sysroot_flag -isysroot ${DARWIN_${LIB_OS}_SYSROOT})
+ endif()
+
+--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake 2020-10-07 05:10:48.000000000 -0500
++++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake 2020-12-13 18:12:27.000000000 -0600
+@@ -277,9 +277,10 @@
+ if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET)
+ list(APPEND extra_cflags_${libname} "--target=${CMAKE_C_COMPILER_TARGET}")
+ endif()
++ # Do not add --sysroot flag on Gentoo Prefix (search paths handled by cmake)
+- if(CMAKE_SYSROOT)
++ if(CMAKE_SYSROOT AND NOT APPLE)
+ list(APPEND extra_cflags_${libname} "--sysroot=${CMAKE_SYSROOT}")
+ endif()
+ string(REPLACE ";" " " extra_cflags_${libname} "${extra_cflags_${libname}}")
+ string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions
+ ${CMAKE_C_COMPILE_OBJECT})
+--- a/compiler-rt/lib/tsan/CMakeLists.txt 2020-12-13 19:42:02.000000000 -0600
++++ b/compiler-rt/lib/tsan/CMakeLists.txt 2020-12-13 19:42:38.000000000 -0600
+@@ -244,6 +244,7 @@
+ # and Clang's versions. As a workaround do not use --sysroot=. on FreeBSD/NetBSD
+ # until this is addressed.
+ if(COMPILER_RT_HAS_SYSROOT_FLAG AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD"
++ AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin"
+ AND NOT CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+ file(GLOB _tsan_generic_sources rtl/tsan*)
+ file(GLOB _tsan_platform_sources rtl/tsan*posix* rtl/tsan*mac*
+
diff --git a/sys-libs/compiler-rt/files/9999/compiler-rt-prefix-paths.patch b/sys-libs/compiler-rt/files/9999/compiler-rt-prefix-paths.patch
index c27e3c44f684..e69de29bb2d1 100644
--- a/sys-libs/compiler-rt/files/9999/compiler-rt-prefix-paths.patch
+++ b/sys-libs/compiler-rt/files/9999/compiler-rt-prefix-paths.patch
@@ -1,79 +0,0 @@
---- a/compiler-rt/cmake/config-ix.cmake 2020-10-07 05:10:48.000000000 -0500
-+++ b/compiler-rt/cmake/config-ix.cmake 2020-12-13 16:17:43.000000000 -0600
-@@ -424,10 +424,7 @@
- ${DARWIN_COMMON_LINK_FLAGS}
- ${DARWIN_osx_MIN_VER_FLAG}=${SANITIZER_MIN_OSX_VERSION})
-
-- if(DARWIN_osx_SYSROOT)
-- list(APPEND DARWIN_osx_CFLAGS -isysroot ${DARWIN_osx_SYSROOT})
-- list(APPEND DARWIN_osx_LINK_FLAGS -isysroot ${DARWIN_osx_SYSROOT})
-- endif()
-+ # Do not add -isysroot flag on Gentoo Prefix (search paths handled by cmake)
-
- # Figure out which arches to use for each OS
- darwin_get_toolchain_supported_archs(toolchain_arches)
---- a/compiler-rt/cmake/base-config-ix.cmake 2020-12-13 16:17:13.000000000 -0600
-+++ b/compiler-rt/cmake/base-config-ix.cmake 2020-12-13 16:18:59.000000000 -0600
-@@ -102,23 +102,8 @@
- endif()
-
- if(APPLE)
-- # On Darwin if /usr/include/c++ doesn't exist, the user probably has Xcode but
-- # not the command line tools (or is using macOS 10.14 or newer). If this is
-- # the case, we need to find the OS X sysroot to pass to clang.
-- if(NOT EXISTS /usr/include/c++)
-- execute_process(COMMAND xcrun -sdk macosx --show-sdk-path
-- OUTPUT_VARIABLE OSX_SYSROOT
-- ERROR_QUIET
-- OUTPUT_STRIP_TRAILING_WHITESPACE)
-- if (NOT OSX_SYSROOT OR NOT EXISTS ${OSX_SYSROOT})
-- message(WARNING "Detected OSX_SYSROOT ${OSX_SYSROOT} does not exist")
-- else()
-- message(STATUS "Found OSX_SYSROOT: ${OSX_SYSROOT}")
-- set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}")
-- endif()
-- else()
-- set(OSX_SYSROOT_FLAG "")
-- endif()
-+ # Do not add -isysroot flag on Gentoo Prefix (search paths handled by cmake)
-+ set(OSX_SYSROOT_FLAG "")
-
- option(COMPILER_RT_ENABLE_IOS "Enable building for iOS" On)
- option(COMPILER_RT_ENABLE_WATCHOS "Enable building for watchOS - Experimental" Off)
---- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake 2020-10-07 05:10:48.000000000 -0500
-+++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake 2020-12-13 16:21:32.000000000 -0600
-@@ -273,7 +273,8 @@
- ${ARGN})
- set(libname "${name}.${suffix}_${LIB_ARCH}_${LIB_OS}")
- add_library(${libname} STATIC ${LIB_SOURCES})
-- if(DARWIN_${LIB_OS}_SYSROOT)
-+ # Do not add -isysroot flag on Gentoo Prefix (search paths handled by cmake)
-+ if(DARWIN_${LIB_OS}_SYSROOT AND NOT "${LIB_OS}" STREQUAL "osx")
- set(sysroot_flag -isysroot ${DARWIN_${LIB_OS}_SYSROOT})
- endif()
-
---- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake 2020-10-07 05:10:48.000000000 -0500
-+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake 2020-12-13 18:12:27.000000000 -0600
-@@ -277,9 +277,10 @@
- if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET)
- list(APPEND extra_cflags_${libname} "--target=${CMAKE_C_COMPILER_TARGET}")
- endif()
-+ # Do not add --sysroot flag on Gentoo Prefix (search paths handled by cmake)
-- if(CMAKE_SYSROOT)
-+ if(CMAKE_SYSROOT AND NOT APPLE)
- list(APPEND extra_cflags_${libname} "--sysroot=${CMAKE_SYSROOT}")
- endif()
- string(REPLACE ";" " " extra_cflags_${libname} "${extra_cflags_${libname}}")
- string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions
- ${CMAKE_C_COMPILE_OBJECT})
---- a/compiler-rt/lib/tsan/CMakeLists.txt 2020-12-13 19:42:02.000000000 -0600
-+++ b/compiler-rt/lib/tsan/CMakeLists.txt 2020-12-13 19:42:38.000000000 -0600
-@@ -244,6 +244,7 @@
- # and Clang's versions. As a workaround do not use --sysroot=. on FreeBSD/NetBSD
- # until this is addressed.
- if(COMPILER_RT_HAS_SYSROOT_FLAG AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD"
-+ AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin"
- AND NOT CMAKE_SYSTEM_NAME MATCHES "NetBSD")
- file(GLOB _tsan_generic_sources rtl/tsan*)
- file(GLOB _tsan_platform_sources rtl/tsan*posix* rtl/tsan*mac*
-