summaryrefslogtreecommitdiff
path: root/sys-libs/compiler-rt-sanitizers
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-11-04 22:13:37 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-11-04 22:13:37 +0000
commit39ca6159b9ac903dc56818918d9f97bc831f0955 (patch)
treee9b34845be7f96bc244fd239f6dd8090096ce703 /sys-libs/compiler-rt-sanitizers
parentbc968d15e7f24968eb69567c7f2fca470fdedacd (diff)
gentoo auto-resync : 04:11:2023 - 22:13: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-18.0.0_pre20231104.ebuild215
2 files changed, 217 insertions, 0 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index d1c872cf15fa..6bb3d0583dcb 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -11,6 +11,7 @@ DIST llvm-project-17.0.3.src.tar.xz.sig 438 BLAKE2B 045e7ca82c8d9b3f182e4fa331ec
DIST llvm-project-17.0.4.src.tar.xz 127828636 BLAKE2B bd91ef7f07e085b935500b056f75ab792d13e7f33825df36e85e7988f313a4f3fbb1b4c854615a5e437a97ad552838eb1be5098194f281ba1279330156dd6a38 SHA512 6703eede8013e7e5733fbd7b527757166d5698f52e239522fb320717430c88696309038501d22fe384b016b330bd92126a2c0ba88b0258c3f092801e3800b7a3
DIST llvm-project-17.0.4.src.tar.xz.sig 438 BLAKE2B e417c14d0af8c2f13eccec7a42d0e4d5a6a834d7a3d31061b9f56f7e880cd982c2b1e84322bcf8f6a3d3167519c31f16c7acb8fc725ab5b453f467a196ca2688 SHA512 4e79bb1d2b41289c092d4ec2759d7cfd4f12df8d107f9510aa9e2354691e7f878e3929b2b50e29fd6c65bd5a3aa13baf6b791847c1cd99817adbf59700cf2bdd
DIST llvm-project-5d35273a32d239b7407338e13ed71b59174d6536.tar.gz 198787569 BLAKE2B 7f4f1eb490028e18826a6ebade649a682e433252ceab1f3dcd9e50c34f24e7ef108c3325ec209a4d4fa1ded8e09ebda4980cb9d8ddce8a0d517923d6c38b8f4a SHA512 4d263561fb12cc07a5e8f7ed2f8f22a3645aa959cf963a6a735a9bb93cfc2a51bf7e4d36b54e8425725029cfcfd868dfcc53af95d26d84be72be124d8c564271
+DIST llvm-project-83888a5404d46667647fe36d6fa510d075ed57ea.tar.gz 200867834 BLAKE2B 20f5afa071089852abfdcc316e5db77681afe0fdb189a515d7724a0abaf1c545f37ba4b946414c7b8afca62636107bd4e1c7c99d8ba6a514bb413b13f5f634b0 SHA512 4cd7680a227388382076d5735a97a379546f5bdde33272a5a3d317d98c2847e34917dd38a3cfb3f1f677f6d9a9b2163b29f89dd9c4b92506f5be34a3072e0509
DIST llvm-project-a7700985577694d6cc2498833f27b4fb5eeaf252.tar.gz 199221825 BLAKE2B 047ab7c0e80e1dbbe61ebd9aaae17166665a33b5cb50beec6da2cc19bec9a16777b82c157e74f88b0678d843b200f292d696a964211a8e532f128491dc39a6e4 SHA512 b747210d53402ae01238fa82195fa5c1c8d1c832d976bcc996ef657ac54dacb2fb19521c6f080151e6b1af8a49ddfe58979afaa00b3f1f72dc664ac79b99a8bb
DIST llvm-project-e6e90840708099425b7b69dd053634ff25d4907f.tar.gz 199022115 BLAKE2B 442aff8f561f7c5834a36b7eb217fd2b984e58af9cbcf3e6495305f386a7651e73345bbe65133af4bffaf8cb209cfb9a94fb28756ffaaaae8f7d28ec253ccb78 SHA512 fa9c180f36f4c782208ae7baff1683ee466c70f7d021b21b9cb8a8fd0f2005c0b47889d8bb37f5fb984f6b2ec26c74df60490c7b51ac3d080830e6844e33e300
EBUILD compiler-rt-sanitizers-14.0.6.ebuild 6526 BLAKE2B 371b7d7bfbcacce1c04cf039b15f49bf5c8fb7de0352c4f477b92d1efe0c70442770ec0c6b60572cf5877b5c14492328cf727b2aa5c1dea761eb909aa1e1df6c SHA512 ee1f054abb9954eedd5b098afb1eb741cd2d7b1b329ef66ed3f25f8ed050227a31925852e3d893b0a9913e2ef2ac34efe89c66c19b562c586f7c0352a10a5814
@@ -23,4 +24,5 @@ EBUILD compiler-rt-sanitizers-18.0.0.9999.ebuild 6238 BLAKE2B 49947c45c94553c2bf
EBUILD compiler-rt-sanitizers-18.0.0_pre20231013.ebuild 6238 BLAKE2B 49947c45c94553c2bfd2d0926180422c3485558dcd4d73ad9155eae53757e7ebbb74ad11155a8e3a4a230bd2bd796943ed1f962aa1286391b70d43e6dd56d35f SHA512 51f803a8510300b0771d885f77e86c8d364cac4dad901a4cccf6b0e428798dd7c8135617a09775fe6eeb888e5e4c68be9bcb9c57f4ae0b3b4e0b046f5b337012
EBUILD compiler-rt-sanitizers-18.0.0_pre20231019.ebuild 6238 BLAKE2B 49947c45c94553c2bfd2d0926180422c3485558dcd4d73ad9155eae53757e7ebbb74ad11155a8e3a4a230bd2bd796943ed1f962aa1286391b70d43e6dd56d35f SHA512 51f803a8510300b0771d885f77e86c8d364cac4dad901a4cccf6b0e428798dd7c8135617a09775fe6eeb888e5e4c68be9bcb9c57f4ae0b3b4e0b046f5b337012
EBUILD compiler-rt-sanitizers-18.0.0_pre20231025.ebuild 6238 BLAKE2B 49947c45c94553c2bfd2d0926180422c3485558dcd4d73ad9155eae53757e7ebbb74ad11155a8e3a4a230bd2bd796943ed1f962aa1286391b70d43e6dd56d35f SHA512 51f803a8510300b0771d885f77e86c8d364cac4dad901a4cccf6b0e428798dd7c8135617a09775fe6eeb888e5e4c68be9bcb9c57f4ae0b3b4e0b046f5b337012
+EBUILD compiler-rt-sanitizers-18.0.0_pre20231104.ebuild 6238 BLAKE2B 49947c45c94553c2bfd2d0926180422c3485558dcd4d73ad9155eae53757e7ebbb74ad11155a8e3a4a230bd2bd796943ed1f962aa1286391b70d43e6dd56d35f SHA512 51f803a8510300b0771d885f77e86c8d364cac4dad901a4cccf6b0e428798dd7c8135617a09775fe6eeb888e5e4c68be9bcb9c57f4ae0b3b4e0b046f5b337012
MISC metadata.xml 1412 BLAKE2B 75675507000fa6a6b8182e6b45a08a2716ae7fb9a7e3428dc8420464e4c1d1bdb5bea62cc2f553c579de5a4faa752b35cb3529d980fb07a055ff4ddf6e752707 SHA512 f05ea5168b923db72f4f5b53e9b748ebbcdae9eff09d86323313055933b47fc0089e1b2d73cd997d73dcfb2dca032344955816425fbddc09d27ca751463aadbb
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.0.0_pre20231104.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.0.0_pre20231104.ebuild
new file mode 100644
index 000000000000..74286022a3b1
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.0.0_pre20231104.ebuild
@@ -0,0 +1,215 @@
+# 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
+
+ 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
+}