From 20e7188871e6d724b707132f925b9872536a91a0 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 15 Dec 2023 20:53:45 +0000 Subject: gentoo auto-resync : 15:12:2023 - 20:53:45 --- sys-libs/compiler-rt-sanitizers/Manifest | 2 + ...ompiler-rt-sanitizers-18.0.0_pre20231215.ebuild | 217 +++++++++++++++++++++ 2 files changed, 219 insertions(+) create mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.0.0_pre20231215.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 593245fa6622..a541ce7b2555 100644 --- a/sys-libs/compiler-rt-sanitizers/Manifest +++ b/sys-libs/compiler-rt-sanitizers/Manifest @@ -10,6 +10,7 @@ DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e06541 DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340 DIST llvm-project-5237193b87721134541f228e28edfd544a9c8ac8.tar.gz 201404340 BLAKE2B f028b8b100721202007e3106d8ee91bcf2ac90588f9268ec835dc4ea3941363d4b796338146c65d1a9e88957d18738030f713b3fed770616c79cb40043e706db SHA512 40a4d4f99f1a690a0f8737261aeeaa61af6124eeadcb6bab5c3828e88b36b8cce42a8caee6d3f01e675047c59b62210de017d207e341f680eff97758f798ad45 DIST llvm-project-6a4489a73337907d52e7eaf3716f3de9008e6e53.tar.gz 201703120 BLAKE2B 7de783df15ff30ab85aad2f02a5a043d09b18dd7b212c19e21b045870497e2b17a53527523cd533c4ef61b22d605026a9322d2f8d02f0d4f76ed26ab693b788c SHA512 ffc31d7037255d608717faff84e858d63b37abed5659d66599864ae44ed00fc5902e9851eb1b8c848b500623681ef5782b39ad2bf8bcf96ac4f35032efde1490 +DIST llvm-project-d37ced88809cb4d2df57ec80887b3f8801ca719b.tar.gz 203826420 BLAKE2B 58448df837f2119720a36b837d0e4f2b2fc00da5658706b193b9d2d180cf0f6c5eb79a9cc0fa9d94310996a95210115a5a46371bd8537f16e105adea14a72399 SHA512 1348e5bf736acaeebf0ae0f613973e6c2d439d360c2272bb4ab112e579b12c297970bb765fd774c768aa55a922c93048b1d8ae6bfd636b241fa86f9427cc2069 EBUILD compiler-rt-sanitizers-14.0.6.ebuild 6526 BLAKE2B 371b7d7bfbcacce1c04cf039b15f49bf5c8fb7de0352c4f477b92d1efe0c70442770ec0c6b60572cf5877b5c14492328cf727b2aa5c1dea761eb909aa1e1df6c SHA512 ee1f054abb9954eedd5b098afb1eb741cd2d7b1b329ef66ed3f25f8ed050227a31925852e3d893b0a9913e2ef2ac34efe89c66c19b562c586f7c0352a10a5814 EBUILD compiler-rt-sanitizers-15.0.7.ebuild 6578 BLAKE2B 79b9477f9f426c7e5ffc07fe9e2abc86ee568d8e081ac5e5e3da3e3e169920fe8c0ce34f9a8ac03a4389f27ecb0b0ff7f5cf91622d614e03300f17ea97d20859 SHA512 9d23f6974edbe69e5d9fa53a3885e8e44741b5e5d90b0e72c6d191b70827d1e590a7c5a3373bc4fb4945a50db0eea5e119baeaeea956c6d92bb087410ce919b0 EBUILD compiler-rt-sanitizers-16.0.6.ebuild 6546 BLAKE2B a57ff221344f88afa92722a883c5c5eec064b2a9691f2262e633914a75df013c295352b1b1fad83b7fc7579c7d59d6e0f04bc63e1f27556e950438f5f2e72fe7 SHA512 32641d64f2a370bd4b907ff05ebf975d3e149e9bc6372cd60e46ef04463f374984a62002cab76e58acee31f4fcbd0138749bab5c5aa1afd29a8713083b90a402 @@ -17,4 +18,5 @@ EBUILD compiler-rt-sanitizers-17.0.6.ebuild 6383 BLAKE2B c72113466b41764f42ce634 EBUILD compiler-rt-sanitizers-18.0.0.9999.ebuild 6293 BLAKE2B 27ba05686e239e9b490d1a1cad3a19509f8f61201133c3070b7f320c9fd8e1ead0b136988b815e7cff2e9d42226fca227b4a39dbaa3973d2d364ab3439519879 SHA512 25af556f5e8c6b08ab7dc6910454836d19f2c0651556ffb6d4c0983b73f1f4a66b97d1b4e0f5dd597e29b6d367b7376daf41bc09fe094b8327feebf1eaab719f EBUILD compiler-rt-sanitizers-18.0.0_pre20231119.ebuild 6238 BLAKE2B 49947c45c94553c2bfd2d0926180422c3485558dcd4d73ad9155eae53757e7ebbb74ad11155a8e3a4a230bd2bd796943ed1f962aa1286391b70d43e6dd56d35f SHA512 51f803a8510300b0771d885f77e86c8d364cac4dad901a4cccf6b0e428798dd7c8135617a09775fe6eeb888e5e4c68be9bcb9c57f4ae0b3b4e0b046f5b337012 EBUILD compiler-rt-sanitizers-18.0.0_pre20231129.ebuild 6293 BLAKE2B 27ba05686e239e9b490d1a1cad3a19509f8f61201133c3070b7f320c9fd8e1ead0b136988b815e7cff2e9d42226fca227b4a39dbaa3973d2d364ab3439519879 SHA512 25af556f5e8c6b08ab7dc6910454836d19f2c0651556ffb6d4c0983b73f1f4a66b97d1b4e0f5dd597e29b6d367b7376daf41bc09fe094b8327feebf1eaab719f +EBUILD compiler-rt-sanitizers-18.0.0_pre20231215.ebuild 6293 BLAKE2B 27ba05686e239e9b490d1a1cad3a19509f8f61201133c3070b7f320c9fd8e1ead0b136988b815e7cff2e9d42226fca227b4a39dbaa3973d2d364ab3439519879 SHA512 25af556f5e8c6b08ab7dc6910454836d19f2c0651556ffb6d4c0983b73f1f4a66b97d1b4e0f5dd597e29b6d367b7376daf41bc09fe094b8327feebf1eaab719f MISC metadata.xml 1412 BLAKE2B 75675507000fa6a6b8182e6b45a08a2716ae7fb9a7e3428dc8420464e4c1d1bdb5bea62cc2f553c579de5a4faa752b35cb3529d980fb07a055ff4ddf6e752707 SHA512 f05ea5168b923db72f4f5b53e9b748ebbcdae9eff09d86323313055933b47fc0089e1b2d73cd997d73dcfb2dca032344955816425fbddc09d27ca751463aadbb diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.0.0_pre20231215.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.0.0_pre20231215.ebuild new file mode 100644 index 000000000000..9b46a98372e8 --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.0.0_pre20231215.ebuild @@ -0,0 +1,217 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +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}" +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 + # hangs, sigh + rm test/tsan/getline_nohang.cpp || die + + 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