summaryrefslogtreecommitdiff
path: root/sys-libs/compiler-rt-sanitizers
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/compiler-rt-sanitizers')
-rw-r--r--sys-libs/compiler-rt-sanitizers/Manifest6
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.5.ebuild2
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0.9999.ebuild2
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0_pre20230615.ebuild216
4 files changed, 222 insertions, 4 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index 14eff0d9a637..933bf15d33ef 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -1,5 +1,6 @@
DIST llvm-gentoo-patchset-14.0.6-r3.tar.xz 16904 BLAKE2B ebf67455071d6d3744cfc0491b8a33c4c63bfdbcf668565fa0718f6cdb01bced53be9d1cdf6774f6cd8427c07c0ede69503d74cf3574642a6967b38730248ebb SHA512 adc5a3212657d1defa7b720d1a7e9e91586439a34964d44b6897d21be3d208bd15c04bf20502dd7125ef8c368defaeea146eb844ca321be56eebcee52be606a9
DIST llvm-gentoo-patchset-15.0.7.tar.xz 19300 BLAKE2B b70e81d744c2eba5cd851e7b690ce8979b3064973f522be7c93bfb541860000a4bc8b17219f8788dfc8a527217dd13946cf7836640698ddd3d4b3fde493dfbf8 SHA512 daffff6ae4a0874aff1a423b4bb36701ecb5a35a36ae91d4ed7fda58b83e50ffcdc30498c84be4711fd3e1f227bf312dbe930019203e0a131944439af2aa94f7
+DIST llvm-project-0e08374abb2c61a3ae5c24d5f60be3b548da9778.tar.gz 191661586 BLAKE2B 05e5328d8eb9972bd6399e8c0f5ab241a78e6591e63ee520180c4ff154df432ad96f49ddc615a2208f69ffbec539b201fffeaf4906011b7a961cbc3860126ffa SHA512 1d4429ecb2292e419ed6172cf251ba4a1448ed51424552ac48a159d0e3d3414777f7821382d1839b56f0c906fb0a147b1df4eecb071f8a5c11b0fc1d0d40d339
DIST llvm-project-14.0.6.src.tar.xz 105618228 BLAKE2B ee67c5407df8cef493b9c0004f15e428f22a536a17e5f4e3eb29a003b8a8ec0abe0fa3e072591161d5f30ef7d8867c1ce34d1b341ad858e93c00263499941a99 SHA512 6fc6eeb60fac698702d1aac495fc0161eb7216a1f8db2020af8fccec5837831f7cc20dc2a169bf4f0b5f520748280b4a86621f3697d622aa58faaa45dbfaad13
DIST llvm-project-14.0.6.src.tar.xz.sig 566 BLAKE2B cb658ad43d8ab6c43a5773aedadf0569c97b5ee4b1bd58eceb10e1879a30880c741c3d66bedd462c892309b688fb7b2673115a62d1f74d71ee375a578de9547f SHA512 b4a7b368532a7a4a24376cfa7db8f6d3478f6d4446474342fc00b474ecf466330cd0f16783209263c4c72d5fc7ddedfb11b95578842e700cfb7ee0bb34cc95d6
DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52
@@ -11,8 +12,9 @@ DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43
DIST llvm-project-62c0bdabfa32f6e32b17b45425b15309db340dfb.tar.gz 190948645 BLAKE2B f41d8ea32e189ef4641e42628fb516e307c9a6fcf65af537eb9fc0d3186591b062c5e85c9e935511ef706f28c6994a774a4e3f36ff54d79aaac7b293a6168625 SHA512 55a4cbfec3a496c1918aa614e5bdee368e4d0b6641c946d8bf8b828ab4bf4d9b29dbe96401a172079d70f924f5e513428fe990c65b556a0a860802cb13f5e3a0
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.5.ebuild 6549 BLAKE2B fd123a6d9327693eeb0c0ed0d7ff46a78b78338dc97d979ee653476282913803c568d388aa33445459ea4e345aa6f45b6d8c9cd36276da07a3140c4448d2e346 SHA512 2ce2ff37e1447bd8b48430774098b0399bc8eda216d2906dc9130f500d587561a31ce61ad87be200362b34660fe395a8f64df40198c4aa4649c5ed7d48ae8de0
+EBUILD compiler-rt-sanitizers-16.0.5.ebuild 6548 BLAKE2B bd810ec98e336e950c7acf2a3123a71825a6254bc21bc63323fafe0ae540a2bfdb3a9d5dd0003c5a509b889d3500d63f354aa61b412ba6fdd6f4bdce3b7abdc1 SHA512 e14fd1a99281942f824e4c0defbc4e9c6a62cf4df7354d4916e893d25f8336157a5c87ea419107dc5f1760419366e5e572e5a0bf59beec247c4e83c05dcb9f9f
EBUILD compiler-rt-sanitizers-16.0.6.ebuild 6550 BLAKE2B a3d856b59f3ad6ce433952a31081576c91576e764119720cf9af44dd54a1813f9f08da03c26cab7a4d00e8b44852197588b14eb52826419b353b44c926cf37bf SHA512 509c25c720fb1f4e3664491f41b23242dd24ba541cc319680cea6e0dc01bebe929af943281fe03473f49fff369b3021cc6abb0d5e6b8b1fd7fabc071961cdaa6
-EBUILD compiler-rt-sanitizers-17.0.0.9999.ebuild 6249 BLAKE2B 036338e02f018bd9cb01036851fcee5af58f012e15c4fcb55a207e519d2b553e83f2871869681055a9c672b091126e95d52a1c50a605a94e27b866b22dd64732 SHA512 94a1deb4cbba26d0e1aa02333c2d3375349b059e1fe75f26368ab54d13b276c27ea377f4cce9b1cdf0a508add5ddae4886a59bbb24cd8bec61a7e5d03660746c
+EBUILD compiler-rt-sanitizers-17.0.0.9999.ebuild 6250 BLAKE2B 0166eecaea9e102e761ff0f82deaac5b37cfdc534b1a6262f2e839c9971ea41d4c6123387ef6bf09ee98fefb6cc40aca4d6999378568ed831224e0fdededafdd SHA512 a61cc40f865d512870a881d990f5908c28c9dfa85e30eb5b80aff15f5dcfb8b190cdb9c5e66a57dbe1ec2943412a7600660144ad0d2bfa75c654519fc34b6380
EBUILD compiler-rt-sanitizers-17.0.0_pre20230609.ebuild 6249 BLAKE2B 036338e02f018bd9cb01036851fcee5af58f012e15c4fcb55a207e519d2b553e83f2871869681055a9c672b091126e95d52a1c50a605a94e27b866b22dd64732 SHA512 94a1deb4cbba26d0e1aa02333c2d3375349b059e1fe75f26368ab54d13b276c27ea377f4cce9b1cdf0a508add5ddae4886a59bbb24cd8bec61a7e5d03660746c
+EBUILD compiler-rt-sanitizers-17.0.0_pre20230615.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-16.0.5.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.5.ebuild
index 5be3f9c45abd..b9572c7e1e3e 100644
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.5.ebuild
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.5.ebuild
@@ -11,7 +11,7 @@ HOMEPAGE="https://llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
SLOT="${LLVM_MAJOR}"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ppc64 ~riscv ~x86 ~amd64-linux ~ppc-macos ~x64-macos"
+KEYWORDS="amd64 ~arm ~arm64 ~loong ppc64 ~riscv ~x86 ~amd64-linux ~ppc-macos ~x64-macos"
IUSE="+abi_x86_32 abi_x86_64 +clang debug test"
# base targets
IUSE+=" +libfuzzer +memprof +orc +profile +xray"
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0.9999.ebuild
index f3ca3131c8d6..b0a49349926b 100644
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0.9999.ebuild
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0.9999.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-PYTHON_COMPAT=( python3_{9..11} )
+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)"
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0_pre20230615.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0_pre20230615.ebuild
new file mode 100644
index 000000000000..b0a49349926b
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.0_pre20230615.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
+}