summaryrefslogtreecommitdiff
path: root/sys-libs/compiler-rt-sanitizers
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-01-22 10:09:44 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-01-22 10:09:44 +0000
commit09351e78166b5e864197c4456ebae3f89dd0bed9 (patch)
tree41a96399f56ed3aa399006871bfce4430db84aa2 /sys-libs/compiler-rt-sanitizers
parentc8a77dfe4d3d307c1d5dd2650b7297447d8b609d (diff)
gentoo resync : 22.01.2019
Diffstat (limited to 'sys-libs/compiler-rt-sanitizers')
-rw-r--r--sys-libs/compiler-rt-sanitizers/Manifest10
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild4
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild4
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-8.0.9999.ebuild173
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild8
-rw-r--r--sys-libs/compiler-rt-sanitizers/files/5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch61
-rw-r--r--sys-libs/compiler-rt-sanitizers/files/9999/0001-sanitizer_common-Fix-using-libtirpc-on-Linux.patch67
-rw-r--r--sys-libs/compiler-rt-sanitizers/files/9999/0002-test-Support-using-libtirpc-on-Linux.patch100
8 files changed, 249 insertions, 178 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index 2e6ef8f63ee0..3f6c6e6acf08 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -1,7 +1,6 @@
+AUX 5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch 2336 BLAKE2B 501238f8bb3881b427ff4673933c4544596fcbd3e129876d17b8506498c0513aeec69acd2a38f1d009a7df9f8aecf3e10d88301281722f156a32f76fea131c53 SHA512 7b2b71bb5cb11d6f0d96d0f5f33f2f7da7b4c637e191248c83e27e536d277bb1dee92affa0ca2092c870648525ed7d7b97a29af71aef3631764f724b61118720
AUX 7.0.9999/0001-sanitizer_common-Fix-using-libtirpc-on-Linux.patch 2583 BLAKE2B be7e9a2cbab8b3bd110346f6c8bda30d104397601950c995b77388fcb91e53ca82f5d3574931c58244403eee698f01209ca9e704fd4c6b9b3ef08e68d41dbea7 SHA512 656a7bbdcf0f678814d0ad0ff56ce43b7fc48c7a549373a4ef77e74490437283c5834e86b1b4e8bcb85578953687d79474ef2bf494c7eed4cf7fa1f17003f385
AUX 7.0.9999/0002-test-Support-using-libtirpc-on-Linux.patch 4161 BLAKE2B 3db2dcebf70ca3e7c399dfb22d8ae50d51863f7a8a15a10b0232f73d4fc2ee0b51ff67e8842b0e4d29dd41e60a326c90670f62a431ca593617f566e03bc7f90a SHA512 2f03f4d0232b600861de0c527d6bef26b0e3273865a7d7344e083a6a7de4033de6d30df3a6b22f4d23be74dfa8864ccaebd42c1f0d4474abc83a66f8997e19fb
-AUX 9999/0001-sanitizer_common-Fix-using-libtirpc-on-Linux.patch 2583 BLAKE2B 9d7ca157f6a14784e1207d3051719eea3ba069dc1ba34f7067cca630680993f3953a7e2f5600ec3ab184bbc0fb39b59281523481564122eb1580bc91d5c6e18a SHA512 5a74754bd19861ca2cbf28966dd13b6e17fa0024c6e3f1e513e6aabd732fc5d5804b01e25e538e434b48f6c7f10923cc09d0ced10fadef870cb43aa42082a9a4
-AUX 9999/0002-test-Support-using-libtirpc-on-Linux.patch 4183 BLAKE2B 385c8bc659031b6c6a6bb03506b142915f69be36acaf65440da40e7f33af15095a429d177a7be9d75c09dca38842d5ba0c960ce29764f9f8b2fe9df46496b88f SHA512 d06f7248fa18edd360bfb6c481ac260b9e5162550c09d2c4fc99c46d65e6f025e15aa6cc6b629847c26a441db271c7adc5b3d39b9895fce1dfc6326098478ba6
DIST compiler-rt-4.0.1.src.tar.xz 1434100 BLAKE2B ca6bf78fc07f387b7244a52ef648b06a5685effb46a66b241a9ee847ecafb17d02602f49b0dbe473d47202586874a043a6d75141400062f526d2f808da323e1e SHA512 cfeb625884b273f7c0e6767b81a8d3e5f24e0b96a510d5764d9d47a0e215fc841b4cb9d1843c8fb428cd21def720cfbfe8d3593ff5bb390548ebc8c32a902649
DIST compiler-rt-5.0.2.src.tar.xz 1543256 BLAKE2B 09fa84b8f3e9b8627a14387bc6eaa3d6b4588b9c8f1ac5a0114135fd830e3d45922408b237866789eb81bf38defde1186e0f7430a69f825bee12776b7cd9f74e SHA512 605a6d064877a860d6c9097e0220896dfceafed0a2392ad495c97aa347b97899d89f7e21932e29d3274f396615837414a3e730a915fe4f53eaa858ce3642a666
DIST compiler-rt-6.0.1.src.tar.xz 1686820 BLAKE2B 59fa3f6e478bd4d6dfa056c85dcdc4349cbce7cea7fc56519feddc9d66c88c9ca48bad7967432ceb81d754213577f12707035afd827cf630a58627575b73b798 SHA512 69850c1ad92c66977fa217cbfb42a6a3f502fbe3d1a08daa7fc4cfeb617a7736d231f8ad8d93b10b1ae29bd753315d2a2d70f9ff1f4d18a9a7cc81758d91f963
@@ -12,10 +11,11 @@ DIST llvm-4.0.1.src.tar.xz 21065652 BLAKE2B 6327eed2d1feb108440f22d2581d1ff86c10
DIST llvm-5.0.2.src.tar.xz 23451868 BLAKE2B b7082be2e4ad557b29b9f6869811f262adcf5c73d552faf91b339bede75cf5eab58afefa12fa779a38be71fe2b8f4ea297c3213ee4e8370cc01972c59249d91c SHA512 3588be5ed969c3f7f6f16f56a12a6af2814d3d3c960d4a36ffebb0446cc75f19220bccee7fc605f9b01f5d5c188a905a046193cc12dec42dd5922048b5c27fe1
DIST llvm-6.0.1.src.tar.xz 25306628 BLAKE2B 60232d4d22f8096b565cc8d81fea0639f24f14e8fc4f66ade69fa15479181f07f655f26dff3fa24bf105762b495da316c5c9352db234bd0af6b9c3fff6d4d881 SHA512 cbbb00eb99cfeb4aff623ee1a5ba075e7b5a76fc00c5f9f539ff28c108598f5708a0369d5bd92683def5a20c2fe60cab7827b42d628dbfcc79b57e0e91b84dd9
DIST llvm-7.0.1.src.tar.xz 28311056 BLAKE2B 737aa6144a415e41a4ff2c8bd5a727d6f14d7b1810c62cbefa5a25fe642c98cddf8a28e35c7e9783373aa3b96f5c0943229e229ad1b43e56e9ed6db0f27ab128 SHA512 ac43a3cb71a53deb55e3693653847cf20bf6f5d9056f224e6956c96d63bc59ebee9404f088eec9cabe65337b4607a905ef931354b373cf64e0004c6905a6b5df
-EBUILD compiler-rt-sanitizers-4.0.1.ebuild 4778 BLAKE2B 5689080c9783d288206a9a7f4d8cee487ef73a951d95baf7083719c89239b299a7cb71361e060876a7564701c353a857e9a640ff5e8f5054d76c6ede66523b5e SHA512 937fab2e9791bd122005469704e5cbbc8907d0f52cb277d779bd93451178e49c8f369be0dec5bff22338a7ed3920f0e125337e9ede02c957c123f968b69ec442
-EBUILD compiler-rt-sanitizers-5.0.2.ebuild 5095 BLAKE2B 0f3348e8800d24d01231b2460025eb83a3211c44fd2987a0b0d4361372fe4af5695a131886d55029459121e8952e394c526120f12212d20a8a5c995847a04cb0 SHA512 cf13df0bad1be887c621c16f12639e385fff395985007b17a1bf14b00f0dd9dfd609e83287fc890f105d2bd586b3457b1efe3b6f687096a205b1a96f3fd1139e
+EBUILD compiler-rt-sanitizers-4.0.1.ebuild 4942 BLAKE2B 384312216b7ec2d71928b22abbab61da0b6a09eca9c518b10a7be7416e12f53aa7160381eebb3c9ca070f5e432b10f7e248cd3380bd50a278758803c53c7cbfd SHA512 64142c2645ef2402f74ef4ee30ed5776f4629f1d0daa34683d50e3b45ce815682e00cb705a00014af524a25acd93fb41a7075f2402b3e73880823c258b01bb85
+EBUILD compiler-rt-sanitizers-5.0.2.ebuild 5259 BLAKE2B d9fd342c98e1c7a9d124cd3149a4325625c8ab604cc9d3cbb01513b6ae2add2adbf246c616219f2fc0691d90aa26f5371e7cda8a18aec95243bd1d6ba7b25379 SHA512 8f82649dded359a5c6132b0b9cf211faefb3840850d71f43332cb8f1c250c830848aee7c5e7b1be2278f103420683b4e51bf493c563dead5a27781756a0c8015
EBUILD compiler-rt-sanitizers-6.0.1.ebuild 5453 BLAKE2B b643f95efc78b4aaa3ab4f05072397003d6e46793a763f91eb79f60c183d89e7265a53f6f96401dc87546bba5b8d21dd38dd0b8bceecdb652702685288465916 SHA512 c9b1dee74f1cbe7d6822589372389c2e3e6f3398211e26d83072dab290541797fa08c52c4c6ac581a59dac52fe5893a27812e5e46e175b9146f2c8348f170458
EBUILD compiler-rt-sanitizers-7.0.1.ebuild 5410 BLAKE2B b93a8907f25f9a6864556787b0e0b86b2fad39c19136e93baa9d73df5b5001f9539c27b5227eb5ae40fd7c34ca343ed45de1c2cd71f1f9753953bff04ced8c5c SHA512 b70f6f3ad6764d9d6244ec51a07a1948864db899213d68947c904161312b4ea450c7eba8f2c1aa3f9b0ab25bb7a1ac3d5650551c37f48abf0bfafc232cc3a7ad
EBUILD compiler-rt-sanitizers-7.0.9999.ebuild 5335 BLAKE2B 2c1851ad178efe08bf96f342e1d2b02c269b395fd29a20532e54538060b09b6c9f7dda7a98f02bb50d309b57a69aff29ff06a5051a0aa28b24b40bba80cbf866 SHA512 7f3d61dfc5ac2087d6069d02cdd485367d0c8ec5b5e51384d1b1c6af4668548e5091ec05861569d4bbeb7bee149a5feb8621c8ba6370de5d250c59d37b8b81e5
-EBUILD compiler-rt-sanitizers-9999.ebuild 5302 BLAKE2B 6f0a715beb0734deb7b2d9795eb66632eae12c4cb7df768dcaa4fa2cb18e7adca30a865f93d2c61b160e28168f103075c9ed171d0124c92b780681138d4e1fc7 SHA512 56b252d8298dacb82274c652049df08299a8811d4991549f24a178e600f2580b1a7fb8a8600d65f667853464bb248b2f5b014e8ef12f8e456fb29350f68d0855
+EBUILD compiler-rt-sanitizers-8.0.9999.ebuild 5118 BLAKE2B 9849fb97a4f8bf53f8650254fd51948e1e9247a988403246435548c99e6fec1796103b6dabb806973551608c8eab58e5ecba857587454cfd2816b79deeaed162 SHA512 485195703afba4a48ad3fec38542c65ecadbd29d79719be2c287e1de2cedf840d4c8ab67ddc0bde3e8954ecbfb1c35facad32faad222df77ed65e468a02863f5
+EBUILD compiler-rt-sanitizers-9999.ebuild 5093 BLAKE2B 8975ce0628079b44988b4cce3f33c1536fe8c88b8b76b6358b1a3de4056b693caa0b508e9ea0afbfaa57501abb6d5820cfd54ab8d1d11dd8b77f96452fcf50f8 SHA512 b6af187292c659305e04c4bb744a6735e9c5b6a3e9fd1eba5d0ed01a07751a18675bc5ec90e0eaf26af510342aa38a1e0bfb7724ee08bff97a1038f93824217f
MISC metadata.xml 547 BLAKE2B 6f9d8b65c12797fd3d168e9b3948c604265db135bda5493d9f1d8b1d01fd73a79d07e5241afc3a7fa1672827fac23d3d9dc4d7ae42371a0de892a900c8c28269 SHA512 fb73a96b1ffbc7ff2fecfba35c9acd3e54ade0154016ae04423217f5c000eee2b0b821cc626908647551a0aa7b7f462d42d56cde3993ddd52248bc373b117c3e
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild
index 00662c398d63..b57164e921d5 100644
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild
@@ -68,6 +68,10 @@ src_prepare() {
eapply "${WORKDIR}/${P}-patchset"
cmake-utils_src_prepare
+ # sys/ustat.h removed in glibc 2.28
+ # https://bugs.gentoo.org/675654
+ eapply "${FILESDIR}"/5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch
+
if use test; then
# remove tests that are broken by new glibc
# (disabled in 6.0.0+, r313069)
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild
index d8168a231aa7..2862cd5c8719 100644
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild
@@ -72,6 +72,10 @@ src_unpack() {
src_prepare() {
cmake-utils_src_prepare
+ # sys/ustat.h removed in glibc 2.28
+ # https://bugs.gentoo.org/675654
+ eapply "${FILESDIR}"/5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch
+
if use test; then
# remove tests that are broken by new glibc
# (disabled in 6.0.0+, r313069)
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-8.0.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-8.0.9999.ebuild
new file mode 100644
index 000000000000..e2589f02ba5d
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-8.0.9999.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit check-reqs cmake-utils flag-o-matic git-r3 llvm \
+ multiprocessing python-any-r1
+
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/compiler-rt.git
+ https://github.com/llvm-mirror/compiler-rt.git"
+EGIT_BRANCH="release_80"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+# Note: this needs to be updated to match version of clang-9999
+SLOT="8.0.0"
+KEYWORDS=""
+IUSE="+clang +libfuzzer +profile +sanitize test +xray elibc_glibc"
+# FIXME: libfuzzer does not enable all its necessary dependencies
+REQUIRED_USE="libfuzzer? ( || ( sanitize xray ) )"
+RESTRICT="!test? ( test ) !clang? ( test )"
+
+CLANG_SLOT=${SLOT%%.*}
+# llvm-6 for new lit options
+DEPEND="
+ >=sys-devel/llvm-6
+ 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}"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+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_unpack() {
+ if use test; then
+ # needed for patched gtest
+ git-r3_fetch "https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ if use test; then
+ git-r3_checkout https://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm '' utils/unittest
+ fi
+ git-r3_checkout
+}
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ if use test; then
+ # remove tests that are (still) broken by new glibc
+ # https://bugs.llvm.org/show_bug.cgi?id=36065
+ if use elibc_glibc && has_version '>=sys-libs/glibc-2.25'; then
+ rm test/lsan/TestCases/Linux/use_tls_dynamic.cc || die
+ rm test/msan/dtls_test.c || die
+ fi
+ fi
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ strip-unsupported-flags
+ fi
+
+ 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)
+ # built-ins installed by sys-libs/compiler-rt
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF
+ -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer)
+ -DCOMPILER_RT_BUILD_PROFILE=$(usex profile)
+ -DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize)
+ -DCOMPILER_RT_BUILD_XRAY=$(usex xray)
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
+
+ # 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+=(
+ # disable use of SDK for the system itself
+ -DDARWIN_macosx_CACHED_SYSROOT=/
+ )
+ fi
+
+ cmake-utils_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-utils_src_make check-all
+}
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
index 78884e8f13dc..22e6a9b283cb 100644
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -19,7 +19,7 @@ EGIT_REPO_URI="https://git.llvm.org/git/compiler-rt.git
LICENSE="|| ( UoI-NCSA MIT )"
# Note: this needs to be updated to match version of clang-9999
-SLOT="8.0.0"
+SLOT="9.0.0"
KEYWORDS=""
IUSE="+clang +libfuzzer +profile +sanitize test +xray elibc_glibc"
# FIXME: libfuzzer does not enable all its necessary dependencies
@@ -77,10 +77,6 @@ src_unpack() {
src_prepare() {
cmake-utils_src_prepare
- # apply the fixes for new glibc / split tirpc
- eapply "${FILESDIR}/9999/0001-sanitizer_common-Fix-using-libtirpc-on-Linux.patch"
- eapply "${FILESDIR}/9999/0002-test-Support-using-libtirpc-on-Linux.patch"
-
if use test; then
# remove tests that are (still) broken by new glibc
# https://bugs.llvm.org/show_bug.cgi?id=36065
diff --git a/sys-libs/compiler-rt-sanitizers/files/5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch b/sys-libs/compiler-rt-sanitizers/files/5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch
new file mode 100644
index 000000000000..5a9aa2327b8d
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/files/5.0.2/0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch
@@ -0,0 +1,61 @@
+From 2e8240309f5ce36eae8f1f9dfcd8c060c040ca5c Mon Sep 17 00:00:00 2001
+From: Craig Topper <craig.topper@intel.com>
+Date: Thu, 24 May 2018 17:59:47 +0000
+Subject: [PATCH] sanitizer: Use pre-computed size of struct ustat for Linux
+
+<sys/ustat.h> has been removed from glibc 2.28 by:
+
+commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7
+Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Sun Mar 18 11:28:59 2018 +0800
+
+Deprecate ustat syscall interface
+This patch uses pre-computed size of struct ustat for Linux to fix
+
+https://bugs.llvm.org/show_bug.cgi?id=37418
+
+Patch by H.J. Lu.
+
+Differential Revision: https://reviews.llvm.org/D47281
+
+git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@333213 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ .../sanitizer_platform_limits_posix.cc | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+index 83f4fd22f..804abd9e4 100644
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -159,7 +159,6 @@ typedef struct user_fpregs elf_fpregset_t;
+ # include <sys/procfs.h>
+ #endif
+ #include <sys/user.h>
+-#include <sys/ustat.h>
+ #include <linux/cyclades.h>
+ #include <linux/if_eql.h>
+ #include <linux/if_plip.h>
+@@ -252,7 +251,19 @@ namespace __sanitizer {
+ #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
+
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+- unsigned struct_ustat_sz = sizeof(struct ustat);
++ // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which
++ // has been removed from glibc 2.28.
++#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
++ || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \
++ || defined(__x86_64__)
++#define SIZEOF_STRUCT_USTAT 32
++#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \
++ || defined(__powerpc__) || defined(__s390__)
++#define SIZEOF_STRUCT_USTAT 20
++#else
++#error Unknown size of struct ustat
++#endif
++ unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
+ unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
+ unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
+ #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
+--
+2.20.1
+
diff --git a/sys-libs/compiler-rt-sanitizers/files/9999/0001-sanitizer_common-Fix-using-libtirpc-on-Linux.patch b/sys-libs/compiler-rt-sanitizers/files/9999/0001-sanitizer_common-Fix-using-libtirpc-on-Linux.patch
deleted file mode 100644
index f39645669da0..000000000000
--- a/sys-libs/compiler-rt-sanitizers/files/9999/0001-sanitizer_common-Fix-using-libtirpc-on-Linux.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 6d96ca43ca31bb69d07271696c43b4372ca534d9 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Wed, 6 Jun 2018 12:16:38 +0200
-Subject: [PATCH 1/2] [sanitizer_common] Fix using libtirpc on Linux
-
-Fix using libtirpc on Linux by using pkg-config to detect it, and append
-appropriate include directory. The libtirpc headers reference one
-another via '#include <rpc/...>', so attempting to include it via
-'#include <tirpc/...>' just failed and resulted in RPC headers not being
-detected at all.
-
-Additionally, perform the header check without -nodefaultlibs as that
-apparently causes it to fail.
----
- lib/sanitizer_common/CMakeLists.txt | 11 ++++++++++-
- .../sanitizer_platform_limits_posix.cc | 4 +---
- 2 files changed, 11 insertions(+), 4 deletions(-)
-
-diff --git a/lib/sanitizer_common/CMakeLists.txt b/lib/sanitizer_common/CMakeLists.txt
-index ad3aba005..f2a6bab51 100644
---- a/lib/sanitizer_common/CMakeLists.txt
-+++ b/lib/sanitizer_common/CMakeLists.txt
-@@ -191,9 +191,18 @@ include_directories(..)
-
- set(SANITIZER_COMMON_DEFINITIONS)
-
-+include(FindPkgConfig)
-+pkg_check_modules(TIRPC libtirpc)
-+if (TIRPC_FOUND)
-+ include_directories(${TIRPC_INCLUDE_DIRS})
-+ set(CMAKE_REQUIRED_INCLUDES ${TIRPC_INCLUDE_DIRS})
-+endif()
-+
- include(CheckIncludeFile)
-+cmake_push_check_state()
-+string(REPLACE "-nodefaultlibs" "" CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
- append_have_file_definition(rpc/xdr.h HAVE_RPC_XDR_H SANITIZER_COMMON_DEFINITIONS)
--append_have_file_definition(tirpc/rpc/xdr.h HAVE_TIRPC_RPC_XDR_H SANITIZER_COMMON_DEFINITIONS)
-+cmake_pop_check_state()
-
- set(SANITIZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
- append_rtti_flag(OFF SANITIZER_CFLAGS)
-diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-index cd1b73d58..c6de2683d 100644
---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -146,8 +146,6 @@ typedef struct user_fpregs elf_fpregset_t;
- #include <netrom/netrom.h>
- #if HAVE_RPC_XDR_H
- # include <rpc/xdr.h>
--#elif HAVE_TIRPC_RPC_XDR_H
--# include <tirpc/rpc/xdr.h>
- #endif
- #include <scsi/scsi.h>
- #include <sys/mtio.h>
-@@ -1243,7 +1241,7 @@ CHECK_SIZE_AND_OFFSET(group, gr_passwd);
- CHECK_SIZE_AND_OFFSET(group, gr_gid);
- CHECK_SIZE_AND_OFFSET(group, gr_mem);
-
--#if HAVE_RPC_XDR_H || HAVE_TIRPC_RPC_XDR_H
-+#if HAVE_RPC_XDR_H
- CHECK_TYPE_SIZE(XDR);
- CHECK_SIZE_AND_OFFSET(XDR, x_op);
- CHECK_SIZE_AND_OFFSET(XDR, x_ops);
---
-2.19.1
-
diff --git a/sys-libs/compiler-rt-sanitizers/files/9999/0002-test-Support-using-libtirpc-on-Linux.patch b/sys-libs/compiler-rt-sanitizers/files/9999/0002-test-Support-using-libtirpc-on-Linux.patch
deleted file mode 100644
index c851cae0a6b8..000000000000
--- a/sys-libs/compiler-rt-sanitizers/files/9999/0002-test-Support-using-libtirpc-on-Linux.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From a415328c75fe88c5e8e3bd0c01913a25b5705fec Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Wed, 6 Jun 2018 12:45:55 +0200
-Subject: [PATCH 2/2] [test] Support using libtirpc on Linux
-
-Add compiler flags necessary for using libtirpc on Linux (RPC headers
-split out of glibc). The flags are obtained via pkg-config. This fixes
-test failures due to tests being unable to find <rpc/...> includes.
----
- cmake/base-config-ix.cmake | 4 ++++
- lib/sanitizer_common/CMakeLists.txt | 2 --
- test/msan/lit.cfg | 3 ++-
- test/msan/lit.site.cfg.in | 1 +
- test/tsan/lit.cfg | 3 ++-
- test/tsan/lit.site.cfg.in | 1 +
- 6 files changed, 10 insertions(+), 4 deletions(-)
-
-diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
-index b92e29a2e..ec0b1b979 100644
---- a/cmake/base-config-ix.cmake
-+++ b/cmake/base-config-ix.cmake
-@@ -8,6 +8,10 @@ include(CheckCXXSourceCompiles)
-
- check_include_file(unwind.h HAVE_UNWIND_H)
-
-+# used in sanitizer_common and tests
-+include(FindPkgConfig)
-+pkg_check_modules(TIRPC libtirpc)
-+
- # Top level target used to build all compiler-rt libraries.
- add_custom_target(compiler-rt ALL)
- add_custom_target(install-compiler-rt)
-diff --git a/lib/sanitizer_common/CMakeLists.txt b/lib/sanitizer_common/CMakeLists.txt
-index f2a6bab51..a560e7c15 100644
---- a/lib/sanitizer_common/CMakeLists.txt
-+++ b/lib/sanitizer_common/CMakeLists.txt
-@@ -191,8 +191,6 @@ include_directories(..)
-
- set(SANITIZER_COMMON_DEFINITIONS)
-
--include(FindPkgConfig)
--pkg_check_modules(TIRPC libtirpc)
- if (TIRPC_FOUND)
- include_directories(${TIRPC_INCLUDE_DIRS})
- set(CMAKE_REQUIRED_INCLUDES ${TIRPC_INCLUDE_DIRS})
-diff --git a/test/msan/lit.cfg b/test/msan/lit.cfg
-index e08673d5c..e86f6091f 100644
---- a/test/msan/lit.cfg
-+++ b/test/msan/lit.cfg
-@@ -14,7 +14,8 @@ clang_msan_cflags = (["-fsanitize=memory",
- "-fno-omit-frame-pointer",
- "-fno-optimize-sibling-calls"] +
- [config.target_cflags] +
-- config.debug_info_flags)
-+ config.debug_info_flags +
-+ [config.rpc_cflags])
- # Some Msan tests leverage backtrace() which requires libexecinfo on FreeBSD.
- if config.host_os == 'FreeBSD':
- clang_msan_cflags += ["-lexecinfo", "-fPIC"]
-diff --git a/test/msan/lit.site.cfg.in b/test/msan/lit.site.cfg.in
-index f744d71fd..35634d324 100644
---- a/test/msan/lit.site.cfg.in
-+++ b/test/msan/lit.site.cfg.in
-@@ -6,6 +6,7 @@ config.target_cflags = "@MSAN_TEST_TARGET_CFLAGS@"
- config.target_arch = "@MSAN_TEST_TARGET_ARCH@"
- config.use_lld = @MSAN_TEST_USE_LLD@
- config.use_thinlto = @MSAN_TEST_USE_THINLTO@
-+config.rpc_cflags = "@TIRPC_CFLAGS@"
-
- # Load common config for all compiler-rt lit tests.
- lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
-diff --git a/test/tsan/lit.cfg b/test/tsan/lit.cfg
-index 233d273f3..2776775eb 100644
---- a/test/tsan/lit.cfg
-+++ b/test/tsan/lit.cfg
-@@ -49,7 +49,8 @@ clang_tsan_cflags = (["-fsanitize=thread",
- [config.target_cflags] +
- config.debug_info_flags +
- extra_cflags +
-- ["-I%s" % tsan_incdir])
-+ ["-I%s" % tsan_incdir] +
-+ [config.rpc_cflags])
- clang_tsan_cxxflags = config.cxx_mode_flags + clang_tsan_cflags + ["-std=c++11"] + ["-I%s" % tsan_incdir]
- # Add additional flags if we're using instrumented libc++.
- # Instrumented libcxx currently not supported on Darwin.
-diff --git a/test/tsan/lit.site.cfg.in b/test/tsan/lit.site.cfg.in
-index 6dec5f92b..67020f3b9 100644
---- a/test/tsan/lit.site.cfg.in
-+++ b/test/tsan/lit.site.cfg.in
-@@ -6,6 +6,7 @@ config.has_libcxx = @TSAN_HAS_LIBCXX@
- config.apple_platform = "@TSAN_TEST_APPLE_PLATFORM@"
- config.target_cflags = "@TSAN_TEST_TARGET_CFLAGS@"
- config.target_arch = "@TSAN_TEST_TARGET_ARCH@"
-+config.rpc_cflags = "@TIRPC_CFLAGS@"
-
- # Load common config for all compiler-rt lit tests.
- lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
---
-2.19.1
-