From 2771f79232c273bc2a57d23bf335dd81ccf6af28 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 5 Dec 2021 02:47:11 +0000 Subject: gentoo resync : 05.12.2021 --- sys-libs/compiler-rt-sanitizers/Manifest | 9 +- .../compiler-rt-sanitizers-13.0.0.9999.ebuild | 205 -------------------- .../compiler-rt-sanitizers-13.0.0.ebuild | 4 +- .../compiler-rt-sanitizers-13.0.1.9999.ebuild | 215 +++++++++++++++++++++ .../compiler-rt-sanitizers-13.0.1_rc1.ebuild | 215 +++++++++++++++++++++ .../compiler-rt-sanitizers-14.0.0.9999.ebuild | 18 +- 6 files changed, 453 insertions(+), 213 deletions(-) delete mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.9999.ebuild create mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1.9999.ebuild create mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc1.ebuild (limited to 'sys-libs/compiler-rt-sanitizers') diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest index 5bbed7d9cb89..2fb7688b166f 100644 --- a/sys-libs/compiler-rt-sanitizers/Manifest +++ b/sys-libs/compiler-rt-sanitizers/Manifest @@ -1,13 +1,16 @@ 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.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 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 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.9999.ebuild 6082 BLAKE2B 41bf42010e9a12a624c04d8c2d05e6ae31f9257561b4d0d95573d4dffd8463bf50a65f219e3541ea0a35630493f31600cbc3fb0a08163bc68fda4ee241d29068 SHA512 6e8ca73ad90955e6b6d7fbefed05ffc888da81af615995a752a99a9a46c0ced0bde661036c613b9f85f6064fc5d8cf577fe59d3793c4843bfb8e5bdb36045daf -EBUILD compiler-rt-sanitizers-13.0.0.ebuild 6152 BLAKE2B 595a843498fa2c53c7d50ccadec868bf5971326dbc1181516d98ce78dd70878f69bbc3e1f60a96d1a37847f72c1818a8f374344bf7f4f88261f274b4b8dba34f SHA512 d62e14e926ba08d25f86dccca81692c42dcd779bd75d34e11822f2234a0c45e2cd6b4f066ee03cc6fcf6cacb1c5ae9fb22497ff99431453d7feb2657b3bc715c -EBUILD compiler-rt-sanitizers-14.0.0.9999.ebuild 6082 BLAKE2B 41bf42010e9a12a624c04d8c2d05e6ae31f9257561b4d0d95573d4dffd8463bf50a65f219e3541ea0a35630493f31600cbc3fb0a08163bc68fda4ee241d29068 SHA512 6e8ca73ad90955e6b6d7fbefed05ffc888da81af615995a752a99a9a46c0ced0bde661036c613b9f85f6064fc5d8cf577fe59d3793c4843bfb8e5bdb36045daf +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 +EBUILD compiler-rt-sanitizers-14.0.0.9999.ebuild 6285 BLAKE2B 4a58d2e54544efc3c3e5f93bc271f3ea1614cf57fbcbf6843f002a604408113d716af623cd48220c7b6213ca15d28740962b919e86bd9e2ee104bdd701732ded SHA512 ee85bf07631a79eea71973f2dbf006afde4642fd4fc001f0480618a846182ee4abdc8f2347d42fd90aa4da51ece7509c69ba001b61363f6e2eefe686d17d16e3 MISC metadata.xml 1330 BLAKE2B 8381c36fb0ee37358cebacf512ee2a0ff6f2c0fc8e05544d9dc1bb1e11bc53f4196c2ecc6c8eb66c833f266c8d12da2c92a5f0b94cb3404397f925f9ebfc2a72 SHA512 6ea6159eb0929dc9f009ab326295549db329f7594dd5ff82e255238ed1fb17e3e8909079c915c6ae4829bb853666456772d17fa2078a332f6340807d6cd4f20e diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.9999.ebuild deleted file mode 100644 index 80c9d7d0f6b4..000000000000 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.9999.ebuild +++ /dev/null @@ -1,205 +0,0 @@ -# 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 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? ( - !=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=9999-1 -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 -} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.ebuild index 13512435fcd3..68f7e7b395dd 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.0.ebuild @@ -45,7 +45,9 @@ BDEPEND=" =sys-devel/clang-${PV%_*}*:${CLANG_SLOT} sys-libs/compiler-rt:${SLOT} ) - ${PYTHON_DEPS}" + !test? ( + ${PYTHON_DEPS} + )" LLVM_COMPONENTS=( compiler-rt ) LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1.9999.ebuild new file mode 100644 index 000000000000..f89af63c6d33 --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1.9999.ebuild @@ -0,0 +1,215 @@ +# 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="+abi_x86_32 abi_x86_64 +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[abi_x86_32(-)?,abi_x86_64(-)?]" +BDEPEND=" + >=dev-util/cmake-3.16 + clang? ( sys-devel/clang ) + elibc_glibc? ( net-libs/libtirpc ) + test? ( + !=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=9999-1 +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 +} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc1.ebuild new file mode 100644 index 000000000000..c456d296bcb8 --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc1.ebuild @@ -0,0 +1,215 @@ +# 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="+abi_x86_32 abi_x86_64 +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[abi_x86_32(-)?,abi_x86_64(-)?]" +BDEPEND=" + >=dev-util/cmake-3.16 + clang? ( sys-devel/clang ) + elibc_glibc? ( net-libs/libtirpc ) + test? ( + !=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 +} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-14.0.0.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-14.0.0.9999.ebuild index 80c9d7d0f6b4..4e70cfd227c4 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-14.0.0.9999.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-14.0.0.9999.ebuild @@ -12,7 +12,7 @@ HOMEPAGE="https://llvm.org/" LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" SLOT="$(ver_cut 1-3)" KEYWORDS="" -IUSE="+clang debug test elibc_glibc" +IUSE="+abi_x86_32 abi_x86_64 +clang debug test elibc_glibc" # base targets IUSE+=" +libfuzzer +memprof +orc +profile +xray" # sanitizer targets, keep in sync with config-ix.cmake @@ -34,7 +34,7 @@ CLANG_SLOT=${SLOT%%.*} # llvm-6 for new lit options DEPEND=" >=sys-devel/llvm-6 - virtual/libcrypt" + virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?]" BDEPEND=" >=dev-util/cmake-3.16 clang? ( sys-devel/clang ) @@ -45,9 +45,11 @@ BDEPEND=" =sys-devel/clang-${PV%_*}*:${CLANG_SLOT} sys-libs/compiler-rt:${SLOT} ) - ${PYTHON_DEPS}" + !test? ( + ${PYTHON_DEPS} + )" -LLVM_COMPONENTS=( compiler-rt ) +LLVM_COMPONENTS=( compiler-rt cmake ) LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) LLVM_PATCHSET=9999-1 llvm.org_set_globals @@ -137,6 +139,14 @@ src_configure() { -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" -- cgit v1.2.3