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.0_rc4.ebuild201
2 files changed, 204 insertions, 0 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index be638d01fc1e..97f564dcb390 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -3,17 +3,20 @@ DIST llvm-gentoo-patchset-11.1.0-3.tar.xz 5984 BLAKE2B 89056fb8e82c7a29ae76c643a
DIST llvm-gentoo-patchset-12.0.1.tar.xz 5280 BLAKE2B 963d005bc7b636570be90eb841ac5bcaeb927538cc7de27683167111a17d6496677c7517de2ecfaf14b5d8ac22bad357be490b8a2ed9aba502fd5f447ecc99e9 SHA512 fc7c38e671555751650299c3a8bee44d5c7f26e11b68d5538c507fb7fe9ff2d349bdcd43bce90a448a747f082d523b3849d6bcda5e3ae2e998edcb926d6aa249
DIST llvm-gentoo-patchset-13.0.0-rc2.tar.xz 5556 BLAKE2B e6c7ecfe8f842edc4d4f30a20c66973519182ecb46e21fb20b6c5fcb6d54cdef830fcb120a405b77f1332e3557acbbbbfa99170b20d17f137e0a63b2d0dc1258 SHA512 ddeaf1d07f0ba893ce93e5fe1eff1c0716769a7879fc503c397f4db7becb363f94747f59b6d53c204df73a93954fb0ca5aae6ad544ce55c964c4bf441a410cd2
DIST llvm-gentoo-patchset-13.0.0-rc3.tar.xz 5012 BLAKE2B 5399feeffe73e8fbd099c8058f1cc41e2fcb2feb446acc1394589c0397167786895d328d45ff481fb30605f215774b9e51e332124c0b071e969a2f01c5943c04 SHA512 d4fb2b08e253d9fa89070045282b4309ca9938011bf7f9b5364cc69c5030ff9353abb1624895b4bfeef2cd8e2f8c9b9f93fc8196f98dc0970457bca7787270c9
+DIST llvm-gentoo-patchset-13.0.0-rc4.tar.xz 5016 BLAKE2B 021ba4e67904e4cf4dfdf1ecfc1cd1cc860c2f43db97e04c40ca7d95567f6235a27a2a919083c58b89b269eefa2d751cb9c324bda6518c22e9fc01007936a520 SHA512 dce61179dffafc5992fb0e18314bba2d5fbf2f0470a491bc1ffc036274b65d0a1de741b23e2de32e873250c856a53707e06f8c560bd29f8a54a6ae0c74267f43
DIST llvm-gentoo-patchset-9999-1.tar.xz 4032 BLAKE2B b9413484dafed8ae0c68c2c164b45fd07bb8d5d0898f03abe118fd2120ffcb1fb6c949de9649a97c2e8105f24b9d131a725c67c0a502ca4d4d192c1a0d65f49d SHA512 e64449eeaf756c5bd945109937b84ba4bd8a015222bd792d39cf3947871e87571a4ca57814790e51544cb05ad4c2d1f044e818e4caaac7c2e2a02cb1aa290fcc
DIST llvmorg-10.0.1.tar.gz 120880730 BLAKE2B 30f19f56c4d1f6abcda5fec76256219d1e3c8a6ff1a1f152f94bfe362c07884339fe571ff7fe903ed3b3deb150b2fa868c387887a0dea2930dc08b81db71a5b1 SHA512 48078fff9293a87f1a973f3348f79506f04c3da774295f5eb67d74dd2d1aa94f0973f8ced3f4ab9e8339902071f82c603b43d5608ad7227046c4da769c5d2151
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-rc2.tar.gz 147267736 BLAKE2B 153bf7320f2aa911112d366ffc79f7110cb04f135c2a8b176c263f0a75eb768206d9bd462893d45504b0e58aa9e127fdcafb02300eab1666e4616aa654d457dd SHA512 a01baf3eaa02f02af42bfcf6dcf24f166351bf1c09601495617c81e41def23210573bad40a344270f40c5deb881d06863536abac2a6481930766a6a56335fb44
DIST llvmorg-13.0.0-rc3.tar.gz 147281901 BLAKE2B 640065a2f32dc48edf084d776cb6b950fae86c2a204999e2eec67f93b57615df40adec19785099b0ef2fe11837c3304794ec3585289a5b5051a557618c63c749 SHA512 1401d5a4d6bb5c930d74b9cfbc8e792872f721aab7d7f0c819e2ba5cf47fb818d160c1f71784fba69827f3c9b7414aa91a585d2b813c1851b4799f9d62cebc46
+DIST llvmorg-13.0.0-rc4.tar.gz 147286367 BLAKE2B a43c54b8bb379b0374f99ae07066d7ba4ae2a83dfdb61390101c736f91dc44aa07a88778551aaaf903033562b2a0a863ea6b27392b700c9cddc74e2c7899cad1 SHA512 8ccaaea21ec4fe3c4b4446d3a7cae36a47ed196f407d341da45824bcefefffd3c412c0c5c27670ceaba1458bc53107273f9d3aec2de261b6b82c6d209b45b14d
EBUILD compiler-rt-sanitizers-10.0.1-r1.ebuild 4513 BLAKE2B daa067db497d6548d10041d7a2e99aca314c0b8c136e045d799f1205df135c04af2bce717e0fa281b67a6ef6bbf95fad014d1ae354eada02b2c79884af8e7576 SHA512 3579b322368ca2f350d2d373f6addc871aa8046d80dfead13d90a6564f288f35244bd5957b96d743356af7aa9560e3ca8ebb5863eea7c835fd8648e8b0fb4d8e
EBUILD compiler-rt-sanitizers-11.1.0-r1.ebuild 6036 BLAKE2B 30bbe8f96289a6a4e66367728d74c3cd4631a11273dd0b2a597251c9742205577d4561c92ca9ba15d1afa7a58cb049441828b09b1d77ab1bee4d4cc6227d2673 SHA512 6755070c159402442b3e02ab21a9415313ddf82c6c54bd0a171b987c155bd85f6d0882d4146d02695fc4c157892106b9d1678235f92c28d7fe86fe8e9bb9486e
EBUILD compiler-rt-sanitizers-12.0.1.ebuild 5953 BLAKE2B 0ec7119964117296614c6b628be687413ec34520566e03d9f21347e703ea3cb4dfe7b8423e97623fe1c1e1b8a02adc903f88f3231973b37e37b65da914f28549 SHA512 507194770b1410304a20b50a138579c2f0fdb55064693b6404ee509a9623e9174f063ce0f07f5b79da052f6e4b6d99c01b42be55113effb6aaa5c112c3fa7363
EBUILD compiler-rt-sanitizers-13.0.0.9999.ebuild 5933 BLAKE2B 74922d3c2fec0c97e72748142c4b3f4ebe38b7e488f1fa92593f5399efcbe4629afcf9587a8d5adbc68034c62110912c8882bc88deffdad4963d5841f6147b09 SHA512 86d8343941cb32e6fd8c3c8590c4e975fc40b3dc87dbb27c4b01db16c52ce68ca430dd90365ae8972e16c016a2ad780b6c569738856ef20081480832a67192ea
EBUILD compiler-rt-sanitizers-13.0.0_rc2.ebuild 5937 BLAKE2B 34e03d52dbf84889dee002c954abf963e47d3ac4392f162543635f10b14d031ab9cde767968a200e669a31f7aa4dced6a4e3f22d3a7fdaa2fc6109a7761a80eb SHA512 cf22df030b72296bcffad9b741d85ea031ff2b941ea540b4021928797f3f3667929cb586b4389f93aee3c063151e72f6ac14d2dcaea27c71e68272beac3d68a0
EBUILD compiler-rt-sanitizers-13.0.0_rc3.ebuild 5937 BLAKE2B 992a296137d038e8bab1363e04d07278049c872de95ec57af695a3933b673d2b9ab2ce8fc998ca40506b4084dd5d1ad4b7ad51bb11f6abc4f003c32e27118745 SHA512 66df28c9d0a4ee02b419d876183c324831b6851aff8fd7d146f2ff97d68f24f9a219455f1c6ced4434daf0a1719ad062c1eb1ac297ee4a8d2cfa772dc40675d9
+EBUILD compiler-rt-sanitizers-13.0.0_rc4.ebuild 5936 BLAKE2B 09efc3324928d51be74a368f49c79b2e1609dd9f8c0784e9f430b4da0d4edb0d78e042272261556ca6386178c3075cb65848585c11c61609b4d30055497ac043 SHA512 5e4c1d2458d66870a7181c33e89f6ccce203056f7ac02c0b1e6a764becb7639d9e38ee648d98963a4bc9d30772fd284a6d200f215a16a89e4b974c0ba7db528d
EBUILD compiler-rt-sanitizers-14.0.0.9999.ebuild 5933 BLAKE2B 74922d3c2fec0c97e72748142c4b3f4ebe38b7e488f1fa92593f5399efcbe4629afcf9587a8d5adbc68034c62110912c8882bc88deffdad4963d5841f6147b09 SHA512 86d8343941cb32e6fd8c3c8590c4e975fc40b3dc87dbb27c4b01db16c52ce68ca430dd90365ae8972e16c016a2ad780b6c569738856ef20081480832a67192ea
MISC metadata.xml 1387 BLAKE2B 0da208a4e86ac6bcbe8a4bd585954e808b66995f8506f199fad46ab6ed21e23ba3af856a9890961d2bcb3ef62b5d5184cf8cc5b69ade82c3733251a0f83bdf4b SHA512 8ae0880c2f6ea556e9954760ca43ceb77180e38999648029533f78768bcd1fed2e67e418d6ebf02621946bae6685ccc37be84a47f10e45a78c0b3ce285a20f0b
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0_rc4.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0_rc4.ebuild
new file mode 100644
index 000000000000..2bc8c92f6b03
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0_rc4.ebuild
@@ -0,0 +1,201 @@
+# 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=""
+IUSE="+clang 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"
+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}
+ )
+ ${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() {
+ # 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
+}