From 2a27c2168109b412410436b9cd6b71dbfe31f6ef Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 25 Aug 2023 21:55:22 +0100 Subject: gentoo auto-resync : 25:08:2023 - 21:55:22 --- sys-libs/compiler-rt-sanitizers/Manifest | 2 + ...ompiler-rt-sanitizers-18.0.0_pre20230825.ebuild | 216 +++++++++++++++++++++ 2 files changed, 218 insertions(+) create mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.0.0_pre20230825.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 60acf44f653b..ee987f6ed823 100644 --- a/sys-libs/compiler-rt-sanitizers/Manifest +++ b/sys-libs/compiler-rt-sanitizers/Manifest @@ -14,6 +14,7 @@ DIST llvm-project-17.0.0rc3.src.tar.xz 127805656 BLAKE2B ecaead9f227b8357a5dc5ff DIST llvm-project-17.0.0rc3.src.tar.xz.sig 438 BLAKE2B 7b644cf501d17a6aef9b052e359ba06c1840a75e5263de46d938dbbdea07720b53d7ee6b5861ad641d0f7a7f75c6cc17717847b0ea9cf08873dbfacbe1c19074 SHA512 7059b1a90b7dd8cfa831f9e199a3a817358fd75d7c7d7e6de446d5443fce5831877a28e9b964ea238c1d803f9054bf4f53a97622d5f756f7f99aaa1c1a279f44 DIST llvm-project-7d259b36d2e8148d13087844e6494ad3a5c63edf.tar.gz 195942450 BLAKE2B 3221cc070295edf4f70e5b24ed06cda29e8dd98d3d28ba5ac38b821fc313f7f7dfdc7ad500537c2244af0fa3d750174dfa1699db7f72a44df67e5fa255a3d0aa SHA512 9279290ab482f29af4a2205270038f1817608a63872e03340d43c31fcf5da36191269838912a1460455a8661295e664891d6d123018b12ddc80c2641790d0640 DIST llvm-project-c4bb3e073548cf436d5fa0406e3ae75e94684dec.tar.gz 195462091 BLAKE2B 982f1105db6cf63575916a20432df4c8623bdff236ce3bd95e63ffd931bc8e1f0e9ea9ad673b09d749c35c1bfe68a48f5b4080118f25040498db09a580db3a7e SHA512 1c591175f44da85eb5ee831220c0387a3d9a0604beaf7abd89fbc6d1e0e9c4f80dac73de1dc22375a45115dd4c1d764fed0a0f628993ca780eb6991682aa0b5b +DIST llvm-project-e3373c6c83d3855adb78f1952a3bf0398baf359e.tar.gz 196926975 BLAKE2B 9da1052db0a6ff81a8b76cbf9cb2ab7eed5c8798dc5ae6887a4694de8b151c7a1282cfff2da2e8440b1a67d3d12c33db319fbbe6062761b6d5369e6b335821ae SHA512 8bb6d49ddb824e932f7bad3c51e4a6c2227139aaf19c02e9deb15657919bc12ea41844d8fe045061814aefb9031d82b167c7c0c20bedaa09aaffe164a2109f7d DIST llvm-project-fe42682e7818d44cbe19f98ef34caa4e414aa937.tar.gz 196564445 BLAKE2B 056e6622b38009e34392c1d1755086e008bc85e9b4c00126e7ca92ddaee2ede7f31bafbc6ca04c5008983ce843d19fb152d75ce01e6ece4c2d891cc38604532c SHA512 8245f8a50f77e9ac9c0309a0025fde8407bb82d82277e3edba0a995debff50940e9500d4ad65060a330e6c19e2e1332d700ea040ca382ef4b75282a4566cbf72 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 @@ -26,4 +27,5 @@ EBUILD compiler-rt-sanitizers-18.0.0.9999.ebuild 6250 BLAKE2B 0166eecaea9e102e76 EBUILD compiler-rt-sanitizers-18.0.0_pre20230803.ebuild 6250 BLAKE2B 0166eecaea9e102e761ff0f82deaac5b37cfdc534b1a6262f2e839c9971ea41d4c6123387ef6bf09ee98fefb6cc40aca4d6999378568ed831224e0fdededafdd SHA512 a61cc40f865d512870a881d990f5908c28c9dfa85e30eb5b80aff15f5dcfb8b190cdb9c5e66a57dbe1ec2943412a7600660144ad0d2bfa75c654519fc34b6380 EBUILD compiler-rt-sanitizers-18.0.0_pre20230810.ebuild 6250 BLAKE2B 0166eecaea9e102e761ff0f82deaac5b37cfdc534b1a6262f2e839c9971ea41d4c6123387ef6bf09ee98fefb6cc40aca4d6999378568ed831224e0fdededafdd SHA512 a61cc40f865d512870a881d990f5908c28c9dfa85e30eb5b80aff15f5dcfb8b190cdb9c5e66a57dbe1ec2943412a7600660144ad0d2bfa75c654519fc34b6380 EBUILD compiler-rt-sanitizers-18.0.0_pre20230820.ebuild 6250 BLAKE2B 0166eecaea9e102e761ff0f82deaac5b37cfdc534b1a6262f2e839c9971ea41d4c6123387ef6bf09ee98fefb6cc40aca4d6999378568ed831224e0fdededafdd SHA512 a61cc40f865d512870a881d990f5908c28c9dfa85e30eb5b80aff15f5dcfb8b190cdb9c5e66a57dbe1ec2943412a7600660144ad0d2bfa75c654519fc34b6380 +EBUILD compiler-rt-sanitizers-18.0.0_pre20230825.ebuild 6250 BLAKE2B 0166eecaea9e102e761ff0f82deaac5b37cfdc534b1a6262f2e839c9971ea41d4c6123387ef6bf09ee98fefb6cc40aca4d6999378568ed831224e0fdededafdd SHA512 a61cc40f865d512870a881d990f5908c28c9dfa85e30eb5b80aff15f5dcfb8b190cdb9c5e66a57dbe1ec2943412a7600660144ad0d2bfa75c654519fc34b6380 MISC metadata.xml 1412 BLAKE2B 75675507000fa6a6b8182e6b45a08a2716ae7fb9a7e3428dc8420464e4c1d1bdb5bea62cc2f553c579de5a4faa752b35cb3529d980fb07a055ff4ddf6e752707 SHA512 f05ea5168b923db72f4f5b53e9b748ebbcdae9eff09d86323313055933b47fc0089e1b2d73cd997d73dcfb2dca032344955816425fbddc09d27ca751463aadbb diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.0.0_pre20230825.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.0.0_pre20230825.ebuild new file mode 100644 index 000000000000..b0a49349926b --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.0.0_pre20230825.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_{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}" +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