From f20958f66a5e97c92cc44354e07e3e3089dfc23d Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 2 May 2023 23:23:40 +0100 Subject: gentoo auto-resync : 02:05:2023 - 23:23:39 --- sys-libs/compiler-rt-sanitizers/Manifest | 2 + ...ompiler-rt-sanitizers-17.0.0_pre20230502.ebuild | 216 +++++++++++++++++++++ 2 files changed, 218 insertions(+) create mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0_pre20230502.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 a980a8d5ebcf..470416077839 100644 --- a/sys-libs/compiler-rt-sanitizers/Manifest +++ b/sys-libs/compiler-rt-sanitizers/Manifest @@ -9,6 +9,7 @@ DIST llvm-project-16.0.1.src.tar.xz 117990772 BLAKE2B 298189ce6d7245711e5bd3e03f DIST llvm-project-16.0.1.src.tar.xz.sig 566 BLAKE2B 06c03d789e63ab30bba4c56ba9ec91400d804448482d6a7fd395252b3b9166a5ee7a42a94c2074aa0d1809a3327f993d8932211f3fc05ad281db64c17b2a7094 SHA512 f42db28eb8280db06b1c78fa7a7aaea3a79499cecee1a64ce18c49b90c755b3a78fc93f01d1855887c7918ccc927c3b6147cfc916520f05d4cef65381ca6fe60 DIST llvm-project-16.0.2.src.tar.xz 117995768 BLAKE2B b329b2b123428f3a966a96f074a75520f07d12fc13ec755403cff2346b23195e6a0c05ca9e789b4cf5b4b3557a922bd41d8dffb6056ee33fbbf2b81001511fae SHA512 4ca76aaaca8812a06a94071e7444a3213d85dca51ea86f6125f854776f69a3e088a92d0621e3911e526f280b35bfb778fb3742c6010d3ed1eba605c08720377c DIST llvm-project-16.0.2.src.tar.xz.sig 566 BLAKE2B 8243748ac27e4eec3cc011371e179e19f1005336f07d956fd358f649d1429c8d0ea22ecc376b1dec9fe3db971467ad1dd63e97bb089885d0e1994eeab26b6fd7 SHA512 dbe9367a259954a38f2369b2f226726162090227f1a5ae8c8809eaae47cad7b3b26c754633e6e5c54cacd6360a504d7ba4c659d9232c1648388d657a2aaad10c +DIST llvm-project-52882de0e641487329c9e093a90ea3dad01842c8.tar.gz 182953335 BLAKE2B 98682729992d73202e35b540d5d0d87e2acf44e4ab6896a0b6f9ac4a7423f55ad370ae1d7e919a6c86dc7f138a66890ac89b852b03305612d248ab567833f8be SHA512 3685aff0f648e9b477e1e01edebe4799498c21587e2ed5577e2fdef98bb21ea215e206606a11692fbb93a0989fd59fd324faff2c4d97b7afca0851b53f123f05 DIST llvm-project-5c60a08c696c0420ddc5fdad5b8e50a7528cb3bf.tar.gz 182291041 BLAKE2B f5997611e0293df515d4494d14895cc8fbe22b536f5c419e4ad7d098acbf2b1046ceb332d865eacdae0b7fa1a77b78090551976835dd1b95b5270c9f6e12e410 SHA512 6cda8e55b4fc70e94838c772c56213c811affda96fb98a03d432348f995a313447d0e0e84533350e1fda3162d82633b260ccd8e3b1d59d3216187b44dc5556fb DIST llvm-project-5ea158077ec9ca50857ede5cbb0b27c61663fd55.tar.gz 182543024 BLAKE2B 32f5a9ddaa6c7e283d97256d7bd68634f2f8ed6d7167e743ba8076809ea1a3a7159f9ccc56a6e5a8838481cade07389669d8a35b17b5922da0cbef04c80131f8 SHA512 3d180c04ef39adbc9c6ee485e21cdf63fde362f0a22026b00a6d3eba6243e4c8e96fc088335f31051e54f4546d62569131a671d2e655ea735d597361f5732827 EBUILD compiler-rt-sanitizers-14.0.6.ebuild 6526 BLAKE2B 371b7d7bfbcacce1c04cf039b15f49bf5c8fb7de0352c4f477b92d1efe0c70442770ec0c6b60572cf5877b5c14492328cf727b2aa5c1dea761eb909aa1e1df6c SHA512 ee1f054abb9954eedd5b098afb1eb741cd2d7b1b329ef66ed3f25f8ed050227a31925852e3d893b0a9913e2ef2ac34efe89c66c19b562c586f7c0352a10a5814 @@ -20,4 +21,5 @@ EBUILD compiler-rt-sanitizers-17.0.0.9999.ebuild 6249 BLAKE2B 036338e02f018bd9cb EBUILD compiler-rt-sanitizers-17.0.0_pre20230325.ebuild 6248 BLAKE2B 8548074a3b572bc5b19e9a70ed91225678172cb43b71ad501811d3741367c56f1ffe0e1b528934f620e7d8a30bd1fc463ada54113bea16c322f1d821a8503756 SHA512 8825b15e4965e58365a96517831120e1d5c02130f83cc1150b7a107142782cee74830d3dc0234453291d0f487789cd005303d47269381ad45356e4fd779decf5 EBUILD compiler-rt-sanitizers-17.0.0_pre20230414.ebuild 6248 BLAKE2B 8548074a3b572bc5b19e9a70ed91225678172cb43b71ad501811d3741367c56f1ffe0e1b528934f620e7d8a30bd1fc463ada54113bea16c322f1d821a8503756 SHA512 8825b15e4965e58365a96517831120e1d5c02130f83cc1150b7a107142782cee74830d3dc0234453291d0f487789cd005303d47269381ad45356e4fd779decf5 EBUILD compiler-rt-sanitizers-17.0.0_pre20230421.ebuild 6249 BLAKE2B 036338e02f018bd9cb01036851fcee5af58f012e15c4fcb55a207e519d2b553e83f2871869681055a9c672b091126e95d52a1c50a605a94e27b866b22dd64732 SHA512 94a1deb4cbba26d0e1aa02333c2d3375349b059e1fe75f26368ab54d13b276c27ea377f4cce9b1cdf0a508add5ddae4886a59bbb24cd8bec61a7e5d03660746c +EBUILD compiler-rt-sanitizers-17.0.0_pre20230502.ebuild 6249 BLAKE2B 036338e02f018bd9cb01036851fcee5af58f012e15c4fcb55a207e519d2b553e83f2871869681055a9c672b091126e95d52a1c50a605a94e27b866b22dd64732 SHA512 94a1deb4cbba26d0e1aa02333c2d3375349b059e1fe75f26368ab54d13b276c27ea377f4cce9b1cdf0a508add5ddae4886a59bbb24cd8bec61a7e5d03660746c MISC metadata.xml 1412 BLAKE2B 75675507000fa6a6b8182e6b45a08a2716ae7fb9a7e3428dc8420464e4c1d1bdb5bea62cc2f553c579de5a4faa752b35cb3529d980fb07a055ff4ddf6e752707 SHA512 f05ea5168b923db72f4f5b53e9b748ebbcdae9eff09d86323313055933b47fc0089e1b2d73cd997d73dcfb2dca032344955816425fbddc09d27ca751463aadbb diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0_pre20230502.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0_pre20230502.ebuild new file mode 100644 index 000000000000..f3ca3131c8d6 --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0_pre20230502.ebuild @@ -0,0 +1,216 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{9..11} ) +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="${LLVM_MAJOR}" +KEYWORDS="" +IUSE="+abi_x86_32 abi_x86_64 +clang +debug test" +# base targets +IUSE+=" +libfuzzer +memprof +orc +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 orc profile xray ) + test? ( + cfi? ( ubsan ) + gwp-asan? ( scudo ) + ) +" +RESTRICT=" + !clang? ( test ) + !test? ( test ) +" + +DEPEND=" + sys-devel/llvm:${LLVM_MAJOR} + virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?] +" +BDEPEND=" + >=dev-util/cmake-3.16 + clang? ( sys-devel/clang ) + elibc_glibc? ( net-libs/libtirpc ) + test? ( + $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") + =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR} + sys-libs/compiler-rt:${LLVM_MAJOR} + ) + !test? ( + ${PYTHON_DEPS} + ) +" + +LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) +LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support third-party ) +llvm.org_set_globals + +python_check_deps() { + use test || return 0 + python_has_version ">=dev-python/lit-15[${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_MAX_SLOT=${LLVM_MAJOR} 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() { + # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 + use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" + + # 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/${LLVM_MAJOR}" + # 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/${LLVM_MAJOR}" + + -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_ORC=$(usex orc) + -DCOMPILER_RT_BUILD_PROFILE=$(usex profile) + -DCOMPILER_RT_BUILD_SANITIZERS="${want_sanitizer}" + -DCOMPILER_RT_BUILD_XRAY=$(usex xray) + + -DPython3_EXECUTABLE="${PYTHON}" + ) + + if use amd64; then + mycmakeargs+=( + -DCAN_TARGET_i386=$(usex abi_x86_32) + -DCAN_TARGET_x86_64=$(usex abi_x86_64) + ) + fi + + if use test; then + mycmakeargs+=( + -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/${LLVM_MAJOR}/bin/clang" + -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang++" + ) + + # same flags are passed for build & tests, so we need to strip + # them down to a subset supported by clang + CC=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang \ + CXX=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/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/${LLVM_MAJOR}/lib/* ) + [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}" + [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}" + + # copy clang over since resource_dir is located relatively to binary + # therefore, we can put our new libraries in it + mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_MAJOR}/{bin,$(get_libdir)},clang/${LLVM_MAJOR}/include} || die + cp "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/bin/clang{,++} \ + "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/bin/ || die + cp "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/include/*.h \ + "${BUILD_DIR}"/lib/clang/${LLVM_MAJOR}/include/ || die + cp "${sys_dir}"/*builtins*.a \ + "${BUILD_DIR}/lib/clang/${LLVM_MAJOR}/lib/${sys_dir##*/}/" || die + # we also need LLVMgold.so for gold-based tests + if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so ]]; then + ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so \ + "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/$(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 +} -- cgit v1.2.3