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/Manifest3
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc2.ebuild215
2 files changed, 218 insertions, 0 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index 33ea3a80ea03..57649e8b6149 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -3,16 +3,19 @@ DIST llvm-gentoo-patchset-12.0.1.tar.xz 5280 BLAKE2B 963d005bc7b636570be90eb841a
DIST llvm-gentoo-patchset-13.0.0-r3.tar.xz 10176 BLAKE2B fc5825a4bd3b85bd9c970901e5e036cc4c928373495a8a6f63c7f4531c7f52575d06f80dfbd80671d9f0fcd32d5c48d96f5961602b024c7a936362aeba8a612a SHA512 2289eef3f6301ade2e1110ebc4b66ad3db91ed10868ca7296a29c55667007e06739b01f38c0783bb2c56deadfb8a04605c370df9c5a4c6bc9aea9382e6ed52a5
DIST llvm-gentoo-patchset-13.0.0.tar.xz 5012 BLAKE2B 6760c78c086aaf6629143fd920b0a2c68cad9278628fbea8164dfeb59db95984a5b5d6b3505b510c697e8c95bf8d2be782c6b73c01622d52f2da9b07ecff39e0 SHA512 7764d49343b795b6bebae64f646ba27e3e6cc2a20b8a1aee645ce0d8474633c34acfbb73c08546fee415755dd4ea5a98c1d84db5e394cf5f4fc802eb61148ab6
DIST llvm-gentoo-patchset-13.0.1-rc1.tar.xz 5988 BLAKE2B 8f1d295d4b6937518d9e0cc00cc2ba9e12ff9773b35261f0985b2d2a4ed1e3363a7f961cb385728b5ae552d0e129d99d11e63958d32c3353b0a79a88ba5cc0d5 SHA512 8272c423a5e0e99d412bb449794ba2e8134aca69d09e90e93555dbd3b7549d6ce4d68617ca11074af0a35a6f6830bf0330cbc672c5a56054cfd824e3ac1900ea
+DIST llvm-gentoo-patchset-13.0.1-rc2.tar.xz 5192 BLAKE2B 4a129a3d0b7c1839d79c814ea57602f5e87aadb9050fc8e91868d2c3773ff7ae8e2137f785deeded6925a4368220767526c95790c9883f2031edc3ebae25b13c SHA512 2f384281d06f5378f7d1b2f036958c7db00d1c4d799406fd188fa8388f0cf18279dae36f2fb37bff26daa91419ab1bc1c2390be0f3af42359f1aef8de81b6ac8
DIST llvm-gentoo-patchset-9999-1.tar.xz 4032 BLAKE2B b9413484dafed8ae0c68c2c164b45fd07bb8d5d0898f03abe118fd2120ffcb1fb6c949de9649a97c2e8105f24b9d131a725c67c0a502ca4d4d192c1a0d65f49d SHA512 e64449eeaf756c5bd945109937b84ba4bd8a015222bd792d39cf3947871e87571a4ca57814790e51544cb05ad4c2d1f044e818e4caaac7c2e2a02cb1aa290fcc
DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
DIST llvmorg-13.0.1-rc1.tar.gz 147284646 BLAKE2B 3a1d8d382de633b7f8fc998f8ad1e03c24b733aefc591615cbd34115d1d6d74962ae33bbf2224527b521a76930ffee425527225563a558a04173e9aa9487c781 SHA512 d487bfc9b898ad0046e0c94338d7757d8a05a1a84d683abfbc9ed4994c6d12caf88fd18575225e284070fc67b3ac0970ca6639e61b1a7cc2948b216a5364a22d
+DIST llvmorg-13.0.1-rc2.tar.gz 147304491 BLAKE2B 86b2c64e57e4aaab837229b25a95d5517ac077d22cf552d71ff6b996dbdbcd171ad51de7eb12d098b50a139beda4ace843727181a1c6978fc487215391e64a3a SHA512 0d890f3317504c8cef10e118b245e5a4c815cc19f07cbc511a66bde6c9b1f3d15c167942608a8987befe9115b24657d29f72305f9f2794385a7434b80167f40f
EBUILD compiler-rt-sanitizers-11.1.0-r1.ebuild 6042 BLAKE2B b2e497920258f581395f794ac977615e42e153ea966fead3a7ce5fbd9c93831ec807f4b711ffc41a1ecb84214e3bd386ffc038b549bc9ade691b7f843a5032a4 SHA512 05092de752ccb3a1832eb834315a63e161b52a7bd4a52ec77b24adeff9611368fe1166bf7bd12b2111e15364a44d2573527111641d97b9e989e593342a4fbc9a
EBUILD compiler-rt-sanitizers-12.0.1.ebuild 5959 BLAKE2B acfa1240b3ffa450fe5ede50a6d8bc9d32b06bea46da57f82c004fbde8e69693242037f9571bf885f56d16d3ead4711402f1c3a2bf65fb42741ea95b12a1baff SHA512 cf095eeaf547d431d60b11f147e5e8a03e3659a3b56ec98be4af3fdbd4cb3ed16891eb8066187bff27613f0c6a37d30d08725df95419b515f1038087c149ad82
EBUILD compiler-rt-sanitizers-13.0.0-r1.ebuild 6162 BLAKE2B e9f41c36aa12ed0257e3fa3298a5504e13243c1f73a0c4e425a9660751011f05856d09f72eb6d6c5fe9c901b670173931899858420352bc63627df69feccb975 SHA512 b134ad7badbd4f6540f8d683c5a0b0b583702879465caa16a13ab0f528328d7db92ed214dae6698371671fec582429032b0d7dbcdcefa94721395f4d366de60a
EBUILD compiler-rt-sanitizers-13.0.0.ebuild 6154 BLAKE2B 97eaca6637d5f368d5f21e6640486734d1fb60fca89cc330ab19b7d129c425f8eefabfa225711a624018972b403329434e44e55fd1f69cf148d2b0d642ba08ae SHA512 31c7c45eec392795267f8ca2efa1f2894e183ef4fc5f575fbc531a60ebee3c90c4bb4a551f82a6723a3010ac5196a8c83cbd1b7e49704d9b9cfbe1cc68753cf9
EBUILD compiler-rt-sanitizers-13.0.1.9999.ebuild 6267 BLAKE2B b7ecec747a68860103387e1cae25abf3a1ac58bfbc50ee5c688eff80db144e36d2ae6f8ba799b8dbaf20f28c8c4d84059db61666bf99b3d54c462178c610d35e SHA512 75abb9c5f490c94d5f405fc77420996977fe471c4fbf8948ef9cf0c731bf4a418f6bb8697b1426e6e30b804dfd5f5a1c88af69f47ba944ab0cd5e0b99c650e5b
EBUILD compiler-rt-sanitizers-13.0.1_rc1.ebuild 6270 BLAKE2B 060af26424afc513543999476cc0dcecd68bc99dd69c651d7ba79c87cc8be4dd4d1639cb8fa0247e79c9eac55df60d17a634a6681fed277f50fcdb5cfa254ff4 SHA512 33e847e8cdffcf2bfe45f88797c944eac17d4526ba7a3dbb1ac4ecf8ae559e91b46a03eb540d164ec3a03c6f6acf38984e8e8e5835d0cb311bb6e01781f8196a
+EBUILD compiler-rt-sanitizers-13.0.1_rc2.ebuild 6270 BLAKE2B 060af26424afc513543999476cc0dcecd68bc99dd69c651d7ba79c87cc8be4dd4d1639cb8fa0247e79c9eac55df60d17a634a6681fed277f50fcdb5cfa254ff4 SHA512 33e847e8cdffcf2bfe45f88797c944eac17d4526ba7a3dbb1ac4ecf8ae559e91b46a03eb540d164ec3a03c6f6acf38984e8e8e5835d0cb311bb6e01781f8196a
EBUILD compiler-rt-sanitizers-14.0.0.9999.ebuild 6273 BLAKE2B 74cecea17e26529cf75ada6ba68c169d587033de3320ed5ed5f31ae85935cff691e9b025011338b34ea50d1a747f8fe2f3fe25874072cfb328704906d0c298bb SHA512 701c5f5d70c20d7cd1276763d7198438dc53772c2b2713be82a96b05d5ef3797d2866eb94b65b16d2a0e3f842caffe4578c12dc3e775368ebc0d7afc8811be0e
MISC metadata.xml 1330 BLAKE2B 8381c36fb0ee37358cebacf512ee2a0ff6f2c0fc8e05544d9dc1bb1e11bc53f4196c2ecc6c8eb66c833f266c8d12da2c92a5f0b94cb3404397f925f9ebfc2a72 SHA512 6ea6159eb0929dc9f009ab326295549db329f7594dd5ff82e255238ed1fb17e3e8909079c915c6ae4829bb853666456772d17fa2078a332f6340807d6cd4f20e
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc2.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc2.ebuild
new file mode 100644
index 000000000000..203bcf1a2488
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc2.ebuild
@@ -0,0 +1,215 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+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="!test? ( test ) !clang? ( test )"
+
+CLANG_SLOT=${SLOT%%.*}
+# llvm-6 for new lit options
+DEPEND="
+ >=sys-devel/llvm-6
+ 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-5[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${CLANG_SLOT}
+ sys-libs/compiler-rt:${SLOT}
+ )
+ !test? (
+ ${PYTHON_DEPS}
+ )"
+
+LLVM_COMPONENTS=( compiler-rt )
+LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest )
+LLVM_PATCHSET=${PV/_/-}
+llvm.org_set_globals
+
+python_check_deps() {
+ use test || return 0
+ has_version "dev-python/lit[${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/${CLANG_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${CLANG_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/${CLANG_SLOT}/bin/clang \
+ CXX=${EPREFIX}/usr/lib/llvm/${CLANG_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/${CLANG_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die
+ cp "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/bin/clang{,++} \
+ "${BUILD_DIR}"/lib/llvm/${CLANG_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/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
+ ln -s "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so \
+ "${BUILD_DIR}"/lib/llvm/${CLANG_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
+}