From d99093fb4bb5652015c06274d64083daa2439e4f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 3 Mar 2021 10:28:17 +0000 Subject: gentoo resync : 03.03.2021 --- sys-libs/compiler-rt-sanitizers/Manifest | 16 +- .../compiler-rt-sanitizers-11.0.1.ebuild | 13 +- .../compiler-rt-sanitizers-11.1.0.ebuild | 206 +++++++++++++++++++++ .../compiler-rt-sanitizers-11.1.0_rc1.ebuild | 201 -------------------- .../compiler-rt-sanitizers-11.1.0_rc2.ebuild | 201 -------------------- .../compiler-rt-sanitizers-11.1.0_rc3.ebuild | 201 -------------------- .../compiler-rt-sanitizers-12.0.0.9999.ebuild | 11 +- .../compiler-rt-sanitizers-12.0.0_rc2.ebuild | 203 ++++++++++++++++++++ .../compiler-rt-sanitizers-13.0.0.9999.ebuild | 11 +- 9 files changed, 441 insertions(+), 622 deletions(-) create mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0.ebuild delete mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc1.ebuild delete mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc2.ebuild delete mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc3.ebuild create mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0_rc2.ebuild (limited to 'sys-libs/compiler-rt-sanitizers') diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest index 4c4c2afbd818..69ac3b0d189e 100644 --- a/sys-libs/compiler-rt-sanitizers/Manifest +++ b/sys-libs/compiler-rt-sanitizers/Manifest @@ -4,20 +4,18 @@ AUX 9999/compiler-rt-prefix-paths.patch 0 BLAKE2B 786a02f742015903c6c6fd852552d2 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-11.1.0-rc3.tar.gz 122785838 BLAKE2B d0998219471476be1a1249b3a2444750585a352047d4dc14de6fec87eb3407d0f4b848757340200d3423cb4090554ae033fb4ec3797446e46556fbb566bb77a3 SHA512 b67874cb127f3f929a3796558cdfbf509b384c4247f4936ba08cecf88ca880a167cf67c23d78104b5bab4a98efd9435d1b923deb7ae7367875414e6c896957d1 +DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81 DIST llvmorg-12.0.0-rc1.tar.gz 134164708 BLAKE2B d4261ff7d9586b47f4cfda3d2cda4b76534f9e17fbd5cdb8861895b8eb466021962f4608bfcdeb52f8fce78850a994fd5eda0560f7211e5c8d1ac9330a738a36 SHA512 3d07d013d0705bb99f56898cc55d054d0d95aeb53b3c756cfab80b4c9097cc4935bcea89b9efde2e503a899b9fccf0dacc0073c9991c8ea352755c5ec68a757a +DIST llvmorg-12.0.0-rc2.tar.gz 134242619 BLAKE2B bb741a311db608fc2ba7eeaab71c5c9f2a430f7fee3f0c5c4334e5c14caa19738d18c87b568de963d57d9b53e808ac412cf8554eca7fcae9ecca65aa4442e197 SHA512 d8f9b3dfeb0fe9b91eb7f49da393784333044db2653373fbb168afd3c8d50f3e3ec7a7b8f44df522d0facafbfe4cfc4d9e2906d19f1e6feb0bdc569b6c10a17d DIST llvmorg-9.0.1.tar.gz 113193320 BLAKE2B b86e405f2b8e00436045fd409fe19cdde75c797b1192c62a22b5ec75e6b4dc8e874a0f33008dc31562445e4cbe53a992b6f48c684255a6a1ef261e595b8b161f SHA512 fa88beeaae94b6d0cd9b5ba38658d0ffed8004035d7d8a4f95c3d31a709b88b581ae9bd7761333c8e5375c44b8f6be01768b5a3be901163159d7e6c43b71da59 EBUILD compiler-rt-sanitizers-10.0.1.ebuild 4490 BLAKE2B 5bbce4ab70e2b1434698eae6a37c529c7ffa58ae90236c0ddef3023a00cf1bb6d3ed8b3ae767b81f0abb9759e33fb5e1d9e8f755505db72ceb9cc46f6cb1a179 SHA512 fda208adbbb4fa7e14d3a27956bce3a809c202ecf5eceb0fac956a0ec0879579f8f94f69172cd934481a98d84cdc36ea2fdc46b8ad906dbb48795673d2d7c4eb EBUILD compiler-rt-sanitizers-11.0.0.ebuild 5092 BLAKE2B 243f8ddf60558abf5d1ad9e6a1e31333769d1e0e33ff401c915b243297583de8f21be8ab15605a2744a981ff8cd0d1ba760aafc7bc13c43586a901b6050fd0a6 SHA512 04af5692fd79ba8fe51d69664d09f4c2ef2546559a5e5538363d22dbfb791e0f313ce289fdb56dcbfd116e399a3d34dab293a1f355acaf6700bb3003bd50e729 -EBUILD compiler-rt-sanitizers-11.0.1.ebuild 5999 BLAKE2B 197cc312533b0bfa139951b18537b0389bcaf22ceeeb612f7322991f9c943b8048bdad26f0af8a431d930f22182cc3443d96998616d0f7e7c1d230fba692cbce SHA512 d9c3e47605083dba763dcf39d0695595be5ad040dfa906e176b55eff5e46e65977a6410639bad0accf3ae68a5c181b92dd95afb471546f512f364860e0428438 -EBUILD compiler-rt-sanitizers-11.1.0_rc1.ebuild 5927 BLAKE2B de51230775d0ad64fffe4f0c7d6c3ae42cef8816fb1175ff139b22488d2bcf47dc8a1f5b68020a6d8df15064f6da3d4931b9b3af9dc4d1ef55071c3254088bbf SHA512 6fbd9393988c86f9f9f2ce6a6bf9a6661591e92aac943b04622b3889b405d6a25de5f734753aa0f8078fede534d9cd6e2daa8ebbbe5d4b6e96ef2121d44493bc -EBUILD compiler-rt-sanitizers-11.1.0_rc2.ebuild 5927 BLAKE2B de51230775d0ad64fffe4f0c7d6c3ae42cef8816fb1175ff139b22488d2bcf47dc8a1f5b68020a6d8df15064f6da3d4931b9b3af9dc4d1ef55071c3254088bbf SHA512 6fbd9393988c86f9f9f2ce6a6bf9a6661591e92aac943b04622b3889b405d6a25de5f734753aa0f8078fede534d9cd6e2daa8ebbbe5d4b6e96ef2121d44493bc -EBUILD compiler-rt-sanitizers-11.1.0_rc3.ebuild 5927 BLAKE2B de51230775d0ad64fffe4f0c7d6c3ae42cef8816fb1175ff139b22488d2bcf47dc8a1f5b68020a6d8df15064f6da3d4931b9b3af9dc4d1ef55071c3254088bbf SHA512 6fbd9393988c86f9f9f2ce6a6bf9a6661591e92aac943b04622b3889b405d6a25de5f734753aa0f8078fede534d9cd6e2daa8ebbbe5d4b6e96ef2121d44493bc -EBUILD compiler-rt-sanitizers-12.0.0.9999.ebuild 5843 BLAKE2B 8d0cefba3aab132af0df86fbfc47369e5029929fd5ec0cd3b4bde3387f5fd8380b5273ee28b8217ff05691c868038decd172c94f5685b7c6c1b2e4962e1cab19 SHA512 0ea473d719537bf29f899674a6cb41b988799a5e4c96adeb87ed5a7efe4ce63dbb488f5157fe91194963fb761597b0109640e9577c10d92bed92e81babbe2045 +EBUILD compiler-rt-sanitizers-11.0.1.ebuild 6080 BLAKE2B b276c7e47eea0a950ceb0aaac11beea427cc91e7c91adde1181fdf47e0aaa454ff9ede64ca3f9cf348a8e80336e916c26faf3c4318a42fc30d0a2f3856104c3a SHA512 75dc8e9bc49d82e5a1aeb2ff1b385095e9372200feeb8f3e0ffa2425f638ba89017b4a0262b57e6f24484ec39e35c3225def76f3330bada56cbcdffcbaf0e768 +EBUILD compiler-rt-sanitizers-11.1.0.ebuild 6084 BLAKE2B 3c3ae974c0f1e9fea3ea102c8108c11b906db7a318af1210ef0b13e3b34cd7352d8645edbb5346b6b8b4f814f28449b3d0d0bbd397717ef00701d73b2dac8130 SHA512 7a24a080c33fcf574906d10e332a3faedb94853bce6c667b9afa6a1b4b59164e014aa9cca533dac8fedb1c6a666eb3cff8ed8211b84f03666aa49ac1f4bcf542 +EBUILD compiler-rt-sanitizers-12.0.0.9999.ebuild 5928 BLAKE2B bb7e0bfb84cd7aa447eab7f0ac79d611b65ddfcafa4539a48a73fc4430178369e5be362bd7f3a2c5a9db9cc7a6b0ed815fd3b45553a06cc1c47493adf4902f8c SHA512 8c7d54a81388e13cea8d72c1cdd9f9828b184e05d06da547ddf90c3a2a23da7dad22805559fd9573f88fa91e21d6dfddd59b1c83f00002a31c590c023fe6869f EBUILD compiler-rt-sanitizers-12.0.0_rc1.ebuild 5843 BLAKE2B 8d0cefba3aab132af0df86fbfc47369e5029929fd5ec0cd3b4bde3387f5fd8380b5273ee28b8217ff05691c868038decd172c94f5685b7c6c1b2e4962e1cab19 SHA512 0ea473d719537bf29f899674a6cb41b988799a5e4c96adeb87ed5a7efe4ce63dbb488f5157fe91194963fb761597b0109640e9577c10d92bed92e81babbe2045 -EBUILD compiler-rt-sanitizers-13.0.0.9999.ebuild 5843 BLAKE2B 8d0cefba3aab132af0df86fbfc47369e5029929fd5ec0cd3b4bde3387f5fd8380b5273ee28b8217ff05691c868038decd172c94f5685b7c6c1b2e4962e1cab19 SHA512 0ea473d719537bf29f899674a6cb41b988799a5e4c96adeb87ed5a7efe4ce63dbb488f5157fe91194963fb761597b0109640e9577c10d92bed92e81babbe2045 +EBUILD compiler-rt-sanitizers-12.0.0_rc2.ebuild 5928 BLAKE2B bb7e0bfb84cd7aa447eab7f0ac79d611b65ddfcafa4539a48a73fc4430178369e5be362bd7f3a2c5a9db9cc7a6b0ed815fd3b45553a06cc1c47493adf4902f8c SHA512 8c7d54a81388e13cea8d72c1cdd9f9828b184e05d06da547ddf90c3a2a23da7dad22805559fd9573f88fa91e21d6dfddd59b1c83f00002a31c590c023fe6869f +EBUILD compiler-rt-sanitizers-13.0.0.9999.ebuild 5928 BLAKE2B bb7e0bfb84cd7aa447eab7f0ac79d611b65ddfcafa4539a48a73fc4430178369e5be362bd7f3a2c5a9db9cc7a6b0ed815fd3b45553a06cc1c47493adf4902f8c SHA512 8c7d54a81388e13cea8d72c1cdd9f9828b184e05d06da547ddf90c3a2a23da7dad22805559fd9573f88fa91e21d6dfddd59b1c83f00002a31c590c023fe6869f EBUILD compiler-rt-sanitizers-9.0.1-r1.ebuild 4882 BLAKE2B 049a170fef22592067cf1d0e01a2100ae795b121c6d3f2479a42d3f5d3dcdf1042a4ce7bbb10670ac9b969735e3bd858ea09e707d83e1e35eb0bf91d07d37e01 SHA512 0549bab838b9aa14fc250d93ab72f3529f6f9b41fae0445c898a06e05d09172e8481738be578cc17ee1a391764cad21666e78398a2ee4e7cb70049bdb2b5604e EBUILD compiler-rt-sanitizers-9.0.1.ebuild 4832 BLAKE2B 0f7203aa7d3925dd46ca9960fb18db39fe94915a194747a42f93b8a5d0061d975b6ffffc915f137688cd6d8e8463afd74728669712521e68561953d48ea361ac SHA512 90b3fa36860b4310a28b4f968beb0a60dd7a91daad217c22df3f716907487cf1bf07f3a1fcf99767a45ab3722d9da8eb1daa4e35d6ebc0899a6769ff3e03a400 MISC metadata.xml 1341 BLAKE2B d850193d6899816f33ec45aa714a9edcc04c668832a4148881ada810565cab45066e61d5b365b15ced7864220ce51cde31a559e4dadb83dc935955c9a68389ec SHA512 9fd1c971444f1d6dbd0b0559308a269385b0842767d97d3619b20b300569165cd807e52412d36d6ca9427a5fd5788ae5a19ef7d5c1b47cc73cc4eccf20b3fee7 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.ebuild index 5ae20f93336f..d139a2006ac3 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.ebuild @@ -11,7 +11,7 @@ HOMEPAGE="https://llvm.org/" LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" SLOT="$(ver_cut 1-3)" -KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86 ~amd64-linux ~ppc-macos ~x64-macos" +KEYWORDS="amd64 arm arm64 ~ppc64 ~riscv x86 ~amd64-linux ~ppc-macos ~x64-macos" IUSE="+clang test elibc_glibc" # base targets IUSE+=" +libfuzzer +profile +xray" @@ -24,8 +24,10 @@ SANITIZER_FLAGS=( IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" REQUIRED_USE=" || ( ${SANITIZER_FLAGS[*]} libfuzzer profile xray ) - gwp-asan? ( scudo ) - ubsan? ( cfi )" + test? ( + cfi? ( ubsan ) + gwp-asan? ( scudo ) + )" RESTRICT="!test? ( test ) !clang? ( test )" CLANG_SLOT=${SLOT%%.*} @@ -86,10 +88,13 @@ src_prepare() { fi done + # TODO: fix these tests to be skipped upstream if use asan && ! use profile; then - # TODO: fix these tests to be skipped upstream rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die fi + if use ubsan && ! use cfi; then + > test/cfi/CMakeLists.txt || die + fi # broken with new glibc sed -i -e '/EXPECT_EQ.*ThreadDescriptorSize/d' \ diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0.ebuild new file mode 100644 index 000000000000..c877ae4241f1 --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0.ebuild @@ -0,0 +1,206 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..9} ) +inherit check-reqs cmake flag-o-matic llvm llvm.org python-any-r1 + +DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" +HOMEPAGE="https://llvm.org/" + +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" +SLOT="$(ver_cut 1-3)" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86 ~amd64-linux ~ppc-macos ~x64-macos" +IUSE="+clang test elibc_glibc" +# base targets +IUSE+=" +libfuzzer +profile +xray" +# sanitizer targets, keep in sync with config-ix.cmake +# NB: ubsan, scudo deliberately match two entries +SANITIZER_FLAGS=( + asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo + shadowcallstack gwp-asan +) +IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" +REQUIRED_USE=" + || ( ${SANITIZER_FLAGS[*]} libfuzzer profile xray ) + test? ( + cfi? ( ubsan ) + gwp-asan? ( scudo ) + )" +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 ) + elibc_glibc? ( net-libs/libtirpc ) + test? ( + !=dev-python/lit-5[\${PYTHON_USEDEP}]") + =sys-devel/clang-${PV%_*}*:${CLANG_SLOT} + sys-libs/compiler-rt:${SLOT} + ) + ${PYTHON_DEPS}" + +LLVM_COMPONENTS=( compiler-rt ) +LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) +llvm.org_set_globals + +PATCHES=( + "${FILESDIR}/11.1.0/compiler-rt-prefix-paths.patch" +) + +python_check_deps() { + use test || return 0 + has_version "dev-python/lit[${PYTHON_USEDEP}]" +} + +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() { + sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die + + local flag + for flag in "${SANITIZER_FLAGS[@]}"; do + if ! use "${flag}"; then + local cmake_flag=${flag/-/_} + sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \ + cmake/config-ix.cmake || die + fi + done + + # TODO: fix these tests to be skipped upstream + if use asan && ! use profile; then + rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die + fi + if use ubsan && ! use cfi; then + > test/cfi/CMakeLists.txt || die + fi + + # broken with new glibc + sed -i -e '/EXPECT_EQ.*ThreadDescriptorSize/d' \ + lib/sanitizer_common/tests/sanitizer_linux_test.cpp || die + + llvm.org_src_prepare +} + +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 flag want_sanitizer=OFF + for flag in "${SANITIZER_FLAGS[@]}"; do + if use "${flag}"; then + want_sanitizer=ON + break + fi + done + + 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="${want_sanitizer}" + -DCOMPILER_RT_BUILD_XRAY=$(usex xray) + + -DPython3_EXECUTABLE="${PYTHON}" + ) + if use test; then + mycmakeargs+=( + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" + -DLLVM_LIT_ARGS="$(get_lit_flags)" + + # 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+=( + # 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 + # Will error if has_use tsan and SDK < 10.12 + -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 + + cmake_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_build check-all +} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc1.ebuild deleted file mode 100644 index 8521018ff283..000000000000 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc1.ebuild +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7..9} ) -inherit check-reqs cmake flag-o-matic llvm llvm.org python-any-r1 - -DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" -HOMEPAGE="https://llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="$(ver_cut 1-3)" -KEYWORDS="" -IUSE="+clang test elibc_glibc" -# base targets -IUSE+=" +libfuzzer +profile +xray" -# sanitizer targets, keep in sync with config-ix.cmake -# NB: ubsan, scudo deliberately match two entries -SANITIZER_FLAGS=( - asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo - shadowcallstack gwp-asan -) -IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" -REQUIRED_USE=" - || ( ${SANITIZER_FLAGS[*]} libfuzzer profile xray ) - gwp-asan? ( scudo ) - ubsan? ( cfi )" -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 ) - elibc_glibc? ( net-libs/libtirpc ) - test? ( - !=dev-python/lit-5[\${PYTHON_USEDEP}]") - =sys-devel/clang-${PV%_*}*:${CLANG_SLOT} - sys-libs/compiler-rt:${SLOT} - ) - ${PYTHON_DEPS}" - -LLVM_COMPONENTS=( compiler-rt ) -LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) -llvm.org_set_globals - -PATCHES=( - "${FILESDIR}/11.1.0/compiler-rt-prefix-paths.patch" -) - -python_check_deps() { - use test || return 0 - has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -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() { - sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die - - local flag - for flag in "${SANITIZER_FLAGS[@]}"; do - if ! use "${flag}"; then - local cmake_flag=${flag/-/_} - sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \ - cmake/config-ix.cmake || die - fi - done - - if use asan && ! use profile; then - # TODO: fix these tests to be skipped upstream - rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die - fi - - # broken with new glibc - sed -i -e '/EXPECT_EQ.*ThreadDescriptorSize/d' \ - lib/sanitizer_common/tests/sanitizer_linux_test.cpp || die - - llvm.org_src_prepare -} - -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 flag want_sanitizer=OFF - for flag in "${SANITIZER_FLAGS[@]}"; do - if use "${flag}"; then - want_sanitizer=ON - break - fi - done - - 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="${want_sanitizer}" - -DCOMPILER_RT_BUILD_XRAY=$(usex xray) - - -DPython3_EXECUTABLE="${PYTHON}" - ) - if use test; then - mycmakeargs+=( - -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - - # 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+=( - # 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 - # Will error if has_use tsan and SDK < 10.12 - -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 - - cmake_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_build check-all -} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc2.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc2.ebuild deleted file mode 100644 index 8521018ff283..000000000000 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc2.ebuild +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7..9} ) -inherit check-reqs cmake flag-o-matic llvm llvm.org python-any-r1 - -DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" -HOMEPAGE="https://llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="$(ver_cut 1-3)" -KEYWORDS="" -IUSE="+clang test elibc_glibc" -# base targets -IUSE+=" +libfuzzer +profile +xray" -# sanitizer targets, keep in sync with config-ix.cmake -# NB: ubsan, scudo deliberately match two entries -SANITIZER_FLAGS=( - asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo - shadowcallstack gwp-asan -) -IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" -REQUIRED_USE=" - || ( ${SANITIZER_FLAGS[*]} libfuzzer profile xray ) - gwp-asan? ( scudo ) - ubsan? ( cfi )" -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 ) - elibc_glibc? ( net-libs/libtirpc ) - test? ( - !=dev-python/lit-5[\${PYTHON_USEDEP}]") - =sys-devel/clang-${PV%_*}*:${CLANG_SLOT} - sys-libs/compiler-rt:${SLOT} - ) - ${PYTHON_DEPS}" - -LLVM_COMPONENTS=( compiler-rt ) -LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) -llvm.org_set_globals - -PATCHES=( - "${FILESDIR}/11.1.0/compiler-rt-prefix-paths.patch" -) - -python_check_deps() { - use test || return 0 - has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -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() { - sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die - - local flag - for flag in "${SANITIZER_FLAGS[@]}"; do - if ! use "${flag}"; then - local cmake_flag=${flag/-/_} - sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \ - cmake/config-ix.cmake || die - fi - done - - if use asan && ! use profile; then - # TODO: fix these tests to be skipped upstream - rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die - fi - - # broken with new glibc - sed -i -e '/EXPECT_EQ.*ThreadDescriptorSize/d' \ - lib/sanitizer_common/tests/sanitizer_linux_test.cpp || die - - llvm.org_src_prepare -} - -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 flag want_sanitizer=OFF - for flag in "${SANITIZER_FLAGS[@]}"; do - if use "${flag}"; then - want_sanitizer=ON - break - fi - done - - 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="${want_sanitizer}" - -DCOMPILER_RT_BUILD_XRAY=$(usex xray) - - -DPython3_EXECUTABLE="${PYTHON}" - ) - if use test; then - mycmakeargs+=( - -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - - # 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+=( - # 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 - # Will error if has_use tsan and SDK < 10.12 - -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 - - cmake_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_build check-all -} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc3.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc3.ebuild deleted file mode 100644 index 8521018ff283..000000000000 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.1.0_rc3.ebuild +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7..9} ) -inherit check-reqs cmake flag-o-matic llvm llvm.org python-any-r1 - -DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" -HOMEPAGE="https://llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="$(ver_cut 1-3)" -KEYWORDS="" -IUSE="+clang test elibc_glibc" -# base targets -IUSE+=" +libfuzzer +profile +xray" -# sanitizer targets, keep in sync with config-ix.cmake -# NB: ubsan, scudo deliberately match two entries -SANITIZER_FLAGS=( - asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo - shadowcallstack gwp-asan -) -IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" -REQUIRED_USE=" - || ( ${SANITIZER_FLAGS[*]} libfuzzer profile xray ) - gwp-asan? ( scudo ) - ubsan? ( cfi )" -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 ) - elibc_glibc? ( net-libs/libtirpc ) - test? ( - !=dev-python/lit-5[\${PYTHON_USEDEP}]") - =sys-devel/clang-${PV%_*}*:${CLANG_SLOT} - sys-libs/compiler-rt:${SLOT} - ) - ${PYTHON_DEPS}" - -LLVM_COMPONENTS=( compiler-rt ) -LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) -llvm.org_set_globals - -PATCHES=( - "${FILESDIR}/11.1.0/compiler-rt-prefix-paths.patch" -) - -python_check_deps() { - use test || return 0 - has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -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() { - sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die - - local flag - for flag in "${SANITIZER_FLAGS[@]}"; do - if ! use "${flag}"; then - local cmake_flag=${flag/-/_} - sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \ - cmake/config-ix.cmake || die - fi - done - - if use asan && ! use profile; then - # TODO: fix these tests to be skipped upstream - rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die - fi - - # broken with new glibc - sed -i -e '/EXPECT_EQ.*ThreadDescriptorSize/d' \ - lib/sanitizer_common/tests/sanitizer_linux_test.cpp || die - - llvm.org_src_prepare -} - -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 flag want_sanitizer=OFF - for flag in "${SANITIZER_FLAGS[@]}"; do - if use "${flag}"; then - want_sanitizer=ON - break - fi - done - - 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="${want_sanitizer}" - -DCOMPILER_RT_BUILD_XRAY=$(usex xray) - - -DPython3_EXECUTABLE="${PYTHON}" - ) - if use test; then - mycmakeargs+=( - -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - - # 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+=( - # 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 - # Will error if has_use tsan and SDK < 10.12 - -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 - - cmake_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_build check-all -} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0.9999.ebuild index 5fc5bbc62475..b9f483144cde 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0.9999.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0.9999.ebuild @@ -24,8 +24,10 @@ SANITIZER_FLAGS=( IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" REQUIRED_USE=" || ( ${SANITIZER_FLAGS[*]} libfuzzer profile xray ) - gwp-asan? ( scudo ) - ubsan? ( cfi )" + test? ( + cfi? ( ubsan ) + gwp-asan? ( scudo ) + )" RESTRICT="!test? ( test ) !clang? ( test )" CLANG_SLOT=${SLOT%%.*} @@ -86,10 +88,13 @@ src_prepare() { fi done + # TODO: fix these tests to be skipped upstream if use asan && ! use profile; then - # TODO: fix these tests to be skipped upstream rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die fi + if use ubsan && ! use cfi; then + > test/cfi/CMakeLists.txt || die + fi llvm.org_src_prepare } diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0_rc2.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0_rc2.ebuild new file mode 100644 index 000000000000..b9f483144cde --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0_rc2.ebuild @@ -0,0 +1,203 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..9} ) +inherit check-reqs cmake flag-o-matic llvm llvm.org python-any-r1 + +DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" +HOMEPAGE="https://llvm.org/" + +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" +SLOT="$(ver_cut 1-3)" +KEYWORDS="" +IUSE="+clang test elibc_glibc" +# base targets +IUSE+=" +libfuzzer +memprof +profile +xray" +# sanitizer targets, keep in sync with config-ix.cmake +# NB: ubsan, scudo deliberately match two entries +SANITIZER_FLAGS=( + asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo + shadowcallstack gwp-asan +) +IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" +REQUIRED_USE=" + || ( ${SANITIZER_FLAGS[*]} libfuzzer profile xray ) + test? ( + cfi? ( ubsan ) + gwp-asan? ( scudo ) + )" +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 ) + elibc_glibc? ( net-libs/libtirpc ) + test? ( + !=dev-python/lit-5[\${PYTHON_USEDEP}]") + =sys-devel/clang-${PV%_*}*:${CLANG_SLOT} + sys-libs/compiler-rt:${SLOT} + ) + ${PYTHON_DEPS}" + +LLVM_COMPONENTS=( compiler-rt ) +LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) +llvm.org_set_globals + +PATCHES=( + "${FILESDIR}/9999/compiler-rt-prefix-paths.patch" +) + +python_check_deps() { + use test || return 0 + has_version "dev-python/lit[${PYTHON_USEDEP}]" +} + +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() { + sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die + + local flag + for flag in "${SANITIZER_FLAGS[@]}"; do + if ! use "${flag}"; then + local cmake_flag=${flag/-/_} + sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \ + cmake/config-ix.cmake || die + fi + done + + # TODO: fix these tests to be skipped upstream + if use asan && ! use profile; then + rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die + fi + if use ubsan && ! use cfi; then + > test/cfi/CMakeLists.txt || die + fi + + llvm.org_src_prepare +} + +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 flag want_sanitizer=OFF + for flag in "${SANITIZER_FLAGS[@]}"; do + if use "${flag}"; then + want_sanitizer=ON + break + fi + done + + 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_MEMPROF=$(usex memprof) + -DCOMPILER_RT_BUILD_PROFILE=$(usex profile) + -DCOMPILER_RT_BUILD_SANITIZERS="${want_sanitizer}" + -DCOMPILER_RT_BUILD_XRAY=$(usex xray) + + -DPython3_EXECUTABLE="${PYTHON}" + ) + if use test; then + mycmakeargs+=( + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" + -DLLVM_LIT_ARGS="$(get_lit_flags)" + + # 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+=( + # 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 + # Will error if has_use tsan and SDK < 10.12 + -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 + + cmake_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_build check-all +} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.9999.ebuild index 5fc5bbc62475..b9f483144cde 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.9999.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.9999.ebuild @@ -24,8 +24,10 @@ SANITIZER_FLAGS=( IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" REQUIRED_USE=" || ( ${SANITIZER_FLAGS[*]} libfuzzer profile xray ) - gwp-asan? ( scudo ) - ubsan? ( cfi )" + test? ( + cfi? ( ubsan ) + gwp-asan? ( scudo ) + )" RESTRICT="!test? ( test ) !clang? ( test )" CLANG_SLOT=${SLOT%%.*} @@ -86,10 +88,13 @@ src_prepare() { fi done + # TODO: fix these tests to be skipped upstream if use asan && ! use profile; then - # TODO: fix these tests to be skipped upstream rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die fi + if use ubsan && ! use cfi; then + > test/cfi/CMakeLists.txt || die + fi llvm.org_src_prepare } -- cgit v1.2.3