aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2018-08-02 21:22:53 -0400
committerAnthony G. Basile <blueness@gentoo.org>2018-08-02 21:22:53 -0400
commit715e8027bf90583084edf76bfa0a6ff5f3ee5d85 (patch)
treebb6e00cb95d80d52073290bbc94fe3f9323f1604 /sys-libs
parentsys-devel/clang: clean up older versions, sync with upstream (diff)
downloadmusl-715e8027bf90583084edf76bfa0a6ff5f3ee5d85.tar.gz
musl-715e8027bf90583084edf76bfa0a6ff5f3ee5d85.tar.bz2
musl-715e8027bf90583084edf76bfa0a6ff5f3ee5d85.zip
sys-libs/compiler-rt-sanitizers: clean up older versions
Package-Manager: Portage-2.3.40, Repoman-2.3.9
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/compiler-rt-sanitizers/Manifest9
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild169
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.1.ebuild180
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild180
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.0.ebuild172
-rw-r--r--sys-libs/compiler-rt-sanitizers/files/compiler-rt-sanitizers-4.0.0-musl-patches.patch344
-rw-r--r--sys-libs/compiler-rt-sanitizers/files/compiler-rt-sanitizers-5.0.0-musl-patches.patch344
-rw-r--r--sys-libs/compiler-rt-sanitizers/files/compiler-rt-sanitizers-6.0.0-musl-patches.patch306
8 files changed, 0 insertions, 1704 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index 4ce4f0d..be9fc14 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -1,12 +1,3 @@
-DIST compiler-rt-4.0.1.src.tar.xz 1434100 BLAKE2B ca6bf78fc07f387b7244a52ef648b06a5685effb46a66b241a9ee847ecafb17d02602f49b0dbe473d47202586874a043a6d75141400062f526d2f808da323e1e SHA512 cfeb625884b273f7c0e6767b81a8d3e5f24e0b96a510d5764d9d47a0e215fc841b4cb9d1843c8fb428cd21def720cfbfe8d3593ff5bb390548ebc8c32a902649
-DIST compiler-rt-5.0.1.src.tar.xz 1498220 BLAKE2B 61503df8a4075c2fe1e42d480753b861321b5de127e340f48d648fc38d81c7967cead17e136beaa5235cc92540f158915fccec77cf39aa7c336d106c9d265222 SHA512 61e23775db78bdeed3003a509b45ae609287db31302fed186f3210d481ecf062d1828571e63482215ab00ff732df8f3fa6c77334dfb677e4b76eb555d476b8c4
-DIST compiler-rt-5.0.2.src.tar.xz 1543256 BLAKE2B 09fa84b8f3e9b8627a14387bc6eaa3d6b4588b9c8f1ac5a0114135fd830e3d45922408b237866789eb81bf38defde1186e0f7430a69f825bee12776b7cd9f74e SHA512 605a6d064877a860d6c9097e0220896dfceafed0a2392ad495c97aa347b97899d89f7e21932e29d3274f396615837414a3e730a915fe4f53eaa858ce3642a666
-DIST compiler-rt-6.0.0.src.tar.xz 1633096 BLAKE2B d5df9b16ad474f687507013fb6eda8c7c3bbe479c85aab6ce428b93bbef2467538c0ba59c54dd9266b978da53c8c312a59e3b7abac843702048900f5cdbc1011 SHA512 717bed116ef43ebb2e18daf6fb737472edf57564947f53fe6368d3bbb080f63e986c0d1b94dbd087be998196ad7be54f4361854f8eb5214600b82449ba02c9c1
DIST compiler-rt-6.0.1.src.tar.xz 1686820 BLAKE2B 59fa3f6e478bd4d6dfa056c85dcdc4349cbce7cea7fc56519feddc9d66c88c9ca48bad7967432ceb81d754213577f12707035afd827cf630a58627575b73b798 SHA512 69850c1ad92c66977fa217cbfb42a6a3f502fbe3d1a08daa7fc4cfeb617a7736d231f8ad8d93b10b1ae29bd753315d2a2d70f9ff1f4d18a9a7cc81758d91f963
-DIST compiler-rt-sanitizers-4.0.1-patchset.tar.xz 2384 BLAKE2B 6f9eee711c83570767f0bb634d0f91c18ee7f2af93a478938b8d5b6ce6f2c2fbaadb7bd5c7ee94a14dc1834359a046187db6bc7005b7c2efa539325dc0701ad9 SHA512 72d7357b4c27bbf8fa8b34803ddea905a9f1054e8fc7bf99a4ead9dc00408989ea2709f04be9cf45a27eeb4b9386c89feeb25b53a84f3cac9739196b89813887
DIST compiler-rt-sanitizers-6.0.1-patchset.tar.xz 8820 BLAKE2B d53ca357e060d058c7f20c51e74684f4c032fdf3ccec4c9f227dc7a5757206f331b9eda25a72c5c66faf4c44b2cc63eb439bd21bdd55d37a93918ab428fd7cd4 SHA512 782a34c56134bd061da30c1f598ddb9e90cb34a4e4ef058fa9634f6da372fd8693ff5e6cf98b59700942273240f83052b89ee2736b22f4e19bc8b519fbec8cad
-DIST llvm-4.0.1.src.tar.xz 21065652 BLAKE2B 6327eed2d1feb108440f22d2581d1ff86c10a10c29793538d8d899c7e2dc83d3f7b147d3fd4bcce2bd2bf57c071b08c624aeafe40a3e7a3914506e7751727e6c SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d
-DIST llvm-5.0.1.src.tar.xz 23428720 BLAKE2B 3db4d33df21018d17eef0042c0d8d82a8412bd5daa99cfb5405a6ec83c5774178fa76b220e8731c2a9a64dabf898aa90fe29c685327bd63a4f078e8e94a9a77e SHA512 bee1d45fca15ce725b1f2b1339b13eb6f750a3a321cfd099075477ec25835a8ca55b5366172c4aad46592dfd8afe372349ecf264f581463d017f9cee2d63c1cb
-DIST llvm-5.0.2.src.tar.xz 23451868 BLAKE2B b7082be2e4ad557b29b9f6869811f262adcf5c73d552faf91b339bede75cf5eab58afefa12fa779a38be71fe2b8f4ea297c3213ee4e8370cc01972c59249d91c SHA512 3588be5ed969c3f7f6f16f56a12a6af2814d3d3c960d4a36ffebb0446cc75f19220bccee7fc605f9b01f5d5c188a905a046193cc12dec42dd5922048b5c27fe1
-DIST llvm-6.0.0.src.tar.xz 25296048 BLAKE2B 7ea90bb63d6f26cfbc1c1ed2f243b0fcd8ad2ceb7963cf768d262cd55e9a0c71a9cfdea0333fb220faacf4540d924d2512532774dcfb52b52490ad74e38c09e0 SHA512 a71fdd5ddc46f01327ad891cfcc198febdbe10769c57f14d8a4fb7d514621ee4080e1a641200d3353c16a16731d390270499ec6cd3dc98fadc570f3eb6b52b8c
DIST llvm-6.0.1.src.tar.xz 25306628 BLAKE2B 60232d4d22f8096b565cc8d81fea0639f24f14e8fc4f66ade69fa15479181f07f655f26dff3fa24bf105762b495da316c5c9352db234bd0af6b9c3fff6d4d881 SHA512 cbbb00eb99cfeb4aff623ee1a5ba075e7b5a76fc00c5f9f539ff28c108598f5708a0369d5bd92683def5a20c2fe60cab7827b42d628dbfcc79b57e0e91b84dd9
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
deleted file mode 100644
index 2cf1883..0000000
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild
+++ /dev/null
@@ -1,169 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# 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 llvm python-any-r1
-
-DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
-HOMEPAGE="https://llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV/_//}/compiler-rt-${PV/_/}.src.tar.xz
- https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.xz
- test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
-
-LICENSE="|| ( UoI-NCSA MIT )"
-SLOT="${PV%_*}"
-KEYWORDS="amd64 x86"
-IUSE="+clang test"
-
-CLANG_SLOT=${SLOT%%.*}
-RDEPEND="!=sys-libs/compiler-rt-sanitizers-${SLOT}*:0"
-# llvm-4 needed for --cmakedir
-DEPEND="
- >=sys-devel/llvm-4
- clang? ( sys-devel/clang )
- test? (
- !<sys-apps/sandbox-2.13
- $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
- =sys-devel/clang-${PV%_*}*:${CLANG_SLOT}
- sys-libs/compiler-rt:${SLOT} )
- ${PYTHON_DEPS}"
-
-S=${WORKDIR}/compiler-rt-${PV/_/}.src
-
-PATCHES=( "${FILESDIR}"/${PN}-4.0.0-musl-patches.patch )
-
-# 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() {
- default
-
- if use test; then
- mv llvm-* llvm || die
- fi
-}
-
-src_prepare() {
- eapply "${WORKDIR}/${P}-patchset"
- cmake-utils_src_prepare
-
- if use test; then
- # remove tests that are broken by new glibc
- # (disabled in 6.0.0+, r313069)
- if use elibc_glibc && has_version '>=sys-libs/glibc-2.24'; then
- rm test/tsan/Linux/user_malloc.cc || die
- fi
- # 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/use_tls_dynamic.cc || die
- rm test/msan/dtls_test.c || die
- rm test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc || 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_SANITIZERS=ON
- -DCOMPILER_RT_BUILD_XRAY=ON
- )
- if use test; then
- if has_version '>=sys-devel/llvm-6'; then
- mycmakeargs+=(
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
- )
- else
- mycmakeargs+=(
- -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
- )
- fi
-
- mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
-
- # 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
-
- 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-5.0.1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.1.ebuild
deleted file mode 100644
index d52ef04..0000000
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.1.ebuild
+++ /dev/null
@@ -1,180 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# 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 llvm python-any-r1
-
-MY_P=compiler-rt-${PV/_/}.src
-LLVM_P=llvm-${PV/_/}.src
-
-DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
-HOMEPAGE="https://llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz
- test? ( https://releases.llvm.org/${PV/_//}/${LLVM_P}.tar.xz )"
-
-LICENSE="|| ( UoI-NCSA MIT )"
-SLOT="${PV%_*}"
-KEYWORDS="amd64 x86"
-IUSE="+clang test elibc_glibc"
-
-CLANG_SLOT=${SLOT%%.*}
-# llvm-4 needed for --cmakedir
-DEPEND="
- >=sys-devel/llvm-4
- clang? ( sys-devel/clang )
- 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}"
-
-S=${WORKDIR}/${MY_P}
-
-PATCHES=( "${FILESDIR}"/${PN}-5.0.0-musl-patches.patch )
-
-# 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() {
- einfo "Unpacking ${MY_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die
-
- if use test; then
- einfo "Unpacking parts of ${LLVM_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${LLVM_P}.tar.xz" \
- "${LLVM_P}"/utils/{lit,unittest} || die
- mv "${LLVM_P}" llvm || die
- fi
-}
-
-src_prepare() {
- cmake-utils_src_prepare
-
- if use test; then
- # remove tests that are broken by new glibc
- # (disabled in 6.0.0+, r313069)
- if use elibc_glibc && has_version '>=sys-libs/glibc-2.24'; then
- rm test/tsan/Linux/user_malloc.cc || die
- fi
- # 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
- rm test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc || 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_SANITIZERS=ON
- -DCOMPILER_RT_BUILD_XRAY=ON
- )
- if use test; then
- if has_version '>=sys-devel/llvm-6'; then
- mycmakeargs+=(
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
- )
- else
- mycmakeargs+=(
- -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
- )
- fi
-
- mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
-
- # 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-5.0.2.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild
deleted file mode 100644
index d52ef04..0000000
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.2.ebuild
+++ /dev/null
@@ -1,180 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# 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 llvm python-any-r1
-
-MY_P=compiler-rt-${PV/_/}.src
-LLVM_P=llvm-${PV/_/}.src
-
-DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
-HOMEPAGE="https://llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz
- test? ( https://releases.llvm.org/${PV/_//}/${LLVM_P}.tar.xz )"
-
-LICENSE="|| ( UoI-NCSA MIT )"
-SLOT="${PV%_*}"
-KEYWORDS="amd64 x86"
-IUSE="+clang test elibc_glibc"
-
-CLANG_SLOT=${SLOT%%.*}
-# llvm-4 needed for --cmakedir
-DEPEND="
- >=sys-devel/llvm-4
- clang? ( sys-devel/clang )
- 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}"
-
-S=${WORKDIR}/${MY_P}
-
-PATCHES=( "${FILESDIR}"/${PN}-5.0.0-musl-patches.patch )
-
-# 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() {
- einfo "Unpacking ${MY_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die
-
- if use test; then
- einfo "Unpacking parts of ${LLVM_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${LLVM_P}.tar.xz" \
- "${LLVM_P}"/utils/{lit,unittest} || die
- mv "${LLVM_P}" llvm || die
- fi
-}
-
-src_prepare() {
- cmake-utils_src_prepare
-
- if use test; then
- # remove tests that are broken by new glibc
- # (disabled in 6.0.0+, r313069)
- if use elibc_glibc && has_version '>=sys-libs/glibc-2.24'; then
- rm test/tsan/Linux/user_malloc.cc || die
- fi
- # 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
- rm test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc || 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_SANITIZERS=ON
- -DCOMPILER_RT_BUILD_XRAY=ON
- )
- if use test; then
- if has_version '>=sys-devel/llvm-6'; then
- mycmakeargs+=(
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
- )
- else
- mycmakeargs+=(
- -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
- )
- fi
-
- mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
-
- # 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-6.0.0.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.0.ebuild
deleted file mode 100644
index 7537996..0000000
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.0.ebuild
+++ /dev/null
@@ -1,172 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# 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 llvm \
- multiprocessing python-any-r1
-
-MY_P=compiler-rt-${PV/_/}.src
-LLVM_P=llvm-${PV/_/}.src
-
-DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
-HOMEPAGE="https://llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz
- test? ( https://releases.llvm.org/${PV/_//}/${LLVM_P}.tar.xz )"
-
-LICENSE="|| ( UoI-NCSA MIT )"
-SLOT="${PV%_*}"
-KEYWORDS="~amd64 ~x86"
-IUSE="+clang test elibc_glibc"
-RESTRICT="!test? ( test ) !clang? ( test )"
-
-CLANG_SLOT=${SLOT%%.*}
-# llvm-6 for new lit options
-DEPEND="
- >=sys-devel/llvm-6
- clang? ( sys-devel/clang )
- 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}"
-
-S=${WORKDIR}/${MY_P}
-
-PATCHES=( "${FILESDIR}"/${PN}-6.0.0-musl-patches.patch )
-
-# 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() {
- einfo "Unpacking ${MY_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die
-
- if use test; then
- einfo "Unpacking parts of ${LLVM_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${LLVM_P}.tar.xz" \
- "${LLVM_P}"/utils/{lit,unittest} || die
- mv "${LLVM_P}" llvm || die
- fi
-}
-
-src_prepare() {
- cmake-utils_src_prepare
-
- if use test; then
- # remove tests that are 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
- rm test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc || 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=ON
- -DCOMPILER_RT_BUILD_PROFILE=ON
- -DCOMPILER_RT_BUILD_SANITIZERS=ON
- -DCOMPILER_RT_BUILD_XRAY=ON
- )
- 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/files/compiler-rt-sanitizers-4.0.0-musl-patches.patch b/sys-libs/compiler-rt-sanitizers/files/compiler-rt-sanitizers-4.0.0-musl-patches.patch
deleted file mode 100644
index 7e543f6..0000000
--- a/sys-libs/compiler-rt-sanitizers/files/compiler-rt-sanitizers-4.0.0-musl-patches.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-From 50aa0d694e2fa53b8671e093c42147458ed4e692 Mon Sep 17 00:00:00 2001
-From: Matthias Maier <tamiko@43-1.org>
-Date: Fri, 5 May 2017 17:47:39 +0000
-Subject: [PATCH] Musl patches
-
-Ported to compiler-rt-sanitizers-4.0.0. Taken from
-
- https://gist.githubusercontent.com/pwaller/2337f3290f12634cad3e3730cff0a6c1/raw/83c87a8585e2f9662494db5662e5361beb093c26/nongnu.patch
----
- lib/asan/asan_linux.cc | 4 +--
- lib/interception/interception_linux.cc | 2 +-
- lib/msan/msan_linux.cc | 2 +-
- .../sanitizer_common_interceptors_ioctl.inc | 4 +--
- lib/sanitizer_common/sanitizer_common_syscalls.inc | 2 +-
- lib/sanitizer_common/sanitizer_linux_libcdep.cc | 12 +++----
- lib/sanitizer_common/sanitizer_platform.h | 7 ++++
- .../sanitizer_platform_interceptors.h | 2 +-
- .../sanitizer_platform_limits_posix.cc | 37 ++++++++++++----------
- lib/tsan/rtl/tsan_platform_linux.cc | 2 +-
- 10 files changed, 43 insertions(+), 31 deletions(-)
-
-diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc
-index c051573..e295f60 100644
---- a/lib/asan/asan_linux.cc
-+++ b/lib/asan/asan_linux.cc
-@@ -39,7 +39,7 @@
- #include <sys/link_elf.h>
- #endif
-
--#if SANITIZER_ANDROID || SANITIZER_FREEBSD
-+#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_NONGNU
- #include <ucontext.h>
- extern "C" void* _DYNAMIC;
- #else
-@@ -80,7 +80,7 @@ void AsanApplyToGlobals(globals_op_fptr op, const void *needle) {
- UNIMPLEMENTED();
- }
-
--#if SANITIZER_ANDROID
-+#if SANITIZER_ANDROID || SANITIZER_NONGNU
- // FIXME: should we do anything for Android?
- void AsanCheckDynamicRTPrereqs() {}
- void AsanCheckIncompatibleRT() {}
-diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc
-index 6e908ac..76c1688 100644
---- a/lib/interception/interception_linux.cc
-+++ b/lib/interception/interception_linux.cc
-@@ -24,7 +24,7 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
- return real == wrapper;
- }
-
--#if !defined(__ANDROID__) // android does not have dlvsym
-+#if !defined(__ANDROID__) && defined(__GLIBC__) // android does not have dlvsym
- void *GetFuncAddrVer(const char *func_name, const char *ver) {
- return dlvsym(RTLD_NEXT, func_name, ver);
- }
-diff --git a/lib/msan/msan_linux.cc b/lib/msan/msan_linux.cc
-index 0a687f6..0852d97 100644
---- a/lib/msan/msan_linux.cc
-+++ b/lib/msan/msan_linux.cc
-@@ -13,7 +13,7 @@
- //===----------------------------------------------------------------------===//
-
- #include "sanitizer_common/sanitizer_platform.h"
--#if SANITIZER_FREEBSD || SANITIZER_LINUX
-+#if SANITIZER_FREEBSD || SANITIZER_LINUX && !SANITIZER_NONGNU
-
- #include "msan.h"
- #include "msan_thread.h"
-diff --git a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-index 4ed9afe..64f584e 100644
---- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-+++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-@@ -100,7 +100,7 @@ static void ioctl_table_fill() {
- _(SIOCGETVIFCNT, WRITE, struct_sioc_vif_req_sz);
- #endif
-
--#if SANITIZER_LINUX
-+#if SANITIZER_LINUX && !SANITIZER_NONGNU
- // Conflicting request ids.
- // _(CDROMAUDIOBUFSIZ, NONE, 0);
- // _(SNDCTL_TMR_CONTINUE, NONE, 0);
-@@ -361,7 +361,7 @@ static void ioctl_table_fill() {
- _(VT_WAITACTIVE, NONE, 0);
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
- _(CYGETDEFTHRESH, WRITE, sizeof(int));
- _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
-diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc
-index 469c8eb..24f8786 100644
---- a/lib/sanitizer_common/sanitizer_common_syscalls.inc
-+++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc
-@@ -2038,7 +2038,7 @@ POST_SYSCALL(setrlimit)(long res, long resource, void *rlim) {
- }
- }
-
--#if !SANITIZER_ANDROID
-+#if !SANITIZER_ANDROID && !SANITIZER_NONGNU
- PRE_SYSCALL(prlimit64)(long pid, long resource, const void *new_rlim,
- void *old_rlim) {
- if (new_rlim) PRE_READ(new_rlim, struct_rlimit64_sz);
-diff --git a/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
-index f99f0b5..3a773a9 100644
---- a/lib/sanitizer_common/sanitizer_linux_libcdep.cc
-+++ b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
-@@ -152,7 +152,7 @@ bool SanitizerGetThreadName(char *name, int max_len) {
- #endif
- }
-
--#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO
-+#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && !SANITIZER_NONGNU
- static uptr g_tls_size;
-
- #ifdef __i386__
-@@ -180,11 +180,11 @@ void InitTlsSize() {
- }
- #else
- void InitTlsSize() { }
--#endif // !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO
-+#endif // !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && !SANITIZER_NONGNU
-
- #if (defined(__x86_64__) || defined(__i386__) || defined(__mips__) \
- || defined(__aarch64__) || defined(__powerpc64__) || defined(__s390__)) \
-- && SANITIZER_LINUX && !SANITIZER_ANDROID
-+ && SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- // sizeof(struct pthread) from glibc.
- static atomic_uintptr_t kThreadDescriptorSize;
-
-@@ -338,7 +338,7 @@ uptr ThreadSelf() {
-
- #if !SANITIZER_GO
- static void GetTls(uptr *addr, uptr *size) {
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- # if defined(__x86_64__) || defined(__i386__) || defined(__s390__)
- *addr = ThreadSelf();
- *size = GetTlsSize();
-@@ -364,7 +364,7 @@ static void GetTls(uptr *addr, uptr *size) {
- *addr = (uptr) dtv[2];
- *size = (*addr == 0) ? 0 : ((uptr) segbase[0] - (uptr) dtv[2]);
- }
--#elif SANITIZER_ANDROID
-+#elif SANITIZER_ANDROID || SANITIZER_NONGNU
- *addr = 0;
- *size = 0;
- #else
-@@ -375,7 +375,7 @@ static void GetTls(uptr *addr, uptr *size) {
-
- #if !SANITIZER_GO
- uptr GetTlsSize() {
--#if SANITIZER_FREEBSD || SANITIZER_ANDROID
-+#if SANITIZER_FREEBSD || SANITIZER_ANDROID || SANITIZER_NONGNU
- uptr addr, size;
- GetTls(&addr, &size);
- return size;
-diff --git a/lib/sanitizer_common/sanitizer_platform.h b/lib/sanitizer_common/sanitizer_platform.h
-index d9a8e8d..fe01c57 100644
---- a/lib/sanitizer_common/sanitizer_platform.h
-+++ b/lib/sanitizer_common/sanitizer_platform.h
-@@ -162,6 +162,13 @@
- # define SANITIZER_PPC64V2 0
- #endif
-
-+
-+#if defined(__linux__) && !defined(__GLIBC__)
-+# define SANITIZER_NONGNU 1
-+#else
-+# define SANITIZER_NONGNU 0
-+#endif
-+
- // By default we allow to use SizeClassAllocator64 on 64-bit platform.
- // But in some cases (e.g. AArch64's 39-bit address space) SizeClassAllocator64
- // does not work well and we need to fallback to SizeClassAllocator32.
-diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h
-index 62875d1..212e6e8 100644
---- a/lib/sanitizer_common/sanitizer_platform_interceptors.h
-+++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h
-@@ -23,7 +23,7 @@
- # define SI_NOT_WINDOWS 0
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- # define SI_LINUX_NOT_ANDROID 1
- #else
- # define SI_LINUX_NOT_ANDROID 0
-diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-index 683f019..245f856 100644
---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -139,12 +139,14 @@ typedef struct user_fpregs elf_fpregset_t;
-
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
- #include <glob.h>
--#include <obstack.h>
-+# if !SANITIZER_NONGNU
-+# include <obstack.h>
-+# endif
- #include <mqueue.h>
--#include <net/if_ppp.h>
--#include <netax25/ax25.h>
--#include <netipx/ipx.h>
--#include <netrom/netrom.h>
-+#include <linux/if_ppp.h>
-+#include <linux/ax25.h>
-+#include <linux/ipx.h>
-+#include <linux/netrom.h>
- #if HAVE_RPC_XDR_H
- # include <rpc/xdr.h>
- #elif HAVE_TIRPC_RPC_XDR_H
-@@ -160,7 +162,8 @@ typedef struct user_fpregs elf_fpregset_t;
- # include <sys/procfs.h>
- #endif
- #include <sys/user.h>
--#include <sys/ustat.h>
-+// #include <sys/ustat.h>
-+#include <sys/statfs.h>
- #include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
-@@ -252,7 +255,7 @@ namespace __sanitizer {
- unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- unsigned struct_ustat_sz = sizeof(struct ustat);
- unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
- unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
-@@ -310,7 +313,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr));
- unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- #endif
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- int glob_nomatch = GLOB_NOMATCH;
- int glob_altdirfunc = GLOB_ALTDIRFUNC;
- #endif
-@@ -404,7 +407,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- unsigned struct_termios_sz = sizeof(struct termios);
- unsigned struct_winsize_sz = sizeof(struct winsize);
-
--#if SANITIZER_LINUX
-+#if SANITIZER_LINUX && !SANITIZER_NONGNU
- unsigned struct_arpreq_sz = sizeof(struct arpreq);
- unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf);
- unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession);
-@@ -454,7 +457,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
- #if EV_VERSION > (0x010000)
-@@ -822,7 +825,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- unsigned IOCTL_VT_WAITACTIVE = VT_WAITACTIVE;
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
- unsigned IOCTL_CYGETMON = CYGETMON;
-@@ -985,7 +988,7 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr);
- CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum);
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- CHECK_TYPE_SIZE(glob_t);
- CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc);
- CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv);
-@@ -1019,6 +1022,7 @@ CHECK_TYPE_SIZE(iovec);
- CHECK_SIZE_AND_OFFSET(iovec, iov_base);
- CHECK_SIZE_AND_OFFSET(iovec, iov_len);
-
-+#if !SANITIZER_NONGNU
- CHECK_TYPE_SIZE(msghdr);
- CHECK_SIZE_AND_OFFSET(msghdr, msg_name);
- CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen);
-@@ -1032,6 +1036,7 @@ CHECK_TYPE_SIZE(cmsghdr);
- CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len);
- CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
- CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
-+#endif
-
- COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent));
- CHECK_SIZE_AND_OFFSET(dirent, d_ino);
-@@ -1134,7 +1139,7 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno);
-
- CHECK_TYPE_SIZE(ether_addr);
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- CHECK_TYPE_SIZE(ipc_perm);
- # if SANITIZER_FREEBSD
- CHECK_SIZE_AND_OFFSET(ipc_perm, key);
-@@ -1195,7 +1200,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
- CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data);
- #endif
-
--#if SANITIZER_LINUX
-+#if SANITIZER_LINUX && !SANITIZER_NONGNU
- COMPILER_CHECK(sizeof(__sanitizer_mallinfo) == sizeof(struct mallinfo));
- #endif
-
-@@ -1245,7 +1250,7 @@ COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE);
- COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE);
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- COMPILER_CHECK(sizeof(__sanitizer_FILE) <= sizeof(FILE));
- CHECK_SIZE_AND_OFFSET(FILE, _flags);
- CHECK_SIZE_AND_OFFSET(FILE, _IO_read_ptr);
-@@ -1264,7 +1269,7 @@ CHECK_SIZE_AND_OFFSET(FILE, _chain);
- CHECK_SIZE_AND_OFFSET(FILE, _fileno);
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- COMPILER_CHECK(sizeof(__sanitizer__obstack_chunk) <= sizeof(_obstack_chunk));
- CHECK_SIZE_AND_OFFSET(_obstack_chunk, limit);
- CHECK_SIZE_AND_OFFSET(_obstack_chunk, prev);
-diff --git a/lib/tsan/rtl/tsan_platform_linux.cc b/lib/tsan/rtl/tsan_platform_linux.cc
-index 3313288..103c7b6 100644
---- a/lib/tsan/rtl/tsan_platform_linux.cc
-+++ b/lib/tsan/rtl/tsan_platform_linux.cc
-@@ -287,7 +287,7 @@ void InitializePlatform() {
- // This is required to properly "close" the fds, because we do not see internal
- // closes within glibc. The code is a pure hack.
- int ExtractResolvFDs(void *state, int *fds, int nfd) {
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- int cnt = 0;
- __res_state *statp = (__res_state*)state;
- for (int i = 0; i < MAXNS && cnt < nfd; i++) {
---
-2.12.2
diff --git a/sys-libs/compiler-rt-sanitizers/files/compiler-rt-sanitizers-5.0.0-musl-patches.patch b/sys-libs/compiler-rt-sanitizers/files/compiler-rt-sanitizers-5.0.0-musl-patches.patch
deleted file mode 100644
index a3ecec8..0000000
--- a/sys-libs/compiler-rt-sanitizers/files/compiler-rt-sanitizers-5.0.0-musl-patches.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-From c7108b15fcb3a4b9e12009b07b1db7fbcf19ad07 Mon Sep 17 00:00:00 2001
-From: "Jory A. Pratt" <anarchy@gentoo.org>
-Date: Sat, 9 Sep 2017 08:31:15 -0500
-Subject: [PATCH] Ported to compiler-rt-sanitizers-5.0.0. Taken from
-
-https://gist.githubusercontent.com/pwaller/2337f3290f12634cad3e3730cff0a6c1/raw/83c87a8585e2f9662494db5662e5361beb093c26/nongnu.patch
-Signed-off-by: Jory A. Pratt <anarchy@gentoo.org>
----
- lib/asan/asan_linux.cc | 4 +--
- lib/interception/interception_linux.cc | 2 +-
- lib/msan/msan_linux.cc | 2 +-
- .../sanitizer_common_interceptors_ioctl.inc | 4 +--
- lib/sanitizer_common/sanitizer_common_syscalls.inc | 2 +-
- lib/sanitizer_common/sanitizer_linux_libcdep.cc | 12 +++----
- lib/sanitizer_common/sanitizer_platform.h | 7 ++++
- .../sanitizer_platform_interceptors.h | 2 +-
- .../sanitizer_platform_limits_posix.cc | 37 ++++++++++++----------
- lib/tsan/rtl/tsan_platform_linux.cc | 2 +-
- 10 files changed, 43 insertions(+), 31 deletions(-)
-
-diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc
-index 6d47ba4..c58dd48 100644
---- a/lib/asan/asan_linux.cc
-+++ b/lib/asan/asan_linux.cc
-@@ -39,7 +39,7 @@
- #include <sys/link_elf.h>
- #endif
-
--#if SANITIZER_ANDROID || SANITIZER_FREEBSD
-+#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_NONGNU
- #include <ucontext.h>
- extern "C" void* _DYNAMIC;
- #else
-@@ -86,7 +86,7 @@ void AsanApplyToGlobals(globals_op_fptr op, const void *needle) {
- UNIMPLEMENTED();
- }
-
--#if SANITIZER_ANDROID
-+#if SANITIZER_ANDROID || SANITIZER_NONGNU
- // FIXME: should we do anything for Android?
- void AsanCheckDynamicRTPrereqs() {}
- void AsanCheckIncompatibleRT() {}
-diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc
-index 6e908ac..76c1688 100644
---- a/lib/interception/interception_linux.cc
-+++ b/lib/interception/interception_linux.cc
-@@ -24,7 +24,7 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
- return real == wrapper;
- }
-
--#if !defined(__ANDROID__) // android does not have dlvsym
-+#if !defined(__ANDROID__) && defined(__GLIBC__) // android does not have dlvsym
- void *GetFuncAddrVer(const char *func_name, const char *ver) {
- return dlvsym(RTLD_NEXT, func_name, ver);
- }
-diff --git a/lib/msan/msan_linux.cc b/lib/msan/msan_linux.cc
-index 0a687f6..0852d97 100644
---- a/lib/msan/msan_linux.cc
-+++ b/lib/msan/msan_linux.cc
-@@ -13,7 +13,7 @@
- //===----------------------------------------------------------------------===//
-
- #include "sanitizer_common/sanitizer_platform.h"
--#if SANITIZER_FREEBSD || SANITIZER_LINUX
-+#if SANITIZER_FREEBSD || SANITIZER_LINUX && !SANITIZER_NONGNU
-
- #include "msan.h"
- #include "msan_thread.h"
-diff --git a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-index 4ed9afe..64f584e 100644
---- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-+++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-@@ -100,7 +100,7 @@ static void ioctl_table_fill() {
- _(SIOCGETVIFCNT, WRITE, struct_sioc_vif_req_sz);
- #endif
-
--#if SANITIZER_LINUX
-+#if SANITIZER_LINUX && !SANITIZER_NONGNU
- // Conflicting request ids.
- // _(CDROMAUDIOBUFSIZ, NONE, 0);
- // _(SNDCTL_TMR_CONTINUE, NONE, 0);
-@@ -361,7 +361,7 @@ static void ioctl_table_fill() {
- _(VT_WAITACTIVE, NONE, 0);
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
- _(CYGETDEFTHRESH, WRITE, sizeof(int));
- _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
-diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc
-index 469c8eb..24f8786 100644
---- a/lib/sanitizer_common/sanitizer_common_syscalls.inc
-+++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc
-@@ -2038,7 +2038,7 @@ POST_SYSCALL(setrlimit)(long res, long resource, void *rlim) {
- }
- }
-
--#if !SANITIZER_ANDROID
-+#if !SANITIZER_ANDROID && !SANITIZER_NONGNU
- PRE_SYSCALL(prlimit64)(long pid, long resource, const void *new_rlim,
- void *old_rlim) {
- if (new_rlim) PRE_READ(new_rlim, struct_rlimit64_sz);
-diff --git a/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
-index 52196db..045d933 100644
---- a/lib/sanitizer_common/sanitizer_linux_libcdep.cc
-+++ b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
-@@ -148,7 +148,7 @@ bool SanitizerGetThreadName(char *name, int max_len) {
- #endif
- }
-
--#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO
-+#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && !SANITIZER_NONGNU
- static uptr g_tls_size;
-
- #ifdef __i386__
-@@ -176,11 +176,11 @@ void InitTlsSize() {
- }
- #else
- void InitTlsSize() { }
--#endif // !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO
-+#endif // !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && !SANITIZER_NONGNU
-
- #if (defined(__x86_64__) || defined(__i386__) || defined(__mips__) \
- || defined(__aarch64__) || defined(__powerpc64__) || defined(__s390__) \
-- || defined(__arm__)) && SANITIZER_LINUX && !SANITIZER_ANDROID
-+ || defined(__arm__)) && SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- // sizeof(struct pthread) from glibc.
- static atomic_uintptr_t kThreadDescriptorSize;
-
-@@ -335,7 +335,7 @@ uptr ThreadSelf() {
-
- #if !SANITIZER_GO
- static void GetTls(uptr *addr, uptr *size) {
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- # if defined(__x86_64__) || defined(__i386__) || defined(__s390__)
- *addr = ThreadSelf();
- *size = GetTlsSize();
-@@ -362,7 +362,7 @@ static void GetTls(uptr *addr, uptr *size) {
- *addr = (uptr) dtv[2];
- *size = (*addr == 0) ? 0 : ((uptr) segbase[0] - (uptr) dtv[2]);
- }
--#elif SANITIZER_ANDROID
-+#elif SANITIZER_ANDROID || SANITIZER_NONGNU
- *addr = 0;
- *size = 0;
- #else
-@@ -373,7 +373,7 @@ static void GetTls(uptr *addr, uptr *size) {
-
- #if !SANITIZER_GO
- uptr GetTlsSize() {
--#if SANITIZER_FREEBSD || SANITIZER_ANDROID
-+#if SANITIZER_FREEBSD || SANITIZER_ANDROID || SANITIZER_NONGNU
- uptr addr, size;
- GetTls(&addr, &size);
- return size;
-diff --git a/lib/sanitizer_common/sanitizer_platform.h b/lib/sanitizer_common/sanitizer_platform.h
-index 396f7c9..5af6f1e 100644
---- a/lib/sanitizer_common/sanitizer_platform.h
-+++ b/lib/sanitizer_common/sanitizer_platform.h
-@@ -175,6 +175,13 @@
- # define SANITIZER_ARM 0
- #endif
-
-+
-+#if defined(__linux__) && !defined(__GLIBC__)
-+# define SANITIZER_NONGNU 1
-+#else
-+# define SANITIZER_NONGNU 0
-+#endif
-+
- // By default we allow to use SizeClassAllocator64 on 64-bit platform.
- // But in some cases (e.g. AArch64's 39-bit address space) SizeClassAllocator64
- // does not work well and we need to fallback to SizeClassAllocator32.
-diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h
-index 0380cee..0a39abb 100644
---- a/lib/sanitizer_common/sanitizer_platform_interceptors.h
-+++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h
-@@ -31,7 +31,7 @@
- # define SI_POSIX 0
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- # define SI_LINUX_NOT_ANDROID 1
- #else
- # define SI_LINUX_NOT_ANDROID 0
-diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-index 83f4fd2..c75a979 100644
---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -138,12 +138,14 @@ typedef struct user_fpregs elf_fpregset_t;
-
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
- #include <glob.h>
--#include <obstack.h>
-+# if !SANITIZER_NONGNU
-+# include <obstack.h>
-+# endif
- #include <mqueue.h>
--#include <net/if_ppp.h>
--#include <netax25/ax25.h>
--#include <netipx/ipx.h>
--#include <netrom/netrom.h>
-+#include <linux/if_ppp.h>
-+#include <linux/ax25.h>
-+#include <linux/ipx.h>
-+#include <linux/netrom.h>
- #if HAVE_RPC_XDR_H
- # include <rpc/xdr.h>
- #elif HAVE_TIRPC_RPC_XDR_H
-@@ -159,7 +161,8 @@ typedef struct user_fpregs elf_fpregset_t;
- # include <sys/procfs.h>
- #endif
- #include <sys/user.h>
--#include <sys/ustat.h>
-+// #include <sys/ustat.h>
-+#include <sys/statfs.h>
- #include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
-@@ -251,7 +254,7 @@ namespace __sanitizer {
- unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- unsigned struct_ustat_sz = sizeof(struct ustat);
- unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
- unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
-@@ -309,7 +312,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr));
- unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- #endif
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- int glob_nomatch = GLOB_NOMATCH;
- int glob_altdirfunc = GLOB_ALTDIRFUNC;
- #endif
-@@ -403,7 +406,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- unsigned struct_termios_sz = sizeof(struct termios);
- unsigned struct_winsize_sz = sizeof(struct winsize);
-
--#if SANITIZER_LINUX
-+#if SANITIZER_LINUX && !SANITIZER_NONGNU
- unsigned struct_arpreq_sz = sizeof(struct arpreq);
- unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf);
- unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession);
-@@ -453,7 +456,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
- #if EV_VERSION > (0x010000)
-@@ -821,7 +824,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- unsigned IOCTL_VT_WAITACTIVE = VT_WAITACTIVE;
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
- unsigned IOCTL_CYGETMON = CYGETMON;
-@@ -976,7 +979,7 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr);
- CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum);
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- CHECK_TYPE_SIZE(glob_t);
- CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc);
- CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv);
-@@ -1010,6 +1013,7 @@ CHECK_TYPE_SIZE(iovec);
- CHECK_SIZE_AND_OFFSET(iovec, iov_base);
- CHECK_SIZE_AND_OFFSET(iovec, iov_len);
-
-+#if !SANITIZER_NONGNU
- CHECK_TYPE_SIZE(msghdr);
- CHECK_SIZE_AND_OFFSET(msghdr, msg_name);
- CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen);
-@@ -1023,6 +1027,7 @@ CHECK_TYPE_SIZE(cmsghdr);
- CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len);
- CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
- CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
-+#endif
-
- COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent));
- CHECK_SIZE_AND_OFFSET(dirent, d_ino);
-@@ -1125,7 +1130,7 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno);
-
- CHECK_TYPE_SIZE(ether_addr);
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- CHECK_TYPE_SIZE(ipc_perm);
- # if SANITIZER_FREEBSD
- CHECK_SIZE_AND_OFFSET(ipc_perm, key);
-@@ -1186,7 +1191,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
- CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data);
- #endif
-
--#if SANITIZER_LINUX
-+#if SANITIZER_LINUX && !SANITIZER_NONGNU
- COMPILER_CHECK(sizeof(__sanitizer_mallinfo) == sizeof(struct mallinfo));
- #endif
-
-@@ -1236,7 +1241,7 @@ COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE);
- COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE);
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- COMPILER_CHECK(sizeof(__sanitizer_FILE) <= sizeof(FILE));
- CHECK_SIZE_AND_OFFSET(FILE, _flags);
- CHECK_SIZE_AND_OFFSET(FILE, _IO_read_ptr);
-@@ -1255,7 +1260,7 @@ CHECK_SIZE_AND_OFFSET(FILE, _chain);
- CHECK_SIZE_AND_OFFSET(FILE, _fileno);
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- COMPILER_CHECK(sizeof(__sanitizer__obstack_chunk) <= sizeof(_obstack_chunk));
- CHECK_SIZE_AND_OFFSET(_obstack_chunk, limit);
- CHECK_SIZE_AND_OFFSET(_obstack_chunk, prev);
-diff --git a/lib/tsan/rtl/tsan_platform_linux.cc b/lib/tsan/rtl/tsan_platform_linux.cc
-index ead1e57..2c020e3 100644
---- a/lib/tsan/rtl/tsan_platform_linux.cc
-+++ b/lib/tsan/rtl/tsan_platform_linux.cc
-@@ -284,7 +284,7 @@ void InitializePlatform() {
- // This is required to properly "close" the fds, because we do not see internal
- // closes within glibc. The code is a pure hack.
- int ExtractResolvFDs(void *state, int *fds, int nfd) {
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- int cnt = 0;
- struct __res_state *statp = (struct __res_state*)state;
- for (int i = 0; i < MAXNS && cnt < nfd; i++) {
---
-2.14.1
-
diff --git a/sys-libs/compiler-rt-sanitizers/files/compiler-rt-sanitizers-6.0.0-musl-patches.patch b/sys-libs/compiler-rt-sanitizers/files/compiler-rt-sanitizers-6.0.0-musl-patches.patch
deleted file mode 100644
index 034fc4a..0000000
--- a/sys-libs/compiler-rt-sanitizers/files/compiler-rt-sanitizers-6.0.0-musl-patches.patch
+++ /dev/null
@@ -1,306 +0,0 @@
-diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc
-index 625f32d..73cf77a 100644
---- a/lib/asan/asan_linux.cc
-+++ b/lib/asan/asan_linux.cc
-@@ -46,7 +46,7 @@
- #include <link.h>
- #endif
-
--#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS
-+#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS || SANITIZER_NONGNU
- #include <ucontext.h>
- extern "C" void* _DYNAMIC;
- #elif SANITIZER_NETBSD
-@@ -139,7 +139,7 @@ void AsanApplyToGlobals(globals_op_fptr op, const void *needle) {
- UNIMPLEMENTED();
- }
-
--#if SANITIZER_ANDROID
-+#if SANITIZER_ANDROID || SANITIZER_NONGNU
- // FIXME: should we do anything for Android?
- void AsanCheckDynamicRTPrereqs() {}
- void AsanCheckIncompatibleRT() {}
-diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc
-index c991550..918b635 100644
---- a/lib/interception/interception_linux.cc
-+++ b/lib/interception/interception_linux.cc
-@@ -43,7 +43,7 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
- }
-
- // Android and Solaris do not have dlvsym
--#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS
-+#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && defined(__GLIBC__)
- void *GetFuncAddrVer(const char *func_name, const char *ver) {
- return dlvsym(RTLD_NEXT, func_name, ver);
- }
-diff --git a/lib/msan/msan_interceptors.cc b/lib/msan/msan_interceptors.cc
-index a7fe09b..6a04515 100644
---- a/lib/msan/msan_interceptors.cc
-+++ b/lib/msan/msan_interceptors.cc
-@@ -1438,6 +1438,7 @@ static int msan_dl_iterate_phdr_cb(__sanitizer_dl_phdr_info *info, SIZE_T size,
- return cbdata->callback(info, size, cbdata->data);
- }
-
-+/* does not compile with musl
- INTERCEPTOR(void *, shmat, int shmid, const void *shmaddr, int shmflg) {
- ENSURE_MSAN_INITED();
- void *p = REAL(shmat)(shmid, shmaddr, shmflg);
-@@ -1450,6 +1451,7 @@ INTERCEPTOR(void *, shmat, int shmid, const void *shmaddr, int shmflg) {
- }
- return p;
- }
-+*/
-
- INTERCEPTOR(int, dl_iterate_phdr, dl_iterate_phdr_cb callback, void *data) {
- void *ctx;
-@@ -1668,7 +1670,7 @@ void InitializeInterceptors() {
- INTERCEPT_FUNCTION(pthread_join);
- INTERCEPT_FUNCTION(tzset);
- INTERCEPT_FUNCTION(__cxa_atexit);
-- INTERCEPT_FUNCTION(shmat);
-+ // INTERCEPT_FUNCTION(shmat); // does not compile with musl
- INTERCEPT_FUNCTION(fork);
- INTERCEPT_FUNCTION(openpty);
- INTERCEPT_FUNCTION(forkpty);
-diff --git a/lib/msan/msan_linux.cc b/lib/msan/msan_linux.cc
-index 4e6321f..e437fa6 100644
---- a/lib/msan/msan_linux.cc
-+++ b/lib/msan/msan_linux.cc
-@@ -13,7 +13,7 @@
- //===----------------------------------------------------------------------===//
-
- #include "sanitizer_common/sanitizer_platform.h"
--#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
-+#if SANITIZER_FREEBSD || SANITIZER_LINUX && !SANITIZER_NONGNU || SANITIZER_NETBSD
-
- #include "msan.h"
- #include "msan_thread.h"
-diff --git a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-index 24e7548..20259b1 100644
---- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-+++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-@@ -102,7 +102,7 @@ static void ioctl_table_fill() {
- _(SIOCGETVIFCNT, WRITE, struct_sioc_vif_req_sz);
- #endif
-
--#if SANITIZER_LINUX
-+#if SANITIZER_LINUX && !SANITIZER_NONGNU
- // Conflicting request ids.
- // _(CDROMAUDIOBUFSIZ, NONE, 0);
- // _(SNDCTL_TMR_CONTINUE, NONE, 0);
-@@ -363,7 +363,7 @@ static void ioctl_table_fill() {
- _(VT_WAITACTIVE, NONE, 0);
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
- _(CYGETDEFTHRESH, WRITE, sizeof(int));
- _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
-diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc
-index 469c8eb..24f8786 100644
---- a/lib/sanitizer_common/sanitizer_common_syscalls.inc
-+++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc
-@@ -2038,7 +2038,7 @@ POST_SYSCALL(setrlimit)(long res, long resource, void *rlim) {
- }
- }
-
--#if !SANITIZER_ANDROID
-+#if !SANITIZER_ANDROID && !SANITIZER_NONGNU
- PRE_SYSCALL(prlimit64)(long pid, long resource, const void *new_rlim,
- void *old_rlim) {
- if (new_rlim) PRE_READ(new_rlim, struct_rlimit64_sz);
-diff --git a/lib/sanitizer_common/sanitizer_platform.h b/lib/sanitizer_common/sanitizer_platform.h
-index 334903c..5a8d1ea 100644
---- a/lib/sanitizer_common/sanitizer_platform.h
-+++ b/lib/sanitizer_common/sanitizer_platform.h
-@@ -25,6 +25,12 @@
- # define SANITIZER_LINUX 0
- #endif
-
-+#if defined(__linux__) && !defined(__GLIBC__)
-+# define SANITIZER_NONGNU 1
-+#else
-+# define SANITIZER_NONGNU 0
-+#endif
-+
- #if defined(__FreeBSD__)
- # define SANITIZER_FREEBSD 1
- #else
-diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h
-index b99ac44..d90e713 100644
---- a/lib/sanitizer_common/sanitizer_platform_interceptors.h
-+++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h
-@@ -38,7 +38,7 @@
- # include "sanitizer_platform_limits_solaris.h"
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- # define SI_LINUX_NOT_ANDROID 1
- #else
- # define SI_LINUX_NOT_ANDROID 0
-diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-index f12e820..b98c57d 100644
---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -138,12 +138,14 @@ typedef struct user_fpregs elf_fpregset_t;
-
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
- #include <glob.h>
--#include <obstack.h>
-+#if !SANITIZER_NONGNU
-+# include <obstack.h>
-+#endif
- #include <mqueue.h>
--#include <net/if_ppp.h>
--#include <netax25/ax25.h>
--#include <netipx/ipx.h>
--#include <netrom/netrom.h>
-+#include <linux/if_ppp.h>
-+#include <linux/ax25.h>
-+#include <linux/ipx.h>
-+#include <linux/netrom.h>
- #if HAVE_RPC_XDR_H
- # include <rpc/xdr.h>
- #elif HAVE_TIRPC_RPC_XDR_H
-@@ -159,7 +161,7 @@ typedef struct user_fpregs elf_fpregset_t;
- # include <sys/procfs.h>
- #endif
- #include <sys/user.h>
--#include <sys/ustat.h>
-+/* #include <sys/ustat.h> // is in glibc, but not in musl */
- #include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
-@@ -252,7 +254,7 @@ namespace __sanitizer {
- unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- unsigned struct_ustat_sz = sizeof(struct ustat);
- unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
- unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
-@@ -275,9 +277,9 @@ namespace __sanitizer {
- #endif
-
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX && !SANITIZER_NONGNU || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
- unsigned struct_shminfo_sz = sizeof(struct shminfo);
-- unsigned struct_shm_info_sz = sizeof(struct shm_info);
-+ unsigned struct_shm_info_sz = sizeof(nstruct shm_info);
- int shmctl_ipc_stat = (int)IPC_STAT;
- int shmctl_ipc_info = (int)IPC_INFO;
- int shmctl_shm_info = (int)SHM_INFO;
-@@ -311,7 +313,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr));
- unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- #endif
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- int glob_nomatch = GLOB_NOMATCH;
- int glob_altdirfunc = GLOB_ALTDIRFUNC;
- #endif
-@@ -405,7 +407,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- unsigned struct_termios_sz = sizeof(struct termios);
- unsigned struct_winsize_sz = sizeof(struct winsize);
-
--#if SANITIZER_LINUX
-+#if SANITIZER_LINUX && !SANITIZER_NONGNU
- unsigned struct_arpreq_sz = sizeof(struct arpreq);
- unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf);
- unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession);
-@@ -455,7 +457,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
- #if EV_VERSION > (0x010000)
-@@ -823,7 +825,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- unsigned IOCTL_VT_WAITACTIVE = VT_WAITACTIVE;
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
- unsigned IOCTL_CYGETMON = CYGETMON;
-@@ -978,7 +980,7 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr);
- CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum);
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- CHECK_TYPE_SIZE(glob_t);
- CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc);
- CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv);
-@@ -1012,6 +1014,7 @@ CHECK_TYPE_SIZE(iovec);
- CHECK_SIZE_AND_OFFSET(iovec, iov_base);
- CHECK_SIZE_AND_OFFSET(iovec, iov_len);
-
-+#if !SANITIZER_NONGNU
- CHECK_TYPE_SIZE(msghdr);
- CHECK_SIZE_AND_OFFSET(msghdr, msg_name);
- CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen);
-@@ -1025,6 +1028,7 @@ CHECK_TYPE_SIZE(cmsghdr);
- CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len);
- CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
- CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
-+#endif
-
- COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent));
- CHECK_SIZE_AND_OFFSET(dirent, d_ino);
-@@ -1127,7 +1131,7 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno);
-
- CHECK_TYPE_SIZE(ether_addr);
-
--#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
-+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- CHECK_TYPE_SIZE(ipc_perm);
- # if SANITIZER_FREEBSD
- CHECK_SIZE_AND_OFFSET(ipc_perm, key);
-@@ -1188,7 +1192,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
- CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data);
- #endif
-
--#if SANITIZER_LINUX
-+#if SANITIZER_LINUX && !SANITIZER_NONGNU
- COMPILER_CHECK(sizeof(__sanitizer_mallinfo) == sizeof(struct mallinfo));
- #endif
-
-@@ -1238,7 +1242,7 @@ COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE);
- COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE);
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- COMPILER_CHECK(sizeof(__sanitizer_FILE) <= sizeof(FILE));
- CHECK_SIZE_AND_OFFSET(FILE, _flags);
- CHECK_SIZE_AND_OFFSET(FILE, _IO_read_ptr);
-@@ -1257,7 +1261,7 @@ CHECK_SIZE_AND_OFFSET(FILE, _chain);
- CHECK_SIZE_AND_OFFSET(FILE, _fileno);
- #endif
-
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- COMPILER_CHECK(sizeof(__sanitizer__obstack_chunk) <= sizeof(_obstack_chunk));
- CHECK_SIZE_AND_OFFSET(_obstack_chunk, limit);
- CHECK_SIZE_AND_OFFSET(_obstack_chunk, prev);
-diff --git a/lib/tsan/rtl/tsan_platform_linux.cc b/lib/tsan/rtl/tsan_platform_linux.cc
-index e14d5f5..389a3bc 100644
---- a/lib/tsan/rtl/tsan_platform_linux.cc
-+++ b/lib/tsan/rtl/tsan_platform_linux.cc
-@@ -285,7 +285,7 @@ void InitializePlatform() {
- // This is required to properly "close" the fds, because we do not see internal
- // closes within glibc. The code is a pure hack.
- int ExtractResolvFDs(void *state, int *fds, int nfd) {
--#if SANITIZER_LINUX && !SANITIZER_ANDROID
-+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
- int cnt = 0;
- struct __res_state *statp = (struct __res_state*)state;
- for (int i = 0; i < MAXNS && cnt < nfd; i++) {