summaryrefslogtreecommitdiff
path: root/sys-libs/compiler-rt-sanitizers
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-04-19 12:05:02 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-04-19 12:05:02 +0100
commitb6cfc0c19effe2d9f7b8ab303cd00636f16da253 (patch)
treea0158050dac0a7ebfb9df4f667ec6ad2dd185538 /sys-libs/compiler-rt-sanitizers
parent2d01b3d133c0fbf17de8d7b47905585af88bd6e4 (diff)
gentoo auto-resync : 19:04:2024 - 12:05:02
Diffstat (limited to 'sys-libs/compiler-rt-sanitizers')
-rw-r--r--sys-libs/compiler-rt-sanitizers/Manifest3
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.1.4.ebuild218
2 files changed, 221 insertions, 0 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index 0d31278324f4..b9077219585a 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -8,12 +8,15 @@ 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-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
+DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29
+DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386
DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1
EBUILD compiler-rt-sanitizers-15.0.7.ebuild 6648 BLAKE2B 89d90e750bc9c3c35e8a42a259fd84bc147ed9b7ed66168435f0010ef8adaf35e04e2cd43c1acc144668e04f5c229ca3cfd99aeb01b4ba2e46f10dd4615e131d SHA512 4f290993d65b7a17280c5ea9a9d19e13cefdde3aebc2236271e02bb1517655895e8eb3adc2047a849ce11dbacf8d7eddec715ab14523122089d856c21ae123a0
EBUILD compiler-rt-sanitizers-16.0.6.ebuild 6615 BLAKE2B 3ca63eefd87ce02510afa912e809895da7356a8e248f402f3fca1583048feebf80cba20f076e1b28fa4ad7f7c06781910948fc49d980b03276a900dc75114e06 SHA512 7f34e0416b520c75457f8267f28630f7a665f05e22d3f5c2d96ea631fcda79a584b6c0e75cba8b7fba7bf28b87a6b19b49be3b4b8770393caabc5ebc83831ebe
EBUILD compiler-rt-sanitizers-17.0.6.ebuild 6447 BLAKE2B 553a762d6dd06dafca05953f4d60e5e3dd215d813da29053d5c4c44750554e3ed90c187390196eeee3bc85bb1e3fbdac7aa2e100b623271898478003792a1302 SHA512 6beaa92bf1ba5213dc9c73395ecdae737f1a84119da6e3f8f008f9f21cf7d7b08b3634ad8768af6b19992fd49d964344c7d37e19b7c7bfec02af644bdc730bbd
EBUILD compiler-rt-sanitizers-18.1.3.ebuild 6358 BLAKE2B d68fe00a7d79a022d2c66f03d1987491c7d382158426a5f27923f84df05cf5d27697abacad984e94a5b5f333bcd1e60d080ebbc4708f4abe77086bc777aeaaf5 SHA512 fcaf7d7203ede21db563de3b24bbf4d2939856913ba5ee3fff4f29eef18d6e93789791bc3e0d0b4ecd761fd7e8772b3a9f7ea5149300a22f99ee46e6caafbcd9
+EBUILD compiler-rt-sanitizers-18.1.4.ebuild 6358 BLAKE2B d68fe00a7d79a022d2c66f03d1987491c7d382158426a5f27923f84df05cf5d27697abacad984e94a5b5f333bcd1e60d080ebbc4708f4abe77086bc777aeaaf5 SHA512 fcaf7d7203ede21db563de3b24bbf4d2939856913ba5ee3fff4f29eef18d6e93789791bc3e0d0b4ecd761fd7e8772b3a9f7ea5149300a22f99ee46e6caafbcd9
EBUILD compiler-rt-sanitizers-19.0.0.9999.ebuild 6268 BLAKE2B 98422f1f8be179031ffed4ea9176843521842aff5be2cbdcb21f6ea2020a8d13a1c6fc4810e769c0ec0775f92af45831c4385cc70680765f474885c5ad5b389f SHA512 8677df281de24325290cb99cc4f6087460443c716ac2eea7b3c8175281daad874cd7aab0dda8f4d60213a1b73a8f1a921ae7ad0733d104a7db0e8e5f2ac35127
EBUILD compiler-rt-sanitizers-19.0.0_pre20240330.ebuild 6268 BLAKE2B 98422f1f8be179031ffed4ea9176843521842aff5be2cbdcb21f6ea2020a8d13a1c6fc4810e769c0ec0775f92af45831c4385cc70680765f474885c5ad5b389f SHA512 8677df281de24325290cb99cc4f6087460443c716ac2eea7b3c8175281daad874cd7aab0dda8f4d60213a1b73a8f1a921ae7ad0733d104a7db0e8e5f2ac35127
EBUILD compiler-rt-sanitizers-19.0.0_pre20240404.ebuild 6268 BLAKE2B 98422f1f8be179031ffed4ea9176843521842aff5be2cbdcb21f6ea2020a8d13a1c6fc4810e769c0ec0775f92af45831c4385cc70680765f474885c5ad5b389f SHA512 8677df281de24325290cb99cc4f6087460443c716ac2eea7b3c8175281daad874cd7aab0dda8f4d60213a1b73a8f1a921ae7ad0733d104a7db0e8e5f2ac35127
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.1.4.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.1.4.ebuild
new file mode 100644
index 000000000000..192ead8311f8
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.1.4.ebuild
@@ -0,0 +1,218 @@
+# Copyright 1999-2024 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.org llvm-utils 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="~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"
+# 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="
+ 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
+ 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_prepend_path "${LLVM_MAJOR}"
+
+ # 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
+}