From 24fd814c326e282c4321965c31f341dad77e270d Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 8 Jan 2021 11:28:34 +0000 Subject: gentoo resync : 08.01.2021 --- sys-libs/compiler-rt-sanitizers/Manifest | 15 +- .../compiler-rt-sanitizers-10.0.1.ebuild | 4 +- .../compiler-rt-sanitizers-11.0.0.ebuild | 4 +- .../compiler-rt-sanitizers-11.0.1.9999.ebuild | 197 -------------------- .../compiler-rt-sanitizers-11.0.1.ebuild | 201 +++++++++++++++++++++ .../compiler-rt-sanitizers-11.0.1_rc1.ebuild | 164 ----------------- .../compiler-rt-sanitizers-11.0.1_rc2.ebuild | 201 --------------------- .../compiler-rt-sanitizers-9.0.1-r1.ebuild | 160 ++++++++++++++++ .../compiler-rt-sanitizers-9.0.1.ebuild | 4 +- .../files/9.0.1/glibc-2.31.patch | 35 ++++ 10 files changed, 409 insertions(+), 576 deletions(-) delete mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.9999.ebuild create mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.ebuild delete mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc1.ebuild delete mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc2.ebuild create mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1-r1.ebuild create mode 100644 sys-libs/compiler-rt-sanitizers/files/9.0.1/glibc-2.31.patch (limited to 'sys-libs/compiler-rt-sanitizers') diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest index 60c08e2987ac..5157589018a4 100644 --- a/sys-libs/compiler-rt-sanitizers/Manifest +++ b/sys-libs/compiler-rt-sanitizers/Manifest @@ -1,14 +1,13 @@ +AUX 9.0.1/glibc-2.31.patch 1728 BLAKE2B 96b52a5c287ad2a561134b6470904fc42c0ea14c6d453871b603048df7e0c9a1edb15624eca06726490d6fd874fa2a80279896f131041e0b70f5c9f672485ae4 SHA512 ca5e8fbff32066d137446fca870e93ad0f51a27621bc4954a1b07205f34332015d00465e644db539d8f35352ec547e027846ccbce36705a27fa758cc2f85a026 AUX 9999/compiler-rt-prefix-paths.patch 3794 BLAKE2B f6e8992658e665bd9cc13bae00c9d7757d01438a73ffd8809be67bbcd1c6d3956e9965890fd84e573c9ef6cc74a7fc7a349e2e5eec21387150c8ef2ae2bf055d SHA512 23a05ce3805678e855be2a4678102e72fe81cb86208357df0dc95b85c7268fe95025603908dd114b27742f39432c4c860859904b287cf52f5a5b337b131bcb9e 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-rc1.tar.gz 122777435 BLAKE2B 23b520d33cf4b641027ee52bb10c6171d60356c9167d5b94012929e6e547c526cda1a6177c295ed19592dfb83b020f63b2cef4cabc70ce9a2a8e098fe654a3cd SHA512 605c7bbff1610f335be8ea4f1204df797fed21185a54c77565f6ff2d00794d1967e9c5fab7c87633e242f2f999bdffb76da83f756d261c1ca476114599409ae1 -DIST llvmorg-11.0.1-rc2.tar.gz 122793330 BLAKE2B 5d42f7bd7ba253ac3ca08cf9901c79db5b51b86f0f66c8e63f4f9808ca5fb72cacccfad098b4f6701a34b0d77bdd66fe3839a3962a251eae53776240a2e13b06 SHA512 acda5a5be38cc8aae730c34cd1bb8f29a82e2ed3dd9734ca293ff092d5b30c8c255ab3054245b8f6ed541d5dbf8bc674b744bb2f81788db8826f69a204dda0c3 +DIST llvmorg-11.0.1.tar.gz 122790338 BLAKE2B 0130996b4a8c4d9f757136fd7fb318068c9bfdc565060dec0d4336480c4ab66c4ae3185a7fdb05f13cf9ee8fd4123b09df938881b75d6e5d3689595114b7e32a SHA512 f5e6ef0b3111aae08a89cd01adb2ff4abfa9ef779c68b9190421d0447efd25c2cc00e5aae9f4764805f5fa31434866043d1510ae7389817e28ae53a5442e2fdf DIST llvmorg-9.0.1.tar.gz 113193320 BLAKE2B b86e405f2b8e00436045fd409fe19cdde75c797b1192c62a22b5ec75e6b4dc8e874a0f33008dc31562445e4cbe53a992b6f48c684255a6a1ef261e595b8b161f SHA512 fa88beeaae94b6d0cd9b5ba38658d0ffed8004035d7d8a4f95c3d31a709b88b581ae9bd7761333c8e5375c44b8f6be01768b5a3be901163159d7e6c43b71da59 -EBUILD compiler-rt-sanitizers-10.0.1.ebuild 4501 BLAKE2B 3a15cc67e7fdbf61e2103ca9e543f936cc6f3221f0f3b7d43788cef7785f5742674ab0325e8c0c5cefe8909cc860a9ff0d42b615c367c1ea736cc745817cd9d0 SHA512 97b6b2b68a6de75e211b5f181d76fcf573f72fef7ff8f49248d03d201c2fec6f7d525c048b5b8b5cdc79c8512948f0ec75d5dbaa286172df929d264956d2c675 -EBUILD compiler-rt-sanitizers-11.0.0.ebuild 5101 BLAKE2B b8734097626239336fb91488b42c0e77ffb1f67cee606b07052e1ec687387ce0064655280c7fc6275c1cd9438600645a5e912d7cfe0c5f6bc937b1964b489c6a SHA512 6ddb85e4cff93c74d25728c0904045b4305e1c18fbeda983b049ac3752083c91bb2ebace3b4917d18cb261a72a96dd58a52d2f3eeb183e8c05ed2786cd52a330 -EBUILD compiler-rt-sanitizers-11.0.1.9999.ebuild 5788 BLAKE2B 3ff53ad32567ced4b380faab967a4f0b2e9c5c97dc9b191d07b1f9e9e7254598f0c44a959d79845cfd730daffe3ca1c2f87158f7634505d30da267b6ab00fe5a SHA512 5738bc9bffed79b039a23cbe0e69cbee0b6ce3d48d58fb8bbd151c67c38495ee403bbd44003c7fff532f7093a27daaa43642e2c1115d1afb33149bc9fc621338 -EBUILD compiler-rt-sanitizers-11.0.1_rc1.ebuild 5022 BLAKE2B bba14304ea9b21170e2996cdce5c30c8795ee264c72ce6de3e1ec19af2fc69576695efc69339b7b1033c48e0fd8dd3713a8e39b3e1dac4eb1738cc84dca343fb SHA512 b622c636519c8c3a106fd146003e5aca00636e0fa0a702bf9a20703b4b0b4325eeaac3aaf5c907adb7383821a9091777b656a00da6dc1f3220a14c5875510723 -EBUILD compiler-rt-sanitizers-11.0.1_rc2.ebuild 5925 BLAKE2B 70a9241c832a0a1fc63306e8265ed40c921d274d51bc2f7a98a9dce61c5bdbf83369d8f7c2265cb47607bcecc06d5a11436e23d8a3a5c7c1479706204a0eaee3 SHA512 9a7dcf40f44fa6134210f39c25180b03b5c229a1e9dd2bbe5b50d55bf723ad291397f47e95a39cdfe17ddf8597a8187297168783c6c1c17f4b0603986aed68b2 +EBUILD compiler-rt-sanitizers-10.0.1.ebuild 4490 BLAKE2B 28571f35471e04346016d4a717f005d0ee36351b1107fed666650783fa4981cf3e12f71db023ee450e395a71bcb7d62f2be26602c6a2ec79063502c818582358 SHA512 8e2f563c419f85adf8c9536db4e2deb6079ca9741e36002964625930cb1fa0fa9af14436c2278fce987e5b1b46fd597eb67b666e5a194de1f67db3d25e974411 +EBUILD compiler-rt-sanitizers-11.0.0.ebuild 5090 BLAKE2B 2f0c5dacd0abb8e806f73fa3a4896918a88cc2cb5f08a9ef003394b989f1af014f82b5ccce43bd98d0de9b121283c457f8cb2bcb3d682bee69862a92ffce235c SHA512 bf0682cfa02ca7acb180d1bb090887fb2b17331f5b4c008852329d855e13fe5ad702d2e1806461606ae25973e1849a0603159998370308812e2b047711d1a524 +EBUILD compiler-rt-sanitizers-11.0.1.ebuild 5997 BLAKE2B f45312a70d7559e30811fec80d7189e578a334c4f09c8f2cbca3d143687f2448f032d1d586dbbaaf89c2c64b5a75458a2d50914db40f6e315a702ead04bb5030 SHA512 f58f81c77dd6ea37ec8a671d7a2ef7dcc503f15f4180b86aa91c63b67ede4d34e49b40f0033522514ac11e6af67e4193f032426d6382a65a6fd8c6c634a7cf04 EBUILD compiler-rt-sanitizers-12.0.0.9999.ebuild 5788 BLAKE2B 3ff53ad32567ced4b380faab967a4f0b2e9c5c97dc9b191d07b1f9e9e7254598f0c44a959d79845cfd730daffe3ca1c2f87158f7634505d30da267b6ab00fe5a SHA512 5738bc9bffed79b039a23cbe0e69cbee0b6ce3d48d58fb8bbd151c67c38495ee403bbd44003c7fff532f7093a27daaa43642e2c1115d1afb33149bc9fc621338 -EBUILD compiler-rt-sanitizers-9.0.1.ebuild 4847 BLAKE2B cc23d456a4c52596858a405bc74c3c5db35c4fe116685cba4982e2753ba01941bd2c166f56e4278c79e02b06229e90a7fba9fce923360dba8bbf516c8a665ae6 SHA512 dc11719f142cfa56c86373e7e6dba88957511218a654c138ab37d3de01a60bd77f8dd4bc90ed634156d0952b350dce1bad08f8a2db1a7d207335596cdd0bd4d6 +EBUILD compiler-rt-sanitizers-9.0.1-r1.ebuild 4886 BLAKE2B dbdd0ebd27dac7419f83c4e91d92a6acf68c08413568cfd2f642a3175f53a37e53b67958ef825b06e75de59f3b549ebfa3dae579a8dbb340aac43aa284a3322a SHA512 fdf79aa707e8839ca12afaaedf72c90efac5206f915ac8d451778019a5c9e1ba6ffb38057c9ab6a85adde400791c6c7d64f9664334eb07b9e5dca717a67791bd +EBUILD compiler-rt-sanitizers-9.0.1.ebuild 4836 BLAKE2B 0de8a010cb24b13fb4c7d320ed88b1e59b8f09e8c8b2769cd0db0666de6f6318bd9bcaf74000908dd73ddec551fcf576496f3132be4acb42afb4f4319e169ec4 SHA512 4c96efa4fa90a26cdaa824e0dfdee335dde9ade0cfa4ec04131777c858b4c081c02181bba019d40c388492c6222abf74b8d5edc5b440bcb87f5cc17b462fe542 MISC metadata.xml 1280 BLAKE2B 68347dd2fdb4698150d2e19f2880437b0607360d06ae1e87b753d3d2f91a51265cc1abb76d59fd8933e42ea2df2643f694d7722f88957a9e927877830f181690 SHA512 41348dcf18acf298501484813d2194d4bffcf6f24ca6758b7b5ba4d84b7270a7c467c365eea4c46d6a75824b483bbba4b3e7a2146c0773e1dae91e7cce884cc7 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-10.0.1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-10.0.1.ebuild index a14a857fafc0..8e27033f6f5f 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-10.0.1.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-10.0.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -14,7 +14,7 @@ llvm.org_set_globals LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" SLOT="$(ver_cut 1-3)" -KEYWORDS="amd64 arm arm64 ppc64 x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos" +KEYWORDS="amd64 arm arm64 ppc64 x86 ~amd64-linux ~ppc-macos ~x64-macos" IUSE="+clang +libfuzzer +profile +sanitize test +xray elibc_glibc" # FIXME: libfuzzer does not enable all its necessary dependencies REQUIRED_USE="libfuzzer? ( || ( sanitize xray ) )" diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.0.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.0.ebuild index f767718861ce..52e9ff58f471 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.0.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.0.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -14,7 +14,7 @@ llvm.org_set_globals 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 ~x86-macos" +KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86 ~amd64-linux ~ppc-macos ~x64-macos" IUSE="+clang +libfuzzer +profile +sanitize test +xray elibc_glibc" # FIXME: libfuzzer does not enable all its necessary dependencies REQUIRED_USE="libfuzzer? ( || ( sanitize xray ) )" diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.9999.ebuild deleted file mode 100644 index 14dbd46a8dbc..000000000000 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.9999.ebuild +++ /dev/null @@ -1,197 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{6..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}/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 - - 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 - - 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.0.1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.ebuild new file mode 100644 index 000000000000..249ebcf8e2ac --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.ebuild @@ -0,0 +1,201 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6..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 ) + 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}/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 + + 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.0.1_rc1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc1.ebuild deleted file mode 100644 index cc4d0af346b9..000000000000 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc1.ebuild +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{6..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 +libfuzzer +profile +sanitize test +xray elibc_glibc" -# FIXME: libfuzzer does not enable all its necessary dependencies -REQUIRED_USE="libfuzzer? ( || ( sanitize xray ) )" -RESTRICT="!test? ( test ) !clang? ( test )" - -CLANG_SLOT=${SLOT%%.*} -# llvm-6 for new lit options -DEPEND=" - >=sys-devel/llvm-6" -BDEPEND=" - >=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 - - 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 mycmakeargs=( - -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}" - # use a build dir structure consistent with install - # this makes it possible to easily deploy test-friendly clang - -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}" - - -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) - # builtins & crt installed by sys-libs/compiler-rt - -DCOMPILER_RT_BUILD_BUILTINS=OFF - -DCOMPILER_RT_BUILD_CRT=OFF - -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer) - -DCOMPILER_RT_BUILD_PROFILE=$(usex profile) - -DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize) - -DCOMPILER_RT_BUILD_XRAY=$(usex xray) - - -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.0.1_rc2.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc2.ebuild deleted file mode 100644 index 938e4e371e8d..000000000000 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc2.ebuild +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{6..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}/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 - - 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-9.0.1-r1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1-r1.ebuild new file mode 100644 index 000000000000..3092590d47ec --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1-r1.ebuild @@ -0,0 +1,160 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7} ) +inherit check-reqs cmake-utils flag-o-matic llvm llvm.org \ + multiprocessing python-any-r1 + +DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" +HOMEPAGE="https://llvm.org/" +LLVM_COMPONENTS=( compiler-rt ) +LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) +llvm.org_set_globals + +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" +SLOT="$(ver_cut 1-3)" +KEYWORDS="amd64 arm arm64 ppc64 x86 ~amd64-linux ~ppc-macos ~x64-macos" +IUSE="+clang +libfuzzer +profile +sanitize test +xray elibc_glibc" +# FIXME: libfuzzer does not enable all its necessary dependencies +REQUIRED_USE="libfuzzer? ( || ( sanitize xray ) )" +RESTRICT="!test? ( test ) !clang? ( test )" + +CLANG_SLOT=${SLOT%%.*} +# llvm-6 for new lit options +DEPEND=" + >=sys-devel/llvm-6" +BDEPEND=" + clang? ( sys-devel/clang ) + elibc_glibc? ( net-libs/libtirpc ) + test? ( + !=dev-python/lit-5[\${PYTHON_USEDEP}]") + =sys-devel/clang-${PV%_*}*:${CLANG_SLOT} + sys-libs/compiler-rt:${SLOT} ) + ${PYTHON_DEPS}" + +# least intrusive of all +CMAKE_BUILD_TYPE=RelWithDebInfo + +PATCHES=( "${FILESDIR}"/9.0.1/glibc-2.31.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() { + cmake-utils_src_prepare + + if use test; then + # remove tests that are (still) broken by new glibc + # https://bugs.llvm.org/show_bug.cgi?id=36065 + if use elibc_glibc && has_version '>=sys-libs/glibc-2.25'; then + rm test/lsan/TestCases/Linux/fork_and_leak.cc || die + fi + fi +} + +src_configure() { + # pre-set since we need to pass it to cmake + BUILD_DIR=${WORKDIR}/compiler-rt_build + + if use clang; then + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + strip-unsupported-flags + fi + + local mycmakeargs=( + -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}" + # use a build dir structure consistent with install + # this makes it possible to easily deploy test-friendly clang + -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}" + + -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) + # builtins & crt installed by sys-libs/compiler-rt + -DCOMPILER_RT_BUILD_BUILTINS=OFF + -DCOMPILER_RT_BUILD_CRT=OFF + -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer) + -DCOMPILER_RT_BUILD_PROFILE=$(usex profile) + -DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize) + -DCOMPILER_RT_BUILD_XRAY=$(usex xray) + ) + if use test; then + mycmakeargs+=( + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" + -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}" + + # they are created during src_test() + -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${CLANG_SLOT}/bin/clang" + -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${CLANG_SLOT}/bin/clang++" + ) + + # same flags are passed for build & tests, so we need to strip + # them down to a subset supported by clang + CC=${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang \ + CXX=${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang++ \ + strip-unsupported-flags + fi + + if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then + mycmakeargs+=( + # disable use of SDK for the system itself + -DDARWIN_macosx_CACHED_SYSROOT=/ + ) + fi + + cmake-utils_src_configure + + if use test; then + local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* ) + [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}" + [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}" + + # copy clang over since resource_dir is located relatively to binary + # therefore, we can put our new libraries in it + mkdir -p "${BUILD_DIR}"/lib/{llvm/${CLANG_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die + cp "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/bin/clang{,++} \ + "${BUILD_DIR}"/lib/llvm/${CLANG_SLOT}/bin/ || die + cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \ + "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die + cp "${sys_dir}"/*builtins*.a \ + "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die + # we also need LLVMgold.so for gold-based tests + if [[ -f ${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so ]]; then + ln -s "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so \ + "${BUILD_DIR}"/lib/llvm/${CLANG_SLOT}/$(get_libdir)/ || die + fi + fi +} + +src_test() { + # respect TMPDIR! + local -x LIT_PRESERVES_TMP=1 + # disable sandbox to have it stop clobbering LD_PRELOAD + local -x SANDBOX_ON=0 + # wipe LD_PRELOAD to make ASAN happy + local -x LD_PRELOAD= + + cmake-utils_src_make check-all +} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1.ebuild index fe737189a419..b2fe3e08bc00 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -15,7 +15,7 @@ llvm.org_set_globals LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" SLOT="$(ver_cut 1-3)" -KEYWORDS="amd64 arm arm64 ppc64 x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos" +KEYWORDS="amd64 arm arm64 ppc64 x86 ~amd64-linux ~ppc-macos ~x64-macos" IUSE="+clang +libfuzzer +profile +sanitize test +xray elibc_glibc" # FIXME: libfuzzer does not enable all its necessary dependencies REQUIRED_USE="libfuzzer? ( || ( sanitize xray ) )" diff --git a/sys-libs/compiler-rt-sanitizers/files/9.0.1/glibc-2.31.patch b/sys-libs/compiler-rt-sanitizers/files/9.0.1/glibc-2.31.patch new file mode 100644 index 000000000000..ed52c67dbc57 --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/files/9.0.1/glibc-2.31.patch @@ -0,0 +1,35 @@ +diff -ur compiler-rt.orig/lib/sanitizer_common/sanitizer_platform_limits_posix.cc compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc +--- compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc 2019-12-11 19:15:30.000000000 +0000 ++++ compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc 2020-09-27 17:38:13.848840427 +0000 +@@ -1126,8 +1126,9 @@ + CHECK_SIZE_AND_OFFSET(ipc_perm, gid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); +-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) +-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ ++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31) ++/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit ++ on many architectures. */ + CHECK_SIZE_AND_OFFSET(ipc_perm, mode); + #endif + +diff -ur compiler-rt.orig/lib/sanitizer_common/sanitizer_platform_limits_posix.h compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +--- compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 2019-12-11 19:15:30.000000000 +0000 ++++ compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 2020-09-27 17:37:29.433597671 +0000 +@@ -214,15 +214,8 @@ + unsigned short __seq; + unsigned long long __unused1; + unsigned long long __unused2; +-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__) +- unsigned int mode; +- unsigned short __seq; +- unsigned short __pad1; +- unsigned long __unused1; +- unsigned long __unused2; + #else +- unsigned short mode; +- unsigned short __pad1; ++ unsigned int mode; + unsigned short __seq; + unsigned short __pad2; + #if defined(__x86_64__) && !defined(_LP64) -- cgit v1.2.3