summaryrefslogtreecommitdiff
path: root/sys-libs/compiler-rt-sanitizers
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2021-12-22 14:08:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2021-12-22 14:08:05 +0000
commit93a93e9a3b53c1a73142a305ea1f8136846942ee (patch)
treeb9791a06ab3284e27b568412c59316c66240c682 /sys-libs/compiler-rt-sanitizers
parent2771f79232c273bc2a57d23bf335dd81ccf6af28 (diff)
gentoo resync : 22.12.2021
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-13.0.0-r1.ebuild207
2 files changed, 209 insertions, 0 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index 2fb7688b166f..01cac0806ef0 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -1,5 +1,6 @@
DIST llvm-gentoo-patchset-11.1.0-3.tar.xz 5984 BLAKE2B 89056fb8e82c7a29ae76c643ac631876d51391ffb579324aaf13c7f79e03f6fd8bbcb27d46e57e0f04a702602ebf51c116e82cb092452a1dbc97fb0eb7518f11 SHA512 08aabe8836b62ecfde4e264d567169ba495d5b5915b56aba35ae86992387e534bba6d512fde94056e641abe909b478e47edcbdaa3ee0b94182ecd68c98201441
DIST llvm-gentoo-patchset-12.0.1.tar.xz 5280 BLAKE2B 963d005bc7b636570be90eb841ac5bcaeb927538cc7de27683167111a17d6496677c7517de2ecfaf14b5d8ac22bad357be490b8a2ed9aba502fd5f447ecc99e9 SHA512 fc7c38e671555751650299c3a8bee44d5c7f26e11b68d5538c507fb7fe9ff2d349bdcd43bce90a448a747f082d523b3849d6bcda5e3ae2e998edcb926d6aa249
+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-9999-1.tar.xz 4032 BLAKE2B b9413484dafed8ae0c68c2c164b45fd07bb8d5d0898f03abe118fd2120ffcb1fb6c949de9649a97c2e8105f24b9d131a725c67c0a502ca4d4d192c1a0d65f49d SHA512 e64449eeaf756c5bd945109937b84ba4bd8a015222bd792d39cf3947871e87571a4ca57814790e51544cb05ad4c2d1f044e818e4caaac7c2e2a02cb1aa290fcc
@@ -9,6 +10,7 @@ DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e
DIST llvmorg-13.0.1-rc1.tar.gz 147284646 BLAKE2B 3a1d8d382de633b7f8fc998f8ad1e03c24b733aefc591615cbd34115d1d6d74962ae33bbf2224527b521a76930ffee425527225563a558a04173e9aa9487c781 SHA512 d487bfc9b898ad0046e0c94338d7757d8a05a1a84d683abfbc9ed4994c6d12caf88fd18575225e284070fc67b3ac0970ca6639e61b1a7cc2948b216a5364a22d
EBUILD compiler-rt-sanitizers-11.1.0-r1.ebuild 6054 BLAKE2B 0e7ecc21c987bdb184c18456c2d6482d268b6f04fa8a9e1694e2e4733c0ff5e0f5f93639358b1bb9ede250c1543dd89cdfadf1382aa334a4593b3655f1915c56 SHA512 e13805c26cf03152295f9794468910560932fdcc769a4dd9461f92172a20e41b38b9867d988c82ae7d9516c5f2b18e32d8e14bbbe0702c81b7f222eae51988ab
EBUILD compiler-rt-sanitizers-12.0.1.ebuild 5971 BLAKE2B c71a8e7f9c741b7bb9ce9034312dd3fcea08a2097ec322126efe3ddc9f8d945f9aa02fbf6c0afdd12d19e2ec038e4894d74a149e83caf0aa59fad0cff84c2eee SHA512 9b7ea1e034d0d89cec9d5ff97e2bb34c09303f339c3d4fd4d4f31e2ba4ae7aab1bdcc8201afde8899c87892bdd7022104d90c78b8d4dab5f7c01787c21a41b17
+EBUILD compiler-rt-sanitizers-13.0.0-r1.ebuild 6174 BLAKE2B 75c9d27f6a706353339699716ea645b5312fb85e4c9412a7de0a1c54daf5d9bdb294f7efa1be2e14d4bc01cb5070a246dcecbff5731b7f3935c382a09d018924 SHA512 ea299794cdf486dcefdc0f6816431ff7cdd06b6a0e05d6092aca91b7a6590b835e6a44308b19f70b177dfa1d2154e94a5fc751c7cd6a0c1cbc5142c8212d08ca
EBUILD compiler-rt-sanitizers-13.0.0.ebuild 6166 BLAKE2B da87e6107b847ca1c396f0156a30b6601fe2f63365f8f240f5f2ad2fd176ed1381192deae9914477adc89f1e671136e5a7957c7abbf6f3eebd679faa96ed4e44 SHA512 e7c6b8cc95630d79ce7eab3d9bd495d48c42d30cb8093ae58f54345b1c2e218ce2341a720d356633651e521723b6733afefc049684b8282eb527dd260c73f0d9
EBUILD compiler-rt-sanitizers-13.0.1.9999.ebuild 6279 BLAKE2B df8334b59452915cf01032ec01a83b1377558abfda797b9c95327fb56c7b9d7fc46af4a1eb86f1679a2c44e8e055f790929fe3485022b80bfc5e58623d79d96a SHA512 acbc028c23560765dc152ff982a57120536718ccabd7298e388187a13adb065610ad94ae51655622b69498305bec6e24f13c6c67fe00b4aa33df160140f593c4
EBUILD compiler-rt-sanitizers-13.0.1_rc1.ebuild 6282 BLAKE2B 5fd607563088ad551f09ee07d0c087d208970c7e20e1faa0e21b88bc8775ae5594eb3a341469d2d5488e09d062ddfbad5e3044523376ce429a42e8e8b38dd7f9 SHA512 209def963cca6193e1dfdd20cc6b68829d292905827c6a7a23ebdc18eca67815783362649c68c1590f908916a52db0106c046dcb46d6eee746487f2c8bc38ba2
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0-r1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0-r1.ebuild
new file mode 100644
index 000000000000..dc6d1d54b523
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0-r1.ebuild
@@ -0,0 +1,207 @@
+# Copyright 1999-2021 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="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86 ~amd64-linux ~ppc-macos ~x64-macos"
+IUSE="+clang debug test elibc_glibc"
+# 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"
+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/_/-}-r3
+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 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
+}