summaryrefslogtreecommitdiff
path: root/sys-libs/compiler-rt-sanitizers
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-03-23 19:01:15 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-03-23 19:01:15 +0000
commit36fc50e36ed1a4686bb7202aeaff3170b2206124 (patch)
tree7b5feb28a3ad8ba78d57f64c93cc796cff95cd53 /sys-libs/compiler-rt-sanitizers
parentacc2dacf2ee9a5b03df96da670153f2e3a24d80c (diff)
gentoo auto-resync : 23:03:2024 - 19:01:14
Diffstat (limited to 'sys-libs/compiler-rt-sanitizers')
-rw-r--r--sys-libs/compiler-rt-sanitizers/Manifest4
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.6.ebuild2
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240322.ebuild217
3 files changed, 221 insertions, 2 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index 0198c541207f..5b95ee758f73 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -8,10 +8,12 @@ DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149
DIST llvm-project-18.1.2.src.tar.xz 132060436 BLAKE2B f21fca02fe9e02a3d440595aafbe0572be318ce69cc6285c1bf3dc9187b37ebf4c76f3ea60b6870c441675288f46e5597b069ec451d5026c5161f84daef6b4b2 SHA512 a0d01b018abbdf1609abc7b63911bb4c6c3619b748a0616b66be0843fcaa4240868412c5d1f77fe6dafdfed665b46570e7ce615da58efcaa91e9ddc8481e6fc4
DIST llvm-project-18.1.2.src.tar.xz.sig 566 BLAKE2B 97c6b6b4a041316e70abd54ff715d87a62410fe5590c9b90548fff5a5121d8d5e028ec681f7e99c130d6c6726835365825286ef0a01c82a98394d9369ea7a390 SHA512 1cd8d1c227782cb43e269696045cea500a43f3c6b786f2cda8d380f5b8fc28d3ada11c41c4a252f2d3db465f767b27ea50c5659faa43d4aa5655cc3ffd6243c2
DIST llvm-project-6d3cec01a6c29fa4e51ba129fa13dbf55d2b928e.tar.gz 207700152 BLAKE2B 855720b7a9cc7b1d8fdf398394eb5c702dd615c04e7dad51c449cb1c2f46e75f2ccf2ee10fa3a3403d6aec29f557023a11bd8cdb525bc9c3d76c79f23cd15e82 SHA512 ff6269158e165907c69bd3e4d2d6b87b4f4670546b7e290d7e6665e7097ec887d71174fa37bf5e1755524317e8ae8f0c7c7e428049e8b553faa52c614f1f4490
+DIST llvm-project-f3cfe016c5d8429c0dccfa6f85442e2ea0d45a58.tar.gz 208184654 BLAKE2B abd35798f7c921866bb221cecc42aa94915271d0804acbf44dbe5640efb787ef9d928c329eacde768fac4292217ed4d3c4187fba02dd1c826059aeaa1bad33f0 SHA512 513f7278367114ba3fe3271e8a790b62adbca97d280968537e44e5df9a7afb467a5ca93480f4d4fb7c4d5c0734d00ab54559bf68c00f09a1fcff2fee492aa84f
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 6449 BLAKE2B 98bb6906df46fa426d757e7fa3bacd587988699524b79427242a921b90cac2d59096d18e7179a53ebc89e6b89b3510d3dc5fea7d57ad6f8b7964bc84965b8e0f SHA512 4d37d28dd436dccbe843623507ef254e5019dde6b94f1b67182a89e431edb380b2809584c316257761e2b62f07463d7f2fd6f0fe1cc87bb9cf2dae37f850e46b
+EBUILD compiler-rt-sanitizers-17.0.6.ebuild 6447 BLAKE2B 553a762d6dd06dafca05953f4d60e5e3dd215d813da29053d5c4c44750554e3ed90c187390196eeee3bc85bb1e3fbdac7aa2e100b623271898478003792a1302 SHA512 6beaa92bf1ba5213dc9c73395ecdae737f1a84119da6e3f8f008f9f21cf7d7b08b3634ad8768af6b19992fd49d964344c7d37e19b7c7bfec02af644bdc730bbd
EBUILD compiler-rt-sanitizers-18.1.2.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_pre20240316.ebuild 6268 BLAKE2B 98422f1f8be179031ffed4ea9176843521842aff5be2cbdcb21f6ea2020a8d13a1c6fc4810e769c0ec0775f92af45831c4385cc70680765f474885c5ad5b389f SHA512 8677df281de24325290cb99cc4f6087460443c716ac2eea7b3c8175281daad874cd7aab0dda8f4d60213a1b73a8f1a921ae7ad0733d104a7db0e8e5f2ac35127
+EBUILD compiler-rt-sanitizers-19.0.0_pre20240322.ebuild 6268 BLAKE2B 98422f1f8be179031ffed4ea9176843521842aff5be2cbdcb21f6ea2020a8d13a1c6fc4810e769c0ec0775f92af45831c4385cc70680765f474885c5ad5b389f SHA512 8677df281de24325290cb99cc4f6087460443c716ac2eea7b3c8175281daad874cd7aab0dda8f4d60213a1b73a8f1a921ae7ad0733d104a7db0e8e5f2ac35127
MISC metadata.xml 1412 BLAKE2B 75675507000fa6a6b8182e6b45a08a2716ae7fb9a7e3428dc8420464e4c1d1bdb5bea62cc2f553c579de5a4faa752b35cb3529d980fb07a055ff4ddf6e752707 SHA512 f05ea5168b923db72f4f5b53e9b748ebbcdae9eff09d86323313055933b47fc0089e1b2d73cd997d73dcfb2dca032344955816425fbddc09d27ca751463aadbb
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.6.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.6.ebuild
index b9264ab7e0a0..204f3d0d371a 100644
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.6.ebuild
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-17.0.6.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-19.0.0_pre20240322.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240322.ebuild
new file mode 100644
index 000000000000..57f868d54be6
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240322.ebuild
@@ -0,0 +1,217 @@
+# 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}"
+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
+}