summaryrefslogtreecommitdiff
path: root/sys-libs/compiler-rt-sanitizers
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-01 01:09:37 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-10-01 01:09:37 +0100
commit290844d409ace33d948956aec3c542ea6f4a7b13 (patch)
treea1849e2730c9848c11d12aa322070e4e87edb729 /sys-libs/compiler-rt-sanitizers
parent31459e63971ac3b08706bba949851d93c45043c3 (diff)
gentoo auto-resync : 01:10:2022 - 01:09:37
Diffstat (limited to 'sys-libs/compiler-rt-sanitizers')
-rw-r--r--sys-libs/compiler-rt-sanitizers/Manifest2
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0_pre20220930.ebuild220
2 files changed, 222 insertions, 0 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index 1d6279fd4b3c..ee5255ae4d8b 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -6,6 +6,7 @@ DIST llvm-project-14.0.6.src.tar.xz 105618228 BLAKE2B ee67c5407df8cef493b9c0004f
DIST llvm-project-14.0.6.src.tar.xz.sig 566 BLAKE2B cb658ad43d8ab6c43a5773aedadf0569c97b5ee4b1bd58eceb10e1879a30880c741c3d66bedd462c892309b688fb7b2673115a62d1f74d71ee375a578de9547f SHA512 b4a7b368532a7a4a24376cfa7db8f6d3478f6d4446474342fc00b474ecf466330cd0f16783209263c4c72d5fc7ddedfb11b95578842e700cfb7ee0bb34cc95d6
DIST llvm-project-15.0.1.src.tar.xz 112068688 BLAKE2B 8fd6690445f7cbc8b47a7c1dd1f2c4fbc39f9a97f9d4a0015d466726454b090b0d1ff9b0d926eba7065e84782901687f74e6540a36dc6656a93f3c92c7bc7e06 SHA512 cef84bc173118a30db3ece5e5c6f874bf689c77afc40a4792fdcb7556555ac14a8e6de1dc811755405e5d162d63bc69abaecba30d220a42765160d69f0073fda
DIST llvm-project-15.0.1.src.tar.xz.sig 438 BLAKE2B d8f634adab531bb19178fb27bc83b3a90c856e9402dd5af700f9af43813f68d20c21b9112dd95e9f6f10609ee51ed5aaf77edb96ca16fb93136b8aea432affd3 SHA512 cbf2570840d8dc12f6436c495a23cf9d439ee195755c01a6d1d5bcc20133599dc956dc43a0f5016698e3c9a960826f5f3c2840a73f993467e275856a67999fda
+DIST llvm-project-215c9fa4deac9ec6b4e504843830551f03b60620.tar.gz 168942763 BLAKE2B 545c7c372c38667b7d811753464e91134aae600060d9054979eab8735d535a72d6bbb33a6008dc81f3b14513f58791ca3b8c3068e62ff146ccb14f32abb41a32 SHA512 d0c244357650ef5d56bc7afd836cd747cc2cce92d5f7fb4ddec3414e5bafe4e611acb2a7ff42343c184caad14a30fa9a6ced7e493df3ceb06fe8f9445aeb5a9b
DIST llvm-project-303526ef3aa211c1930be2885deae15eeeda3b18.tar.gz 167503164 BLAKE2B 143c72c58517b3e40ee74c1a0df47bfd0d0f9e71926bc8c39a007e674a08df95d0ffe05f523f97e4409b248349e13719cabbc7ac6938feebe702959e84a07243 SHA512 9aa5c86de6c6be1d26c085eb29ea283429e41330e937e5fdbd545bb3f5b996ac82cd6268701fcbbd202e89ee35f2b67e595fc595bb7383778e9ad5fd52ca10a0
DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f
EBUILD compiler-rt-sanitizers-13.0.1.ebuild 6369 BLAKE2B 4e8a715cd19dd39087fe7d6cad9e30a7e130c69bde12ea382fc748cc152099607c23b75915c644785820ded954eaba31779f7c58b63a71255f9c6b610afcee7d SHA512 f5a680a5de09feecde1a3038ab185cc3b321eb2dc15b5841cd58863323fd6da727307c44127d2af5077ce2b17744ee5d3f8a17dd3bceea71b1dec2a13555dd66
@@ -14,4 +15,5 @@ EBUILD compiler-rt-sanitizers-15.0.1.ebuild 6400 BLAKE2B e5888e647efbac5b066d644
EBUILD compiler-rt-sanitizers-15.0.2.9999.ebuild 6325 BLAKE2B 6477a9afca51d95071229d9959af18ac6afebbc1348cbb26a4a9e1253e4a40d57604f74a138b027cf3ec07bffe7e001543a356e5fc5d173e5f83fadd8e646d4e SHA512 9c553af9ff3f8ad99ef2da81a86362abcfcadcbf5407565a60be6c79f9fb89f2ae1f536f8df03cc4f3f797d8019f29d0e949dcbf82f59d2e1b1fa316d9074db2
EBUILD compiler-rt-sanitizers-16.0.0.9999.ebuild 6325 BLAKE2B 6477a9afca51d95071229d9959af18ac6afebbc1348cbb26a4a9e1253e4a40d57604f74a138b027cf3ec07bffe7e001543a356e5fc5d173e5f83fadd8e646d4e SHA512 9c553af9ff3f8ad99ef2da81a86362abcfcadcbf5407565a60be6c79f9fb89f2ae1f536f8df03cc4f3f797d8019f29d0e949dcbf82f59d2e1b1fa316d9074db2
EBUILD compiler-rt-sanitizers-16.0.0_pre20220918.ebuild 6325 BLAKE2B 6477a9afca51d95071229d9959af18ac6afebbc1348cbb26a4a9e1253e4a40d57604f74a138b027cf3ec07bffe7e001543a356e5fc5d173e5f83fadd8e646d4e SHA512 9c553af9ff3f8ad99ef2da81a86362abcfcadcbf5407565a60be6c79f9fb89f2ae1f536f8df03cc4f3f797d8019f29d0e949dcbf82f59d2e1b1fa316d9074db2
+EBUILD compiler-rt-sanitizers-16.0.0_pre20220930.ebuild 6325 BLAKE2B 6477a9afca51d95071229d9959af18ac6afebbc1348cbb26a4a9e1253e4a40d57604f74a138b027cf3ec07bffe7e001543a356e5fc5d173e5f83fadd8e646d4e SHA512 9c553af9ff3f8ad99ef2da81a86362abcfcadcbf5407565a60be6c79f9fb89f2ae1f536f8df03cc4f3f797d8019f29d0e949dcbf82f59d2e1b1fa316d9074db2
MISC metadata.xml 1412 BLAKE2B 75675507000fa6a6b8182e6b45a08a2716ae7fb9a7e3428dc8420464e4c1d1bdb5bea62cc2f553c579de5a4faa752b35cb3529d980fb07a055ff4ddf6e752707 SHA512 f05ea5168b923db72f4f5b53e9b748ebbcdae9eff09d86323313055933b47fc0089e1b2d73cd997d73dcfb2dca032344955816425fbddc09d27ca751463aadbb
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0_pre20220930.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0_pre20220930.ebuild
new file mode 100644
index 000000000000..f716dc74b423
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0_pre20220930.ebuild
@@ -0,0 +1,220 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..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="$(ver_cut 1-3)"
+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 )
+"
+
+LLVM_MAX_SLOT=${SLOT%%.*}
+DEPEND="
+ sys-devel/llvm:${LLVM_MAX_SLOT}
+ virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?]
+"
+BDEPEND="
+ >=dev-util/cmake-3.16
+ clang? ( sys-devel/clang )
+ elibc_glibc? ( net-libs/libtirpc )
+ test? (
+ !!<sys-apps/sandbox-2.13
+ $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_MAX_SLOT}
+ sys-libs/compiler-rt:${SLOT}
+ )
+ !test? (
+ ${PYTHON_DEPS}
+ )
+"
+
+LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake )
+LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest )
+LLVM_PATCHSET=9999-1
+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_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/${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_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_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/${LLVM_MAX_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAX_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/${LLVM_MAX_SLOT}/bin/clang \
+ CXX=${EPREFIX}/usr/lib/llvm/${LLVM_MAX_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/${LLVM_MAX_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die
+ cp "${EPREFIX}"/usr/lib/llvm/${LLVM_MAX_SLOT}/bin/clang{,++} \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_MAX_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/${LLVM_MAX_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
+ ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_MAX_SLOT}/$(get_libdir)/LLVMgold.so \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_MAX_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
+}