aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2018-08-02 21:12:45 -0400
committerAnthony G. Basile <blueness@gentoo.org>2018-08-02 21:12:45 -0400
commit2ef8e38366c5f264aee458099f38bb049ae0c62f (patch)
treec74349bd946beb89306842622d6b35cb7406cee1 /sys-devel/clang
parentAdd arm64 keywords globally (diff)
downloadmusl-2ef8e38366c5f264aee458099f38bb049ae0c62f.tar.gz
musl-2ef8e38366c5f264aee458099f38bb049ae0c62f.tar.bz2
musl-2ef8e38366c5f264aee458099f38bb049ae0c62f.zip
sys-devel/clang: clean up older versions, sync with upstream
Package-Manager: Portage-2.3.40, Repoman-2.3.9
Diffstat (limited to 'sys-devel/clang')
-rw-r--r--sys-devel/clang/Manifest16
-rw-r--r--sys-devel/clang/clang-4.0.1.ebuild309
-rw-r--r--sys-devel/clang/clang-5.0.1.ebuild333
-rw-r--r--sys-devel/clang/clang-5.0.2.ebuild333
-rw-r--r--sys-devel/clang/clang-6.0.0-r1.ebuild337
-rw-r--r--sys-devel/clang/clang-6.0.1.ebuild4
-rw-r--r--sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch87
-rw-r--r--sys-devel/clang/files/4.0.1/0002-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch64
-rw-r--r--sys-devel/clang/files/4.0.1/0003-Add-Gentoo-Linux-distro.patch32
-rw-r--r--sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch48
-rw-r--r--sys-devel/clang/files/4.0.1/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch83
-rw-r--r--sys-devel/clang/files/4.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch11
-rw-r--r--sys-devel/clang/files/4.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch23
-rw-r--r--sys-devel/clang/files/4.0.1/hardened/0003-Enable-PIE-by-default.patch26
-rw-r--r--sys-devel/clang/files/4.0.1/hardened/0004-Link-with-z-now-by-default-for-Gentoo.patch14
-rw-r--r--sys-devel/clang/files/5.0.1/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch136
-rw-r--r--sys-devel/clang/files/5.0.1/0002-test-Fix-clang-test-for-FreeBSD-and-NetBSD.patch76
-rw-r--r--sys-devel/clang/files/5.0.1/0003-Add-Gentoo-Linux-distro.patch33
-rw-r--r--sys-devel/clang/files/5.0.1/extra/0001-Assume-the-shared-library-path-variable-is-LD_LIBRAR.patch37
-rw-r--r--sys-devel/clang/files/5.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch11
-rw-r--r--sys-devel/clang/files/5.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch25
-rw-r--r--sys-devel/clang/files/5.0.1/hardened/0003-Enable-PIE-by-default.patch24
-rw-r--r--sys-devel/clang/files/5.0.1/hardened/0004-Enable-FORTIFY_SOURCE-macro-by-default.patch35
-rw-r--r--sys-devel/clang/files/5.0.1/hardened/0005-Link-with-z-now-by-default-for-Gentoo.patch14
-rw-r--r--sys-devel/clang/files/6.0.1/darwin_prefix-include-paths.patch (renamed from sys-devel/clang/files/5.0.1/darwin_prefix-include-paths.patch)0
25 files changed, 2 insertions, 2109 deletions
diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest
index abed5a7..6abbf06 100644
--- a/sys-devel/clang/Manifest
+++ b/sys-devel/clang/Manifest
@@ -1,20 +1,4 @@
-DIST cfe-4.0.1.src.tar.xz 10933628 BLAKE2B bc1bb8875e83ccecd446a48cfa41f5c98a09d6ad24ff439a983f629711b4513b9c4bee4070f8df13b6b2a52d673b0706733a4c151ce5021a0233147debff14ac SHA512 936c9e1626b27e63a4fb11f3c0cb998eeaf9a520ad6e2bcd67cb4352e59e7781ecc700df79794f3fd70473d90b7e2ba418a39038eb0146b68e843f0705c1f964
-DIST cfe-5.0.1.src.tar.xz 11483036 BLAKE2B c4eb54cd8271b62cf7a2219db0b599b68c00b6e574d1946220efbd1633e841796e6717d6eeb35e84a6db32a731a3285b59cedeb3b1a8f3c3c502b799fdd0a720 SHA512 6619177a2ff9934fe8b15d6aa229abb8e34d0b1a75228d9efba9393daf71d6419a7256de57b31e2f9f829f71f842118556f996e86ee076f1e0a7cd394dfd31a2
-DIST cfe-5.0.2.src.tar.xz 11459216 BLAKE2B 80d9b2ab70b00c0dfd5c5386a44e0c15d8252e6175c9da55a0519c4f9b8192e32e215110d7d3808225786e2c7f906f2dfbe11dd09bdf21574e99709ae237ed0b SHA512 9931afceb5569ad6caec85d506180c810f7fea94af8c997143b0a37cbf413fcea0d92520478610627eeee1efb65fde684066ace0dfcbbf7b61ecd709d22dd0b1
-DIST cfe-6.0.0.src.tar.xz 11959224 BLAKE2B 257edbaedf72bd941b67b4aa2f152a96a37bbea72d21d22d4445152685efe40d75b9a7a39955545643e841ad6693ef12e52b207b9119098774f39e858b64bc09 SHA512 e886dd27448503bbfc7fd4f68eb089c19b2f2be4f0e5b26d3df253833f60b91d70b472a6b530063386e2252075b110ce9f5942800feddf6c34b94a75cf7bd5c6
DIST cfe-6.0.1.src.tar.xz 11905772 BLAKE2B abb60e9f9827d1d8a24f0aaf8a1d1e32979293cc401258d230f93290e633645747fd0344af189ac7081b06be2cada503364e1e432b37110ade4b3578e40c7605 SHA512 f64ba9290059f6e36fee41c8f32bf483609d31c291fcd2f77d41fecfdf3c8233a5e23b93a1c73fed03683823bd6e72757ed993dd32527de3d5f2b7a64bb031b9
-DIST clang-tools-extra-4.0.1.src.tar.xz 581788 BLAKE2B 52ca89eda6fe1e0fbbdc46e17f4067f03a9a9440dcdcc98811651087d0c9ab24dfe3eefb0b80a32ec41abe0766cb3e47031de61c4cff02b7d0e08c8fd03e3faa SHA512 ea26d926f428e62e76cf8a073e63ffe05645f6592e05d7717d5c257908870ae9217727d3e1578227b14eda5937085872463f1a8e99970256179c68b8a92e69e0
-DIST clang-tools-extra-5.0.1.src.tar.xz 646328 BLAKE2B 472eb1e73a17564790919ec392dddcd91f131c1cbf2a5f3cab09a9f7126d4d18ec6785ffcb3c3230eec6edc90acbe2bf859367c37f62ba77d7542f4c18b925f3 SHA512 2e6a811cccd22281f7567f5626ff0484ed1fefee4a9244a717e3ccb9516dce9e7ff315044fb10e505e91c3f1c6d2774558debb9559915d053886599bcb153d7b
-DIST clang-tools-extra-5.0.2.src.tar.xz 646272 BLAKE2B 8a15a0c3ed9e8c31706d744017aa8be52616037790075c2314c3a613c9e1aa86b0b980c4e3bd9a775b234440f17436392196b41f1691ab25a33b432a25affb68 SHA512 241d85652e7c3ad5d77754ad9a694bddab3c14098067da4119223007c5a4a765d1cd7e7c7dba91666ccd5506f8703c82c9ee487f28249a00c2c4edbd0d1f2640
-DIST clang-tools-extra-6.0.0.src.tar.xz 757680 BLAKE2B 708e21055a702c41a94f6b8673bab405f8b1339a75ec66f14c31565ef802245900bafc25e636c6e82f01e74060a6429a19442317f948011cae59af6825808343 SHA512 9c5720b8694c235ca988ef45da1d564ac06e31c0a40600b32c0b9df399693e4eba296ca43b077ed97adba085362ddb0fb94e0d28232afc3e7351820b1285061f
DIST clang-tools-extra-6.0.1.src.tar.xz 757256 BLAKE2B 1d91d7459a34e7251007af91db1803ee6d04f1ef3e0fcf134a7e0d1d3456b094a80339ee60db3f0bdd12961f3a05caee7edfc5c6b9c48d49cd55a5dc3c102c3a SHA512 cf29d117b6dabcb7a8e5f6dab5016ce5a5c8f475679001a43fd5c935f2c368f37cdef50aae2080a1e4524f647f6d83458d4a5dec5b45d03fb374f463caf7c3f5
-DIST llvm-4.0.1.src.tar.xz 21065652 BLAKE2B 6327eed2d1feb108440f22d2581d1ff86c10a10c29793538d8d899c7e2dc83d3f7b147d3fd4bcce2bd2bf57c071b08c624aeafe40a3e7a3914506e7751727e6c SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d
-DIST llvm-5.0.1-manpages.tar.bz2 94004 BLAKE2B 34eb29361ad7aa881e64d1dd2992fd89ce44adafd2521284c27b6ffe7082bc7e70458204e6f34d582b704bf7c5dad93c6a6dc41fc7abc41862aab8f5ec53ed07 SHA512 3444cc8e06009f5dd2669b92af662a1049d9294c8ca0dcf45486e1dc1aaf10160860b7856d30ad70bbe5864b21d1539316e89f5237549f5653954e23baf64334
-DIST llvm-5.0.1.src.tar.xz 23428720 BLAKE2B 3db4d33df21018d17eef0042c0d8d82a8412bd5daa99cfb5405a6ec83c5774178fa76b220e8731c2a9a64dabf898aa90fe29c685327bd63a4f078e8e94a9a77e SHA512 bee1d45fca15ce725b1f2b1339b13eb6f750a3a321cfd099075477ec25835a8ca55b5366172c4aad46592dfd8afe372349ecf264f581463d017f9cee2d63c1cb
-DIST llvm-5.0.2-manpages.tar.bz2 93977 BLAKE2B 8c5e8899e0df9d6037fb7d5c373de6492ccdc9fd2c26cc7dfbd8fb2b9e68418ca8fdf42cdc303c361e649cc6939bf5229cbad017bdccbd5d791e92752328252f SHA512 568615bce5a75d42e4b6d592557472d366d49a99f8e81be10ae679804f1fe674c7fd0bbdac09af44fc67ee5aa34c4ed2153c2767c536ac8e45dd15c811c92dcb
-DIST llvm-5.0.2.src.tar.xz 23451868 BLAKE2B b7082be2e4ad557b29b9f6869811f262adcf5c73d552faf91b339bede75cf5eab58afefa12fa779a38be71fe2b8f4ea297c3213ee4e8370cc01972c59249d91c SHA512 3588be5ed969c3f7f6f16f56a12a6af2814d3d3c960d4a36ffebb0446cc75f19220bccee7fc605f9b01f5d5c188a905a046193cc12dec42dd5922048b5c27fe1
-DIST llvm-6.0.0-manpages.tar.bz2 102668 BLAKE2B f458cbfcfdd6600f90f9bbe8cd9681de3dc11c62dbfcaa5ba7a281ad30d6367c33bebd5090c255e85a10b00b7bcb9c988d340b67f1db51982f55956acba109e9 SHA512 a7ed3e246e6488254f19dbb8484c079be39bc52f9b2fab3f736dd013683b7f46e8e036ee571dec5066c86ee7c25713608a2426555e8ad04b81891912314ee48e
-DIST llvm-6.0.0.src.tar.xz 25296048 BLAKE2B 7ea90bb63d6f26cfbc1c1ed2f243b0fcd8ad2ceb7963cf768d262cd55e9a0c71a9cfdea0333fb220faacf4540d924d2512532774dcfb52b52490ad74e38c09e0 SHA512 a71fdd5ddc46f01327ad891cfcc198febdbe10769c57f14d8a4fb7d514621ee4080e1a641200d3353c16a16731d390270499ec6cd3dc98fadc570f3eb6b52b8c
DIST llvm-6.0.1-manpages.tar.bz2 102656 BLAKE2B 9088ca0bdda69f63354e61b7495df54505d5db2504bc61860a7260343722ec8cdd5e937d0843263a5bf5077b9cf386c337fa127039b996bab10d2ca5c2caeb59 SHA512 c468e97a2d5610aee9e72cb795e4e65375a079d733550f05380230fb44ba0ed67d407ad06e2340b66f13d19c06583b657e8d01fcdca2146ae43964cea309e0b3
DIST llvm-6.0.1.src.tar.xz 25306628 BLAKE2B 60232d4d22f8096b565cc8d81fea0639f24f14e8fc4f66ade69fa15479181f07f655f26dff3fa24bf105762b495da316c5c9352db234bd0af6b9c3fff6d4d881 SHA512 cbbb00eb99cfeb4aff623ee1a5ba075e7b5a76fc00c5f9f539ff28c108598f5708a0369d5bd92683def5a20c2fe60cab7827b42d628dbfcc79b57e0e91b84dd9
-DIST llvm-manpages-4.0.1.tar.bz2 87981 BLAKE2B 79ffd254ee5c6e09159c954913ef820f74107d4fcea5e3ed82592dc36af8fdfbf1e850547ba8bfc20aa9a5ecdd26c50329e6a6d558ae3aa5475a930789ce3e01 SHA512 d5b3213567c25db58ef364d272314a79c311a80fc21d98c09a5540af45a8190a38f489228663fe9a9b63bf0f2b952c460c4196a8fc8d6f221619f6e7ed2fc415
diff --git a/sys-devel/clang/clang-4.0.1.ebuild b/sys-devel/clang/clang-4.0.1.ebuild
deleted file mode 100644
index edb31a7..0000000
--- a/sys-devel/clang/clang-4.0.1.ebuild
+++ /dev/null
@@ -1,309 +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 cmake-utils flag-o-matic llvm multilib-minimal \
- python-single-r1 toolchain-funcs pax-utils versionator
-
-DESCRIPTION="C language family frontend for LLVM"
-HOMEPAGE="https://llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV/_//}/cfe-${PV/_/}.src.tar.xz
- https://releases.llvm.org/${PV/_//}/clang-tools-extra-${PV/_/}.src.tar.xz
- !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-manpages-${PV}.tar.bz2 )
- test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
-
-# Keep in sync with sys-devel/llvm
-ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
- NVPTX PowerPC RISCV Sparc SystemZ X86 XCore )
-ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
-LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
-
-LICENSE="UoI-NCSA"
-SLOT="$(get_major_version)"
-KEYWORDS="amd64 ~arm64 x86"
-IUSE="debug default-compiler-rt default-libcxx doc hardened +static-analyzer
- test xml elibc_musl kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
-
-RDEPEND="
- ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
- static-analyzer? ( dev-lang/perl:* )
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- ${PYTHON_DEPS}"
-# configparser-3.2 breaks the build (3.3 or none at all are fine)
-DEPEND="${RDEPEND}
- doc? ( dev-python/sphinx )
- xml? ( virtual/pkgconfig )
- !!<dev-python/configparser-3.3.0.2
- ${PYTHON_DEPS}"
-RDEPEND="${RDEPEND}
- !<sys-devel/llvm-4.0.0_rc:0
- !sys-devel/clang:0"
-PDEPEND="
- ~sys-devel/clang-runtime-${PV}
- default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
- default-libcxx? ( >=sys-libs/libcxx-${PV} )"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}
- || ( ${ALL_LLVM_TARGETS[*]} )"
-
-# We need extra level of indirection for CLANG_RESOURCE_DIR
-S=${WORKDIR}/x/y/cfe-${PV/_/}.src
-
-# least intrusive of all
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-# Multilib notes:
-# 1. ABI_* flags control ABIs libclang* is built for only.
-# 2. clang is always capable of compiling code for all ABIs for enabled
-# target. However, you will need appropriate crt* files (installed
-# e.g. by sys-devel/gcc and sys-libs/glibc).
-# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
-# in the current profile (i.e. alike supported by sys-devel/gcc).
-#
-# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
-# multilib clang* libraries (not runtime, not wrappers).
-
-pkg_setup() {
- LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
- python-single-r1_pkg_setup
-}
-
-src_unpack() {
- # create extra parent dirs for CLANG_RESOURCE_DIR
- mkdir -p x/y || die
- cd x/y || die
-
- default
-
- mv clang-tools-extra-*.src "${S}"/tools/extra || die
- if use test; then
- mv llvm-*.src "${WORKDIR}"/llvm || die
- fi
-}
-
-src_prepare() {
- # fix finding compiler-rt libs
- eapply "${FILESDIR}"/5.0.1/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
-
- # fix stand-alone doc build
- eapply "${FILESDIR}"/4.0.1/0002-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
-
- # fix value of ATOMIC_*_LOCK_FREE
- # (backport, temporary reverted upstream because of FreeBSD issues)
- eapply "${FILESDIR}"/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
-
- # only used in hardened patches at the moment
- eapply "${FILESDIR}"/4.0.1/0003-Add-Gentoo-Linux-distro.patch
-
- cd tools/extra || die
- # fix stand-alone test build for extra tools
- eapply "${FILESDIR}"/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
- eapply "${FILESDIR}"/4.0.1/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
- cd - >/dev/null || die
-
- if use hardened; then
- eapply "${FILESDIR}"/4.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
- eapply "${FILESDIR}"/4.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
- eapply "${FILESDIR}"/4.0.1/hardened/0003-Enable-PIE-by-default.patch
- eapply "${FILESDIR}"/4.0.1/hardened/0004-Link-with-z-now-by-default-for-Gentoo.patch
- fi
-
- # User patches
- cmake-utils_src_prepare
-}
-
-multilib_src_configure() {
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(get_version_component_range 1-3 "${llvm_version}")
-
- local mycmakeargs=(
- # ensure that the correct llvm-config is used
- -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
- # relative to bindir
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
-
- -DBUILD_SHARED_LIBS=ON
- -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
- -DLLVM_BUILD_TESTS=$(usex test)
-
- # these are not propagated reliably, so redefine them
- -DLLVM_ENABLE_EH=ON
- -DLLVM_ENABLE_RTTI=ON
-
- -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
- # libgomp support fails to find headers without explicit -I
- # furthermore, it provides only syntax checking
- -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
-
- # override default stdlib and rtlib
- -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
- -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
-
- -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
- -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
- )
- use test && mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
- )
-
- if multilib_is_native_abi; then
- mycmakeargs+=(
- -DLLVM_BUILD_DOCS=$(usex doc)
- -DLLVM_ENABLE_SPHINX=$(usex doc)
- -DLLVM_ENABLE_DOXYGEN=OFF
-
- # workaround pthread
- -DPTHREAD_LIB=-pthread
- )
- use doc && mycmakeargs+=(
- -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
- -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
- -DSPHINX_WARNINGS_AS_ERRORS=OFF
- )
- else
- mycmakeargs+=(
- -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
- )
- fi
-
- if [[ -n ${EPREFIX} ]]; then
- mycmakeargs+=(
- -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
- )
- fi
-
- if tc-is-cross-compiler; then
- [[ -x "/usr/bin/clang-tblgen" ]] \
- || die "/usr/bin/clang-tblgen not found or usable"
- mycmakeargs+=(
- -DCMAKE_CROSSCOMPILING=ON
- -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
- )
- fi
-
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
- cmake-utils_src_configure
-}
-
-multilib_src_compile() {
- cmake-utils_src_compile
-
- # provide a symlink for tests
- if [[ ! -L ${WORKDIR}/lib/clang ]]; then
- mkdir -p "${WORKDIR}"/lib || die
- ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
- fi
-}
-
-multilib_src_test() {
- # respect TMPDIR!
- local -x LIT_PRESERVES_TMP=1
- cmake-utils_src_make check-clang
- # clang-tidy requires [static-analyzer] and tests are not split
- # correctly, so they are all disabled when static-analyzer is off
- if multilib_is_native_abi && use static-analyzer; then
- cmake-utils_src_make check-clang-tools
- fi
-}
-
-src_install() {
- MULTILIB_WRAPPED_HEADERS=(
- /usr/include/clang/Config/config.h
- )
-
- multilib-minimal_src_install
-
- # Move runtime headers to /usr/lib/clang, where they belong
- mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
- # move (remaining) wrapped headers back
- mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
-
- # Apply CHOST and version suffix to clang tools
- # note: we use two version components here (vs 3 in runtime path)
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(get_version_component_range 1-2 "${llvm_version}")
- local clang_full_version=$(get_version_component_range 1-3 "${llvm_version}")
- local clang_tools=( clang clang++ clang-cl clang-cpp )
- local abi i
-
- # cmake gives us:
- # - clang-X.Y
- # - clang -> clang-X.Y
- # - clang++, clang-cl, clang-cpp -> clang
- # we want to have:
- # - clang-X.Y
- # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
- # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
- # also in CHOST variant
- for i in "${clang_tools[@]:1}"; do
- rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
- dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
- dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
- done
-
- # now create target symlinks for all supported ABIs
- for abi in $(get_all_abis); do
- local abi_chost=$(get_abi_CHOST "${abi}")
- for i in "${clang_tools[@]}"; do
- dosym "${i}-${clang_version}" \
- "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
- dosym "${abi_chost}-${i}-${clang_version}" \
- "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
- done
- done
-
- # Remove unnecessary headers on FreeBSD, bug #417171
- if use kernel_FreeBSD; then
- rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
- fi
-}
-
-multilib_src_install() {
- cmake-utils_src_install
-
- # move headers to /usr/include for wrapping & ABI mismatch checks
- # (also drop the version suffix from runtime headers)
- rm -rf "${ED%/}"/usr/include || die
- mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
- mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
-}
-
-multilib_src_install_all() {
- python_fix_shebang "${ED}"
- if use static-analyzer; then
- python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
- fi
-
- # install pre-generated manpages
- if ! use doc; then
- insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
- doins "${WORKDIR}/x/y/llvm-manpages-${PV}/clang"/*.1
- fi
-
- docompress "/usr/lib/llvm/${SLOT}/share/man"
- # match 'html' non-compression
- use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
- # +x for some reason; TODO: investigate
- use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
-}
-
-pkg_postinst() {
- if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow update all
- fi
-}
-
-pkg_postrm() {
- if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow clean all
- fi
-}
diff --git a/sys-devel/clang/clang-5.0.1.ebuild b/sys-devel/clang/clang-5.0.1.ebuild
deleted file mode 100644
index 326b27e..0000000
--- a/sys-devel/clang/clang-5.0.1.ebuild
+++ /dev/null
@@ -1,333 +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 cmake-utils eapi7-ver flag-o-matic llvm \
- multilib-minimal pax-utils prefix python-single-r1 toolchain-funcs
-
-MY_P=cfe-${PV/_/}.src
-EXTRA_P=clang-tools-extra-${PV/_/}.src
-LLVM_P=llvm-${PV/_/}.src
-
-DESCRIPTION="C language family frontend for LLVM"
-HOMEPAGE="https://llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz
- https://releases.llvm.org/${PV/_//}/${EXTRA_P}.tar.xz
- test? ( https://releases.llvm.org/${PV/_//}/${LLVM_P}.tar.xz )
- !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-${PV}-manpages.tar.bz2 )"
-
-# Keep in sync with sys-devel/llvm
-ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
- NVPTX PowerPC Sparc SystemZ X86 XCore )
-ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
-LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
-
-LICENSE="UoI-NCSA"
-SLOT="$(ver_cut 1)"
-KEYWORDS="amd64 ~arm64 x86 ~amd64-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
-IUSE="debug default-compiler-rt default-libcxx doc hardened +static-analyzer
- test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
-
-RDEPEND="
- ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
- static-analyzer? (
- dev-lang/perl:*
- z3? ( sci-mathematics/z3:0= )
- )
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- ${PYTHON_DEPS}"
-# configparser-3.2 breaks the build (3.3 or none at all are fine)
-DEPEND="${RDEPEND}
- doc? ( dev-python/sphinx )
- xml? ( virtual/pkgconfig )
- !!<dev-python/configparser-3.3.0.2
- ${PYTHON_DEPS}"
-RDEPEND="${RDEPEND}
- !<sys-devel/llvm-4.0.0_rc:0
- !sys-devel/clang:0"
-PDEPEND="
- ~sys-devel/clang-runtime-${PV}
- default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
- default-libcxx? ( >=sys-libs/libcxx-${PV} )"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}
- || ( ${ALL_LLVM_TARGETS[*]} )"
-
-# We need extra level of indirection for CLANG_RESOURCE_DIR
-S=${WORKDIR}/x/y/${MY_P}
-
-# least intrusive of all
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-# Multilib notes:
-# 1. ABI_* flags control ABIs libclang* is built for only.
-# 2. clang is always capable of compiling code for all ABIs for enabled
-# target. However, you will need appropriate crt* files (installed
-# e.g. by sys-devel/gcc and sys-libs/glibc).
-# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
-# in the current profile (i.e. alike supported by sys-devel/gcc).
-#
-# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
-# multilib clang* libraries (not runtime, not wrappers).
-
-pkg_setup() {
- LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
- python-single-r1_pkg_setup
-}
-
-src_unpack() {
- # create extra parent dir for CLANG_RESOURCE_DIR
- mkdir -p x/y || die
- cd x/y || die
-
- einfo "Unpacking ${MY_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die
- einfo "Unpacking ${EXTRA_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${EXTRA_P}.tar.xz" || die
-
- mv "${EXTRA_P}" "${S}"/tools/extra || 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}" "${WORKDIR}"/llvm || die
- fi
-
- if ! use doc; then
- einfo "Unpacking llvm-${PV}-manpages.tar.bz2 ..."
- tar -xf "${DISTDIR}/llvm-${PV}-manpages.tar.bz2" || die
- fi
-}
-
-src_prepare() {
- # fix finding compiler-rt libs
- eapply "${FILESDIR}"/5.0.1/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
- # fix setting LD_LIBRARY_PATH for tests on *BSD
- eapply "${FILESDIR}"/5.0.1/0002-test-Fix-clang-test-for-FreeBSD-and-NetBSD.patch
- # add Prefix include paths for Darwin
- eapply "${FILESDIR}"/5.0.1/darwin_prefix-include-paths.patch
- # only used in hardened patches at the moment
- eapply "${FILESDIR}"/5.0.1/0003-Add-Gentoo-Linux-distro.patch
-
- cd tools/extra || die
- # fix setting LD_LIBRARY_PATH for tests on *BSD (extra part)
- eapply "${FILESDIR}"/5.0.1/extra/0001-Assume-the-shared-library-path-variable-is-LD_LIBRAR.patch
- cd ../.. || die
-
- if use hardened; then
- eapply "${FILESDIR}"/5.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
- eapply "${FILESDIR}"/5.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
- eapply "${FILESDIR}"/5.0.1/hardened/0003-Enable-PIE-by-default.patch
- eapply "${FILESDIR}"/5.0.1/hardened/0004-Enable-FORTIFY_SOURCE-macro-by-default.patch
- eapply "${FILESDIR}"/5.0.1/hardened/0005-Link-with-z-now-by-default-for-Gentoo.patch
- fi
-
- cmake-utils_src_prepare
- eprefixify lib/Frontend/InitHeaderSearch.cpp
-}
-
-multilib_src_configure() {
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-3 "${llvm_version}")
-
- local mycmakeargs=(
- # ensure that the correct llvm-config is used
- -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
- # relative to bindir
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
-
- -DBUILD_SHARED_LIBS=ON
- -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
- -DLLVM_BUILD_TESTS=$(usex test)
-
- # these are not propagated reliably, so redefine them
- -DLLVM_ENABLE_EH=ON
- -DLLVM_ENABLE_RTTI=ON
-
- -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
- # libgomp support fails to find headers without explicit -I
- # furthermore, it provides only syntax checking
- -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
-
- # override default stdlib and rtlib
- -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
- -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
-
- -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
- -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
- # z3 is not multilib-friendly
- -DCLANG_ANALYZER_BUILD_Z3=$(multilib_native_usex z3)
- )
- use test && mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
- )
-
- if multilib_is_native_abi; then
- mycmakeargs+=(
- # normally copied from LLVM_INCLUDE_DOCS but the latter
- # is lacking value in stand-alone builds
- -DCLANG_INCLUDE_DOCS=$(usex doc)
- -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=$(usex doc)
- )
- use doc && mycmakeargs+=(
- -DLLVM_BUILD_DOCS=ON
- -DLLVM_ENABLE_SPHINX=ON
- -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
- -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
- -DSPHINX_WARNINGS_AS_ERRORS=OFF
- )
- use z3 && mycmakeargs+=(
- -DZ3_INCLUDE_DIR="${EPREFIX}/usr/include/z3"
- )
- else
- mycmakeargs+=(
- -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
- )
- fi
-
- if [[ -n ${EPREFIX} ]]; then
- mycmakeargs+=(
- -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
- )
- fi
-
- if tc-is-cross-compiler; then
- [[ -x "/usr/bin/clang-tblgen" ]] \
- || die "/usr/bin/clang-tblgen not found or usable"
- mycmakeargs+=(
- -DCMAKE_CROSSCOMPILING=ON
- -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
- )
- fi
-
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
- cmake-utils_src_configure
-}
-
-multilib_src_compile() {
- cmake-utils_src_compile
-
- # provide a symlink for tests
- if [[ ! -L ${WORKDIR}/lib/clang ]]; then
- mkdir -p "${WORKDIR}"/lib || die
- ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
- fi
-}
-
-multilib_src_test() {
- # respect TMPDIR!
- local -x LIT_PRESERVES_TMP=1
- cmake-utils_src_make check-clang
- # clang-tidy requires [static-analyzer] and tests are not split
- # correctly, so they are all disabled when static-analyzer is off
- if multilib_is_native_abi && use static-analyzer; then
- cmake-utils_src_make check-clang-tools
- fi
-}
-
-src_install() {
- MULTILIB_WRAPPED_HEADERS=(
- /usr/include/clang/Config/config.h
- )
-
- multilib-minimal_src_install
-
- # Move runtime headers to /usr/lib/clang, where they belong
- mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
- # move (remaining) wrapped headers back
- mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
-
- # Apply CHOST and version suffix to clang tools
- # note: we use two version components here (vs 3 in runtime path)
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-2 "${llvm_version}")
- local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
- local clang_tools=( clang clang++ clang-cl clang-cpp )
- local abi i
-
- # cmake gives us:
- # - clang-X.Y
- # - clang -> clang-X.Y
- # - clang++, clang-cl, clang-cpp -> clang
- # we want to have:
- # - clang-X.Y
- # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
- # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
- # also in CHOST variant
- for i in "${clang_tools[@]:1}"; do
- rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
- dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
- dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
- done
-
- # now create target symlinks for all supported ABIs
- for abi in $(get_all_abis); do
- local abi_chost=$(get_abi_CHOST "${abi}")
- for i in "${clang_tools[@]}"; do
- dosym "${i}-${clang_version}" \
- "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
- dosym "${abi_chost}-${i}-${clang_version}" \
- "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
- done
- done
-
- # Remove unnecessary headers on FreeBSD, bug #417171
- if use kernel_FreeBSD; then
- rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
- fi
-}
-
-multilib_src_install() {
- cmake-utils_src_install
-
- # move headers to /usr/include for wrapping & ABI mismatch checks
- # (also drop the version suffix from runtime headers)
- rm -rf "${ED%/}"/usr/include || die
- mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
- mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
-}
-
-multilib_src_install_all() {
- python_fix_shebang "${ED}"
- if use static-analyzer; then
- python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
- fi
-
- # install pre-generated manpages
- if ! use doc; then
- insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
- doins "${WORKDIR}/x/y/llvm-${PV}-manpages/clang"/*.1
- fi
-
- docompress "/usr/lib/llvm/${SLOT}/share/man"
- # match 'html' non-compression
- use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
- # +x for some reason; TODO: investigate
- use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
-}
-
-pkg_postinst() {
- if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow update all
- fi
-
- elog "You can find additional utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
- elog "To use these scripts, you will need Python 2.7. Some of them are vim"
- elog "integration scripts (with instructions inside)."
-}
-
-pkg_postrm() {
- if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow clean all
- fi
-}
diff --git a/sys-devel/clang/clang-5.0.2.ebuild b/sys-devel/clang/clang-5.0.2.ebuild
deleted file mode 100644
index dd73691..0000000
--- a/sys-devel/clang/clang-5.0.2.ebuild
+++ /dev/null
@@ -1,333 +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 cmake-utils eapi7-ver flag-o-matic llvm \
- multilib-minimal pax-utils prefix python-single-r1 toolchain-funcs
-
-MY_P=cfe-${PV/_/}.src
-EXTRA_P=clang-tools-extra-${PV/_/}.src
-LLVM_P=llvm-${PV/_/}.src
-
-DESCRIPTION="C language family frontend for LLVM"
-HOMEPAGE="https://llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz
- https://releases.llvm.org/${PV/_//}/${EXTRA_P}.tar.xz
- test? ( https://releases.llvm.org/${PV/_//}/${LLVM_P}.tar.xz )
- !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-${PV}-manpages.tar.bz2 )"
-
-# Keep in sync with sys-devel/llvm
-ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
- NVPTX PowerPC Sparc SystemZ X86 XCore )
-ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
-LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
-
-LICENSE="UoI-NCSA"
-SLOT="$(ver_cut 1)"
-KEYWORDS="amd64 ~arm64 ~ppc64 x86 ~amd64-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
-IUSE="debug default-compiler-rt default-libcxx doc hardened +static-analyzer
- test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
-
-RDEPEND="
- ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
- static-analyzer? (
- dev-lang/perl:*
- z3? ( sci-mathematics/z3:0= )
- )
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- ${PYTHON_DEPS}"
-# configparser-3.2 breaks the build (3.3 or none at all are fine)
-DEPEND="${RDEPEND}
- doc? ( dev-python/sphinx )
- xml? ( virtual/pkgconfig )
- !!<dev-python/configparser-3.3.0.2
- ${PYTHON_DEPS}"
-RDEPEND="${RDEPEND}
- !<sys-devel/llvm-4.0.0_rc:0
- !sys-devel/clang:0"
-PDEPEND="
- ~sys-devel/clang-runtime-${PV}
- default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
- default-libcxx? ( >=sys-libs/libcxx-${PV} )"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}
- || ( ${ALL_LLVM_TARGETS[*]} )"
-
-# We need extra level of indirection for CLANG_RESOURCE_DIR
-S=${WORKDIR}/x/y/${MY_P}
-
-# least intrusive of all
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-# Multilib notes:
-# 1. ABI_* flags control ABIs libclang* is built for only.
-# 2. clang is always capable of compiling code for all ABIs for enabled
-# target. However, you will need appropriate crt* files (installed
-# e.g. by sys-devel/gcc and sys-libs/glibc).
-# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
-# in the current profile (i.e. alike supported by sys-devel/gcc).
-#
-# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
-# multilib clang* libraries (not runtime, not wrappers).
-
-pkg_setup() {
- LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
- python-single-r1_pkg_setup
-}
-
-src_unpack() {
- # create extra parent dir for CLANG_RESOURCE_DIR
- mkdir -p x/y || die
- cd x/y || die
-
- einfo "Unpacking ${MY_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die
- einfo "Unpacking ${EXTRA_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${EXTRA_P}.tar.xz" || die
-
- mv "${EXTRA_P}" "${S}"/tools/extra || 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}" "${WORKDIR}"/llvm || die
- fi
-
- if ! use doc; then
- einfo "Unpacking llvm-${PV}-manpages.tar.bz2 ..."
- tar -xf "${DISTDIR}/llvm-${PV}-manpages.tar.bz2" || die
- fi
-}
-
-src_prepare() {
- # fix finding compiler-rt libs
- eapply "${FILESDIR}"/5.0.1/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
- # fix setting LD_LIBRARY_PATH for tests on *BSD
- eapply "${FILESDIR}"/5.0.1/0002-test-Fix-clang-test-for-FreeBSD-and-NetBSD.patch
- # add Prefix include paths for Darwin
- eapply "${FILESDIR}"/5.0.1/darwin_prefix-include-paths.patch
- # only used in hardened patches at the moment
- eapply "${FILESDIR}"/5.0.1/0003-Add-Gentoo-Linux-distro.patch
-
- cd tools/extra || die
- # fix setting LD_LIBRARY_PATH for tests on *BSD (extra part)
- eapply "${FILESDIR}"/5.0.1/extra/0001-Assume-the-shared-library-path-variable-is-LD_LIBRAR.patch
- cd ../.. || die
-
- if use hardened; then
- eapply "${FILESDIR}"/5.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
- eapply "${FILESDIR}"/5.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
- eapply "${FILESDIR}"/5.0.1/hardened/0003-Enable-PIE-by-default.patch
- eapply "${FILESDIR}"/5.0.1/hardened/0004-Enable-FORTIFY_SOURCE-macro-by-default.patch
- eapply "${FILESDIR}"/5.0.1/hardened/0005-Link-with-z-now-by-default-for-Gentoo.patch
- fi
-
- cmake-utils_src_prepare
- eprefixify lib/Frontend/InitHeaderSearch.cpp
-}
-
-multilib_src_configure() {
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-3 "${llvm_version}")
-
- local mycmakeargs=(
- # ensure that the correct llvm-config is used
- -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
- # relative to bindir
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
-
- -DBUILD_SHARED_LIBS=ON
- -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
- -DLLVM_BUILD_TESTS=$(usex test)
-
- # these are not propagated reliably, so redefine them
- -DLLVM_ENABLE_EH=ON
- -DLLVM_ENABLE_RTTI=ON
-
- -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
- # libgomp support fails to find headers without explicit -I
- # furthermore, it provides only syntax checking
- -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
-
- # override default stdlib and rtlib
- -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
- -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
-
- -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
- -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
- # z3 is not multilib-friendly
- -DCLANG_ANALYZER_BUILD_Z3=$(multilib_native_usex z3)
- )
- use test && mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
- )
-
- if multilib_is_native_abi; then
- mycmakeargs+=(
- # normally copied from LLVM_INCLUDE_DOCS but the latter
- # is lacking value in stand-alone builds
- -DCLANG_INCLUDE_DOCS=$(usex doc)
- -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=$(usex doc)
- )
- use doc && mycmakeargs+=(
- -DLLVM_BUILD_DOCS=ON
- -DLLVM_ENABLE_SPHINX=ON
- -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
- -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
- -DSPHINX_WARNINGS_AS_ERRORS=OFF
- )
- use z3 && mycmakeargs+=(
- -DZ3_INCLUDE_DIR="${EPREFIX}/usr/include/z3"
- )
- else
- mycmakeargs+=(
- -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
- )
- fi
-
- if [[ -n ${EPREFIX} ]]; then
- mycmakeargs+=(
- -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
- )
- fi
-
- if tc-is-cross-compiler; then
- [[ -x "/usr/bin/clang-tblgen" ]] \
- || die "/usr/bin/clang-tblgen not found or usable"
- mycmakeargs+=(
- -DCMAKE_CROSSCOMPILING=ON
- -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
- )
- fi
-
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
- cmake-utils_src_configure
-}
-
-multilib_src_compile() {
- cmake-utils_src_compile
-
- # provide a symlink for tests
- if [[ ! -L ${WORKDIR}/lib/clang ]]; then
- mkdir -p "${WORKDIR}"/lib || die
- ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
- fi
-}
-
-multilib_src_test() {
- # respect TMPDIR!
- local -x LIT_PRESERVES_TMP=1
- cmake-utils_src_make check-clang
- # clang-tidy requires [static-analyzer] and tests are not split
- # correctly, so they are all disabled when static-analyzer is off
- if multilib_is_native_abi && use static-analyzer; then
- cmake-utils_src_make check-clang-tools
- fi
-}
-
-src_install() {
- MULTILIB_WRAPPED_HEADERS=(
- /usr/include/clang/Config/config.h
- )
-
- multilib-minimal_src_install
-
- # Move runtime headers to /usr/lib/clang, where they belong
- mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
- # move (remaining) wrapped headers back
- mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
-
- # Apply CHOST and version suffix to clang tools
- # note: we use two version components here (vs 3 in runtime path)
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-2 "${llvm_version}")
- local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
- local clang_tools=( clang clang++ clang-cl clang-cpp )
- local abi i
-
- # cmake gives us:
- # - clang-X.Y
- # - clang -> clang-X.Y
- # - clang++, clang-cl, clang-cpp -> clang
- # we want to have:
- # - clang-X.Y
- # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
- # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
- # also in CHOST variant
- for i in "${clang_tools[@]:1}"; do
- rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
- dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
- dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
- done
-
- # now create target symlinks for all supported ABIs
- for abi in $(get_all_abis); do
- local abi_chost=$(get_abi_CHOST "${abi}")
- for i in "${clang_tools[@]}"; do
- dosym "${i}-${clang_version}" \
- "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
- dosym "${abi_chost}-${i}-${clang_version}" \
- "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
- done
- done
-
- # Remove unnecessary headers on FreeBSD, bug #417171
- if use kernel_FreeBSD; then
- rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
- fi
-}
-
-multilib_src_install() {
- cmake-utils_src_install
-
- # move headers to /usr/include for wrapping & ABI mismatch checks
- # (also drop the version suffix from runtime headers)
- rm -rf "${ED%/}"/usr/include || die
- mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
- mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
-}
-
-multilib_src_install_all() {
- python_fix_shebang "${ED}"
- if use static-analyzer; then
- python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
- fi
-
- # install pre-generated manpages
- if ! use doc; then
- insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
- doins "${WORKDIR}/x/y/llvm-${PV}-manpages/clang"/*.1
- fi
-
- docompress "/usr/lib/llvm/${SLOT}/share/man"
- # match 'html' non-compression
- use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
- # +x for some reason; TODO: investigate
- use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
-}
-
-pkg_postinst() {
- if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow update all
- fi
-
- elog "You can find additional utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
- elog "To use these scripts, you will need Python 2.7. Some of them are vim"
- elog "integration scripts (with instructions inside)."
-}
-
-pkg_postrm() {
- if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow clean all
- fi
-}
diff --git a/sys-devel/clang/clang-6.0.0-r1.ebuild b/sys-devel/clang/clang-6.0.0-r1.ebuild
deleted file mode 100644
index fc14879..0000000
--- a/sys-devel/clang/clang-6.0.0-r1.ebuild
+++ /dev/null
@@ -1,337 +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 cmake-utils eapi7-ver flag-o-matic llvm \
- multilib-minimal multiprocessing pax-utils prefix python-single-r1 \
- toolchain-funcs
-
-MY_P=cfe-${PV/_/}.src
-EXTRA_P=clang-tools-extra-${PV/_/}.src
-LLVM_P=llvm-${PV/_/}.src
-
-DESCRIPTION="C language family frontend for LLVM"
-HOMEPAGE="https://llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz
- https://releases.llvm.org/${PV/_//}/${EXTRA_P}.tar.xz
- test? ( https://releases.llvm.org/${PV/_//}/${LLVM_P}.tar.xz )
- !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-${PV}-manpages.tar.bz2 )"
-
-# Keep in sync with sys-devel/llvm
-ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
- NVPTX PowerPC Sparc SystemZ X86 XCore )
-ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
-LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
-
-LICENSE="UoI-NCSA"
-SLOT="$(ver_cut 1)"
-KEYWORDS="~amd64 ~arm64 ~x86 ~amd64-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
-IUSE="debug default-compiler-rt default-libcxx doc hardened +static-analyzer
- test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
- static-analyzer? (
- dev-lang/perl:*
- z3? ( sci-mathematics/z3:0= )
- )
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- ${PYTHON_DEPS}"
-# configparser-3.2 breaks the build (3.3 or none at all are fine)
-DEPEND="${RDEPEND}
- doc? ( dev-python/sphinx )
- xml? ( virtual/pkgconfig )
- !!<dev-python/configparser-3.3.0.2
- ${PYTHON_DEPS}"
-RDEPEND="${RDEPEND}
- !<sys-devel/llvm-4.0.0_rc:0
- !sys-devel/clang:0"
-PDEPEND="
- sys-devel/clang-common
- ~sys-devel/clang-runtime-${PV}
- default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
- default-libcxx? ( >=sys-libs/libcxx-${PV} )"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}
- || ( ${ALL_LLVM_TARGETS[*]} )"
-
-# We need extra level of indirection for CLANG_RESOURCE_DIR
-S=${WORKDIR}/x/y/${MY_P}
-
-# least intrusive of all
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-PATCHES=(
- # add Prefix include paths for Darwin
- "${FILESDIR}"/5.0.1/darwin_prefix-include-paths.patch
-
- # fix Driver crash with CHOST prefix and long command-line
- # https://bugs.gentoo.org/650082
- "${FILESDIR}"/6.0.0/0001-Driver-Avoid-invalidated-iterator-in-insertTargetAnd.patch
- # fix test failure with default-compiler-rt
- # https://bugs.gentoo.org/650316
- "${FILESDIR}"/6.0.0/0002-test-Fix-Cross-DSO-CFI-Android-sanitizer-test-for-rt.patch
-
- # IsGentooLinux() is only used in hardened patches at the moment
- "${FILESDIR}"/6.0.0/0003-Add-Gentoo-Linux-distro.patch
-)
-HARDENED_PATCHES=(
- "${FILESDIR}"/6.0.0/hardened/0001-Use-z-relro-on-Gentoo.patch
- "${FILESDIR}"/6.0.0/hardened/0002-Enable-Stack-Protector-by-default.patch
- "${FILESDIR}"/6.0.0/hardened/0003-Enable-PIE-by-default.patch
- "${FILESDIR}"/6.0.0/hardened/0004-Enable-FORTIFY_SOURCE-macro-by-default.patch
- "${FILESDIR}"/6.0.0/hardened/0005-Link-with-z-now-by-default-for-Gentoo.patch
-)
-
-# Multilib notes:
-# 1. ABI_* flags control ABIs libclang* is built for only.
-# 2. clang is always capable of compiling code for all ABIs for enabled
-# target. However, you will need appropriate crt* files (installed
-# e.g. by sys-devel/gcc and sys-libs/glibc).
-# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
-# in the current profile (i.e. alike supported by sys-devel/gcc).
-#
-# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
-# multilib clang* libraries (not runtime, not wrappers).
-
-pkg_setup() {
- LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
- python-single-r1_pkg_setup
-}
-
-src_unpack() {
- # create extra parent dir for CLANG_RESOURCE_DIR
- mkdir -p x/y || die
- cd x/y || die
-
- einfo "Unpacking ${MY_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die
- einfo "Unpacking ${EXTRA_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${EXTRA_P}.tar.xz" || die
-
- mv "${EXTRA_P}" "${S}"/tools/extra || die
- if use test; then
- einfo "Unpacking parts of ${LLVM_P}.tar.xz ..."
- tar -xf "${DISTDIR}/${LLVM_P}.tar.xz" \
- "${LLVM_P}"/utils/{lit,llvm-lit,unittest} || die
- mv "${LLVM_P}" "${WORKDIR}"/llvm || die
- fi
-
- if ! use doc; then
- einfo "Unpacking llvm-${PV}-manpages.tar.bz2 ..."
- tar -xf "${DISTDIR}/llvm-${PV}-manpages.tar.bz2" || die
- fi
-}
-
-src_prepare() {
- use hardened && eapply "${HARDENED_PATCHES[@]}"
-
- cmake-utils_src_prepare
- eprefixify lib/Frontend/InitHeaderSearch.cpp
-}
-
-multilib_src_configure() {
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-3 "${llvm_version}")
-
- local mycmakeargs=(
- # ensure that the correct llvm-config is used
- -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
- # relative to bindir
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
-
- -DBUILD_SHARED_LIBS=ON
- -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
- -DLLVM_BUILD_TESTS=$(usex test)
-
- # these are not propagated reliably, so redefine them
- -DLLVM_ENABLE_EH=ON
- -DLLVM_ENABLE_RTTI=ON
-
- -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
- # libgomp support fails to find headers without explicit -I
- # furthermore, it provides only syntax checking
- -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
-
- # override default stdlib and rtlib
- -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
- -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
-
- -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
- -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
- # z3 is not multilib-friendly
- -DCLANG_ANALYZER_BUILD_Z3=$(multilib_native_usex z3)
- )
- use test && mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
- -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
- )
-
- if multilib_is_native_abi; then
- mycmakeargs+=(
- # normally copied from LLVM_INCLUDE_DOCS but the latter
- # is lacking value in stand-alone builds
- -DCLANG_INCLUDE_DOCS=$(usex doc)
- -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=$(usex doc)
- )
- use doc && mycmakeargs+=(
- -DLLVM_BUILD_DOCS=ON
- -DLLVM_ENABLE_SPHINX=ON
- -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
- -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
- -DSPHINX_WARNINGS_AS_ERRORS=OFF
- )
- use z3 && mycmakeargs+=(
- -DZ3_INCLUDE_DIR="${EPREFIX}/usr/include/z3"
- )
- else
- mycmakeargs+=(
- -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
- )
- fi
-
- if [[ -n ${EPREFIX} ]]; then
- mycmakeargs+=(
- -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
- )
- fi
-
- if tc-is-cross-compiler; then
- [[ -x "/usr/bin/clang-tblgen" ]] \
- || die "/usr/bin/clang-tblgen not found or usable"
- mycmakeargs+=(
- -DCMAKE_CROSSCOMPILING=ON
- -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
- )
- fi
-
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
- cmake-utils_src_configure
-}
-
-multilib_src_compile() {
- cmake-utils_src_compile
-
- # provide a symlink for tests
- if [[ ! -L ${WORKDIR}/lib/clang ]]; then
- mkdir -p "${WORKDIR}"/lib || die
- ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
- fi
-}
-
-multilib_src_test() {
- # respect TMPDIR!
- local -x LIT_PRESERVES_TMP=1
- cmake-utils_src_make check-clang
- multilib_is_native_abi && cmake-utils_src_make check-clang-tools
-}
-
-src_install() {
- MULTILIB_WRAPPED_HEADERS=(
- /usr/include/clang/Config/config.h
- )
-
- multilib-minimal_src_install
-
- # Move runtime headers to /usr/lib/clang, where they belong
- mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
- # move (remaining) wrapped headers back
- mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
-
- # Apply CHOST and version suffix to clang tools
- # note: we use two version components here (vs 3 in runtime path)
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-2 "${llvm_version}")
- local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
- local clang_tools=( clang clang++ clang-cl clang-cpp )
- local abi i
-
- # cmake gives us:
- # - clang-X.Y
- # - clang -> clang-X.Y
- # - clang++, clang-cl, clang-cpp -> clang
- # we want to have:
- # - clang-X.Y
- # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
- # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
- # also in CHOST variant
- for i in "${clang_tools[@]:1}"; do
- rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
- dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
- dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
- done
-
- # now create target symlinks for all supported ABIs
- for abi in $(get_all_abis); do
- local abi_chost=$(get_abi_CHOST "${abi}")
- for i in "${clang_tools[@]}"; do
- dosym "${i}-${clang_version}" \
- "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
- dosym "${abi_chost}-${i}-${clang_version}" \
- "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
- done
- done
-
- # Remove unnecessary headers on FreeBSD, bug #417171
- if use kernel_FreeBSD; then
- rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
- fi
-}
-
-multilib_src_install() {
- cmake-utils_src_install
-
- # move headers to /usr/include for wrapping & ABI mismatch checks
- # (also drop the version suffix from runtime headers)
- rm -rf "${ED%/}"/usr/include || die
- mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
- mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
-}
-
-multilib_src_install_all() {
- python_fix_shebang "${ED}"
- if use static-analyzer; then
- python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
- fi
-
- # install pre-generated manpages
- if ! use doc; then
- insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
- doins "${WORKDIR}/x/y/llvm-${PV}-manpages/clang"/*.1
- fi
-
- docompress "/usr/lib/llvm/${SLOT}/share/man"
- # match 'html' non-compression
- use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
- # +x for some reason; TODO: investigate
- use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
-}
-
-pkg_postinst() {
- if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow update all
- fi
-
- elog "You can find additional utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
- elog "To use these scripts, you will need Python 2.7. Some of them are vim"
- elog "integration scripts (with instructions inside). The run-clang-tidy.py"
- elog "scripts requires the following additional package:"
- elog " dev-python/pyyaml"
-}
-
-pkg_postrm() {
- if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow clean all
- fi
-}
diff --git a/sys-devel/clang/clang-6.0.1.ebuild b/sys-devel/clang/clang-6.0.1.ebuild
index db1615a..3cf5d11 100644
--- a/sys-devel/clang/clang-6.0.1.ebuild
+++ b/sys-devel/clang/clang-6.0.1.ebuild
@@ -31,7 +31,7 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
LICENSE="UoI-NCSA"
SLOT="$(ver_cut 1)"
-KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+KEYWORDS="amd64 arm64 ~ppc64 x86"
IUSE="debug default-compiler-rt default-libcxx doc hardened +static-analyzer
test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
RESTRICT="!test? ( test )"
@@ -70,7 +70,7 @@ CMAKE_BUILD_TYPE=RelWithDebInfo
PATCHES=(
# add Prefix include paths for Darwin
- "${FILESDIR}"/5.0.1/darwin_prefix-include-paths.patch
+ "${FILESDIR}"/6.0.1/darwin_prefix-include-paths.patch
# fix test failure with default-compiler-rt
# https://bugs.gentoo.org/650316
diff --git a/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch b/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
deleted file mode 100644
index f52d445..0000000
--- a/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From f1ea62e93cba334828c427146cc2ca7718a9ffb3 Mon Sep 17 00:00:00 2001
-From: Michal Gorny <mgorny@gentoo.org>
-Date: Mon, 9 Jan 2017 20:54:20 +0000
-Subject: [PATCH] [Frontend] Correct values of ATOMIC_*_LOCK_FREE to match
- builtin
-
-Correct the logic used to set ATOMIC_*_LOCK_FREE preprocessor macros not
-to rely on the ABI alignment of types. Instead, just assume all those
-types are aligned correctly by default since clang uses safe alignment
-for _Atomic types even if the underlying types are aligned to a lower
-boundary by default.
-
-For example, the 'long long' and 'double' types on x86 are aligned to
-32-bit boundary by default. However, '_Atomic long long' and '_Atomic
-double' are aligned to 64-bit boundary, therefore satisfying
-the requirements of lock-free atomic operations.
-
-This fixes PR #19355 by correcting the value of
-__GCC_ATOMIC_LLONG_LOCK_FREE on x86, and therefore also fixing
-the assumption made in libc++ tests. This also fixes PR #30581 by
-applying a consistent logic between the functions used to implement
-both interfaces.
-
-Differential Revision: https://reviews.llvm.org/D28213
-
-git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291477 91177308-0d34-0410-b5e6-96231b3b80d8
----
- lib/Frontend/InitPreprocessor.cpp | 10 ++++------
- test/Sema/atomic-ops.c | 4 ----
- 2 files changed, 4 insertions(+), 10 deletions(-)
-
-diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp
-index 17603ada11..4502c92499 100644
---- a/lib/Frontend/InitPreprocessor.cpp
-+++ b/lib/Frontend/InitPreprocessor.cpp
-@@ -286,12 +286,12 @@ static void DefineFastIntType(unsigned TypeWidth, bool IsSigned,
-
- /// Get the value the ATOMIC_*_LOCK_FREE macro should have for a type with
- /// the specified properties.
--static const char *getLockFreeValue(unsigned TypeWidth, unsigned TypeAlign,
-- unsigned InlineWidth) {
-+static const char *getLockFreeValue(unsigned TypeWidth, unsigned InlineWidth) {
- // Fully-aligned, power-of-2 sizes no larger than the inline
- // width will be inlined as lock-free operations.
-- if (TypeWidth == TypeAlign && (TypeWidth & (TypeWidth - 1)) == 0 &&
-- TypeWidth <= InlineWidth)
-+ // Note: we do not need to check alignment since _Atomic(T) is always
-+ // appropriately-aligned in clang.
-+ if ((TypeWidth & (TypeWidth - 1)) == 0 && TypeWidth <= InlineWidth)
- return "2"; // "always lock free"
- // We cannot be certain what operations the lib calls might be
- // able to implement as lock-free on future processors.
-@@ -881,7 +881,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
- #define DEFINE_LOCK_FREE_MACRO(TYPE, Type) \
- Builder.defineMacro("__GCC_ATOMIC_" #TYPE "_LOCK_FREE", \
- getLockFreeValue(TI.get##Type##Width(), \
-- TI.get##Type##Align(), \
- InlineWidthBits));
- DEFINE_LOCK_FREE_MACRO(BOOL, Bool);
- DEFINE_LOCK_FREE_MACRO(CHAR, Char);
-@@ -894,7 +893,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
- DEFINE_LOCK_FREE_MACRO(LLONG, LongLong);
- Builder.defineMacro("__GCC_ATOMIC_POINTER_LOCK_FREE",
- getLockFreeValue(TI.getPointerWidth(0),
-- TI.getPointerAlign(0),
- InlineWidthBits));
- #undef DEFINE_LOCK_FREE_MACRO
- }
-diff --git a/test/Sema/atomic-ops.c b/test/Sema/atomic-ops.c
-index 8ebf3eaed4..d3ebdf67db 100644
---- a/test/Sema/atomic-ops.c
-+++ b/test/Sema/atomic-ops.c
-@@ -14,11 +14,7 @@ _Static_assert(__GCC_ATOMIC_WCHAR_T_LOCK_FREE == 2, "");
- _Static_assert(__GCC_ATOMIC_SHORT_LOCK_FREE == 2, "");
- _Static_assert(__GCC_ATOMIC_INT_LOCK_FREE == 2, "");
- _Static_assert(__GCC_ATOMIC_LONG_LOCK_FREE == 2, "");
--#ifdef __i386__
--_Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 1, "");
--#else
- _Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 2, "");
--#endif
- _Static_assert(__GCC_ATOMIC_POINTER_LOCK_FREE == 2, "");
-
- _Static_assert(__c11_atomic_is_lock_free(1), "");
---
-2.12.0
-
diff --git a/sys-devel/clang/files/4.0.1/0002-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch b/sys-devel/clang/files/4.0.1/0002-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
deleted file mode 100644
index 0ecd5bc..0000000
--- a/sys-devel/clang/files/4.0.1/0002-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 8dd12df445c9a35f7b1c0202eb7c74b954b0980d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sun, 21 Aug 2016 23:31:55 +0200
-Subject: [PATCH 7/7] cmake: Support stand-alone Sphinx & doxygen doc build
-
-Copy the necessary options and configuration checks from LLVM to clang,
-to support stand-alone documentation builds.
-
-Patch: https://reviews.llvm.org/D23758
----
- CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++++
- 1 file changed, 37 insertions(+)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 8ed8c10..3f34d8c 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -162,6 +162,43 @@ Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
- endif()
- endif()
-
-+ option (LLVM_BUILD_DOCS "Build the llvm documentation." OFF)
-+ option (LLVM_INCLUDE_DOCS "Generate build targets for llvm documentation." ON)
-+ option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OFF)
-+ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
-+
-+ if (LLVM_ENABLE_DOXYGEN)
-+ message(STATUS "Doxygen enabled.")
-+ find_package(Doxygen REQUIRED)
-+
-+ if (DOXYGEN_FOUND)
-+ # If we find doxygen and we want to enable doxygen by default create a
-+ # global aggregate doxygen target for generating llvm and any/all
-+ # subprojects doxygen documentation.
-+ if (LLVM_BUILD_DOCS)
-+ add_custom_target(doxygen ALL)
-+ endif()
-+
-+ option(LLVM_DOXYGEN_EXTERNAL_SEARCH "Enable doxygen external search." OFF)
-+ if (LLVM_DOXYGEN_EXTERNAL_SEARCH)
-+ set(LLVM_DOXYGEN_SEARCHENGINE_URL "" CACHE STRING "URL to use for external search.")
-+ set(LLVM_DOXYGEN_SEARCH_MAPPINGS "" CACHE STRING "Doxygen Search Mappings")
-+ endif()
-+ endif()
-+ else()
-+ message(STATUS "Doxygen disabled.")
-+ endif()
-+
-+ if (LLVM_ENABLE_SPHINX)
-+ message(STATUS "Sphinx enabled.")
-+ find_package(Sphinx REQUIRED)
-+ if (LLVM_BUILD_DOCS)
-+ add_custom_target(sphinx ALL)
-+ endif()
-+ else()
-+ message(STATUS "Sphinx disabled.")
-+ endif()
-+
- set( CLANG_BUILT_STANDALONE 1 )
- set(BACKEND_PACKAGE_STRING "LLVM ${LLVM_PACKAGE_VERSION}")
- else()
---
-2.9.3
-
diff --git a/sys-devel/clang/files/4.0.1/0003-Add-Gentoo-Linux-distro.patch b/sys-devel/clang/files/4.0.1/0003-Add-Gentoo-Linux-distro.patch
deleted file mode 100644
index eb85ba5..0000000
--- a/sys-devel/clang/files/4.0.1/0003-Add-Gentoo-Linux-distro.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/include/clang/Driver/Distro.h
-+++ b/include/clang/Driver/Distro.h
-@@ -26,6 +26,7 @@
- // NB: Releases of a particular Linux distro should be kept together
- // in this enum, because some tests are done by integer comparison against
- // the first and last known member in the family, e.g. IsRedHat().
-+ GentooLinux,
- ArchLinux,
- DebianLenny,
- DebianSqueeze,
-@@ -97,6 +98,10 @@
- /// @name Convenience Predicates
- /// @{
-
-+ bool IsGentooLinux() const {
-+ return DistroVal == GentooLinux;
-+ }
-+
- bool IsRedhat() const {
- return DistroVal == Fedora || (DistroVal >= RHEL5 && DistroVal <= RHEL7);
- }
---- a/lib/Driver/Distro.cpp
-+++ b/lib/Driver/Distro.cpp
-@@ -128,6 +128,9 @@
- if (VFS.exists("/etc/arch-release"))
- return Distro::ArchLinux;
-
-+ if (VFS.exists("/etc/gentoo-release"))
-+ return Distro::GentooLinux;
-+
- return Distro::UnknownDistro;
- }
diff --git a/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch b/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
deleted file mode 100644
index 3779bc6..0000000
--- a/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From f1355920fbe819c5b1f5a870fc76cffcdd6328f0 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Fri, 10 Feb 2017 22:44:53 +0100
-Subject: [PATCH 1/2] [test] Fix test dependencies when using installed tools
-
-Use the LLVM_UTILS_PROVIDED variable to determine whether test tool
-dependencies should be exposed for clang-tools-extra tests. If clang is
-being built stand-alone and LLVM test tools (FileCheck, count and not)
-are installed, the top-level CMakeLists.txt of clang sets this variable
-to indicate that they will not be built as a part of this build,
-and therefore no dependencies should be emitted for them. This fixes
-the dependency errors when building clang stand-alone with tests
-enabled.
----
- test/CMakeLists.txt | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
-index a852ef60..c26bd5c4 100644
---- a/test/CMakeLists.txt
-+++ b/test/CMakeLists.txt
-@@ -31,9 +31,6 @@ if(CLANG_TOOLS_TEST_USE_VG)
- endif()
-
- set(CLANG_TOOLS_TEST_DEPS
-- # Base line deps.
-- FileCheck count not
--
- # clang-tidy tests require it.
- clang-headers
-
-@@ -58,6 +55,13 @@ set(CLANG_TOOLS_TEST_DEPS
- ExtraToolsUnitTests
- )
-
-+if(NOT LLVM_UTILS_PROVIDED)
-+ list(APPEND CLANG_TOOLS_TEST_DEPS
-+ # Base line deps.
-+ FileCheck count not
-+ )
-+endif()
-+
- add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests"
- ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${CLANG_TOOLS_TEST_DEPS}
---
-2.12.0
-
diff --git a/sys-devel/clang/files/4.0.1/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch b/sys-devel/clang/files/4.0.1/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
deleted file mode 100644
index 22f6d56..0000000
--- a/sys-devel/clang/files/4.0.1/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From f3ff810e81c35133f6a7e463d860bcd4ca30be84 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sun, 19 Feb 2017 12:13:04 +0100
-Subject: [PATCH 2/2] [test] Fix clang library dir in LD_LIBRARY_PATH For
- stand-alone build
-
-Prepend the clang library directory (determined using SHLIBDIR, alike
-in clang) to the LD_LIBRARY_PATH to ensure that just-built clang
-libraries will be used instead of a previous installed version.
-
-When a stand-alone build is performed, LLVM_LIBS_DIR contains the path
-to installed LLVM library directory. The same directory frequently
-contains a previously installed version of clang. SHLIBDIR, on the other
-hand, is always the build-tree directory, and therefore contains
-the freshly built clang libraries.
-
-In a non-stand-alone build, both paths will be the same and therefore
-including them both will not cause any issues.
----
- test/Unit/lit.cfg | 9 ++++++---
- test/lit.cfg | 5 ++++-
- test/lit.site.cfg.in | 1 +
- 3 files changed, 11 insertions(+), 4 deletions(-)
-
-diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg
-index ff70123c..3a1da187 100644
---- a/test/Unit/lit.cfg
-+++ b/test/Unit/lit.cfg
-@@ -41,14 +41,17 @@ elif platform.system() == 'Windows':
- shlibpath_var = 'PATH'
-
- # Point the dynamic loader at dynamic libraries in 'lib'.
-+shlibdir = getattr(config, 'shlibdir', None)
-+if not shlibdir:
-+ lit_config.fatal('No shlibdir set!')
- llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
- if not llvm_libs_dir:
- lit_config.fatal('No LLVM libs dir set!')
--shlibpath = os.path.pathsep.join((llvm_libs_dir,
-+shlibpath = os.path.pathsep.join((shlibdir, llvm_libs_dir,
- config.environment.get(shlibpath_var,'')))
-
- # Win32 seeks DLLs along %PATH%.
--if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
-- shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
-+if sys.platform in ['win32', 'cygwin'] and os.path.isdir(shlibdir):
-+ shlibpath = os.path.pathsep.join((shlibdir, shlibpath))
-
- config.environment[shlibpath_var] = shlibpath
-diff --git a/test/lit.cfg b/test/lit.cfg
-index bb592936..0e7de849 100644
---- a/test/lit.cfg
-+++ b/test/lit.cfg
-@@ -99,10 +99,13 @@ if clang_tools_binary_dir is not None:
- clang_tools_dir, llvm_tools_dir, config.environment['PATH']))
- config.environment['PATH'] = path
-
-+ clang_libs_dir = getattr(config, 'clang_libs_dir', None)
-+ if not clang_libs_dir:
-+ lit_config.fatal('No Clang libs dir set!')
- llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
- if not llvm_libs_dir:
- lit_config.fatal('No LLVM libs dir set!')
-- path = os.path.pathsep.join((llvm_libs_dir,
-+ path = os.path.pathsep.join((clang_libs_dir, llvm_libs_dir,
- config.environment.get('LD_LIBRARY_PATH','')))
- config.environment['LD_LIBRARY_PATH'] = path
-
-diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
-index dfd0164c..f310b59a 100644
---- a/test/lit.site.cfg.in
-+++ b/test/lit.site.cfg.in
-@@ -7,6 +7,7 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
- config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
- config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
- config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
-+config.clang_libs_dir = "@SHLIBDIR@"
- config.python_executable = "@PYTHON_EXECUTABLE@"
- config.target_triple = "@TARGET_TRIPLE@"
-
---
-2.12.0
-
diff --git a/sys-devel/clang/files/4.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch b/sys-devel/clang/files/4.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
deleted file mode 100644
index 93e7c6a..0000000
--- a/sys-devel/clang/files/4.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/lib/Driver/ToolChains.cpp
-+++ b/lib/Driver/ToolChains.cpp
-@@ -4112,7 +4112,7 @@
-
- Distro Distro(D.getVFS());
-
-- if (Distro.IsOpenSUSE() || Distro.IsUbuntu()) {
-+ if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsGentooLinux()) {
- ExtraOpts.push_back("-z");
- ExtraOpts.push_back("relro");
- }
diff --git a/sys-devel/clang/files/4.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch b/sys-devel/clang/files/4.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
deleted file mode 100644
index 13ac645..0000000
--- a/sys-devel/clang/files/4.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/lib/Driver/ToolChains.cpp
-+++ b/lib/Driver/ToolChains.cpp
-@@ -4866,6 +4866,10 @@
- CmdArgs.push_back("-lunwind");
- }
-
-+unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const {
-+ return 2;
-+}
-+
- /// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly.
-
- DragonFly::DragonFly(const Driver &D, const llvm::Triple &Triple,
---- a/lib/Driver/ToolChains.h
-+++ b/lib/Driver/ToolChains.h
-@@ -880,6 +880,7 @@
- void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs,
- llvm::opt::ArgStringList &CC1Args) const override;
- bool isPIEDefault() const override;
-+ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override;
- SanitizerMask getSupportedSanitizers() const override;
- void addProfileRTLibs(const llvm::opt::ArgList &Args,
- llvm::opt::ArgStringList &CmdArgs) const override;
diff --git a/sys-devel/clang/files/4.0.1/hardened/0003-Enable-PIE-by-default.patch b/sys-devel/clang/files/4.0.1/hardened/0003-Enable-PIE-by-default.patch
deleted file mode 100644
index e1908bc..0000000
--- a/sys-devel/clang/files/4.0.1/hardened/0003-Enable-PIE-by-default.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/lib/Driver/ToolChains.cpp
-+++ b/lib/Driver/ToolChains.cpp
-@@ -4721,7 +4721,9 @@
- }
- }
-
--bool Linux::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); }
-+bool Linux::isPIEDefault() const {
-+ return true;
-+}
-
- SanitizerMask Linux::getSupportedSanitizers() const {
- const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
---- a/lib/Driver/Tools.cpp
-+++ b/lib/Driver/Tools.cpp
-@@ -9258,7 +9258,9 @@
- if (!D.SysRoot.empty())
- CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
-
-- if (IsPIE)
-+ if (Args.hasArg(options::OPT_nopie))
-+ CmdArgs.push_back("-nopie");
-+ else if (IsPIE)
- CmdArgs.push_back("-pie");
-
- CmdArgs.push_back("--eh-frame-hdr");
diff --git a/sys-devel/clang/files/4.0.1/hardened/0004-Link-with-z-now-by-default-for-Gentoo.patch b/sys-devel/clang/files/4.0.1/hardened/0004-Link-with-z-now-by-default-for-Gentoo.patch
deleted file mode 100644
index b404db5..0000000
--- a/sys-devel/clang/files/4.0.1/hardened/0004-Link-with-z-now-by-default-for-Gentoo.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/lib/Driver/ToolChains.cpp
-+++ b/lib/Driver/ToolChains.cpp
-@@ -4112,6 +4112,11 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-
- Distro Distro(D.getVFS());
-
-+ if (Distro.IsGentooLinux()) {
-+ ExtraOpts.push_back("-z");
-+ ExtraOpts.push_back("now");
-+ }
-+
- if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsGentooLinux()) {
- ExtraOpts.push_back("-z");
- ExtraOpts.push_back("relro");
diff --git a/sys-devel/clang/files/5.0.1/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch b/sys-devel/clang/files/5.0.1/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
deleted file mode 100644
index 7d53cbd..0000000
--- a/sys-devel/clang/files/5.0.1/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-From 19e3dc0ce4949cc7f869b4552c6a7f28cd59c3b7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Thu, 17 Nov 2016 14:19:18 +0100
-Subject: [PATCH] [Driver] Use arch type to find compiler-rt libraries (on
- Linux)
-
-Use llvm::Triple::getArchTypeName() when looking for compiler-rt
-libraries, rather than the exact arch string from the triple. This is
-more correct as it matches the values used when building compiler-rt
-(builtin-config-ix.cmake) which are the subset of the values allowed
-in triples.
-
-For example, this fixes an issue when the compiler set for
-i686-pc-linux-gnu triple would not find an i386 compiler-rt library,
-while this is the exact arch that is detected by compiler-rt. The same
-applies to any other i?86 variant allowed by LLVM.
-
-This also makes the special case for MSVC unnecessary, since now i386
-will be used reliably for all 32-bit x86 variants.
----
- lib/Driver/ToolChain.cpp | 5 +----
- .../usr/i686-unknown-linux/lib/.keep | 0
- .../usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o | 0
- test/Driver/linux-ld.c | 21 +++++++++++++++++++++
- test/Driver/nostdlib.c | 2 +-
- test/Driver/print-libgcc-file-name-clangrt.c | 10 ++++++++--
- test/Driver/windows-cross.c | 2 +-
- 7 files changed, 32 insertions(+), 8 deletions(-)
- create mode 100644 test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep
- create mode 100644 test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o
-
-diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
-index 6adc0386ee..7e4222f087 100644
---- a/lib/Driver/ToolChain.cpp
-+++ b/lib/Driver/ToolChain.cpp
-@@ -283,15 +283,12 @@ static StringRef getArchNameForCompilerRTLib(const ToolChain &TC,
- const llvm::Triple &Triple = TC.getTriple();
- bool IsWindows = Triple.isOSWindows();
-
-- if (Triple.isWindowsMSVCEnvironment() && TC.getArch() == llvm::Triple::x86)
-- return "i386";
--
- if (TC.getArch() == llvm::Triple::arm || TC.getArch() == llvm::Triple::armeb)
- return (arm::getARMFloatABI(TC, Args) == arm::FloatABI::Hard && !IsWindows)
- ? "armhf"
- : "arm";
-
-- return TC.getArchName();
-+ return llvm::Triple::getArchTypeName(TC.getArch());
- }
-
- std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
-diff --git a/test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep b/test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep
-new file mode 100644
-index 0000000000..e69de29bb2
-diff --git a/test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o b/test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o
-new file mode 100644
-index 0000000000..e69de29bb2
-diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c
-index e5aa870866..92b199b9d4 100644
---- a/test/Driver/linux-ld.c
-+++ b/test/Driver/linux-ld.c
-@@ -71,6 +71,27 @@
- // CHECK-LD-RT: libclang_rt.builtins-x86_64.a"
- //
- // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-+// RUN: --target=i686-unknown-linux \
-+// RUN: --gcc-toolchain="" \
-+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
-+// RUN: --rtlib=compiler-rt \
-+// RUN: | FileCheck --check-prefix=CHECK-LD-RT-I686 %s
-+// CHECK-LD-RT-I686-NOT: warning:
-+// CHECK-LD-RT-I686: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-+// CHECK-LD-RT-I686: "--eh-frame-hdr"
-+// CHECK-LD-RT-I686: "-m" "elf_i386"
-+// CHECK-LD-RT-I686: "-dynamic-linker"
-+// CHECK-LD-RT-I686: "{{.*}}/usr/lib/gcc/i686-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
-+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0"
-+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../../../i686-unknown-linux/lib"
-+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../.."
-+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/lib"
-+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib"
-+// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a"
-+// CHECK-LD-RT-I686: "-lc"
-+// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a"
-+//
-+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
- // RUN: --target=arm-linux-androideabi \
- // RUN: --gcc-toolchain="" \
- // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
-diff --git a/test/Driver/nostdlib.c b/test/Driver/nostdlib.c
-index a9ef665c57..c9793d968c 100644
---- a/test/Driver/nostdlib.c
-+++ b/test/Driver/nostdlib.c
-@@ -27,5 +27,5 @@
- //
- // CHECK-LINUX-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt'
- // CHECK-LINUX-NOSTDLIB: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
--// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i686.a"
-+// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i386.a"
- // CHECK-MSVC-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt'
-diff --git a/test/Driver/print-libgcc-file-name-clangrt.c b/test/Driver/print-libgcc-file-name-clangrt.c
-index 9f8120c31d..28c758881d 100644
---- a/test/Driver/print-libgcc-file-name-clangrt.c
-+++ b/test/Driver/print-libgcc-file-name-clangrt.c
-@@ -6,6 +6,12 @@
- // CHECK-CLANGRT-X8664: libclang_rt.builtins-x86_64.a
-
- // RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
-+// RUN: --target=i386-pc-linux \
-+// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
-+// CHECK-CLANGRT-I386: libclang_rt.builtins-i386.a
-+
-+// Check whether alternate arch values map to the correct library.
-+//
-+// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
- // RUN: --target=i686-pc-linux \
--// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I686 %s
--// CHECK-CLANGRT-I686: libclang_rt.builtins-i686.a
-+// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
-diff --git a/test/Driver/windows-cross.c b/test/Driver/windows-cross.c
-index 5a2fe52b09..78b4981c9d 100644
---- a/test/Driver/windows-cross.c
-+++ b/test/Driver/windows-cross.c
-@@ -59,7 +59,7 @@
- // RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-ADDRESS-EXE-X86
-
- // CHECK-SANITIZE-ADDRESS-EXE-X86: "-fsanitize=address"
--// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i686.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i686.lib" "--undefined" "___asan_seh_interceptor"
-+// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i386.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib" "--undefined" "___asan_seh_interceptor"
-
- // RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -fuse-ld=lld-link2 -shared -o shared.dll -fsanitize=tsan -x c++ %s 2>&1 \
- // RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-TSAN
---
-2.11.0
-
diff --git a/sys-devel/clang/files/5.0.1/0002-test-Fix-clang-test-for-FreeBSD-and-NetBSD.patch b/sys-devel/clang/files/5.0.1/0002-test-Fix-clang-test-for-FreeBSD-and-NetBSD.patch
deleted file mode 100644
index 1751a4f..0000000
--- a/sys-devel/clang/files/5.0.1/0002-test-Fix-clang-test-for-FreeBSD-and-NetBSD.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From 4650c277d616e5d297baf28682eb792e2e0144b1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sun, 1 Apr 2018 23:20:56 +0200
-Subject: [PATCH] [test] Fix clang-test for FreeBSD and NetBSD
-
-Lit tries to inject the shared library paths, but no action is taken
-when platform.system() is not recognized, results in an environment
-variable with an empty name, which is illegal.
-
-The patch fixes this mechanism for FreeBSD and NetBSD, and gives an
-warning on other platforms, so that the latecomers don't have to spend
-time on debugging lit.
-
-Thanks Zhihao Yuan for the patch!
-
-Differential Revision: https://reviews.llvm.org/D39162
-
-git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316411 91177308-0d34-0410-b5e6-96231b3b80d8
-
-(rebased for release_50 branch)
----
- test/Unit/lit.cfg | 41 ++++++++++++++++++++---------------------
- 1 file changed, 20 insertions(+), 21 deletions(-)
-
-diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg
-index 90eb2ac604..2cabf4bba1 100644
---- a/test/Unit/lit.cfg
-+++ b/test/Unit/lit.cfg
-@@ -87,24 +87,23 @@ if config.test_exec_root is None:
- lit_config.load_config(config, site_cfg)
- raise SystemExit
-
--shlibpath_var = ''
--if platform.system() == 'Linux':
-- shlibpath_var = 'LD_LIBRARY_PATH'
--elif platform.system() == 'Darwin':
-- shlibpath_var = 'DYLD_LIBRARY_PATH'
--elif platform.system() == 'Windows':
-- shlibpath_var = 'PATH'
--
--# in stand-alone builds, shlibdir is clang's build tree
--# while llvm_libs_dir is installed LLVM (and possibly older clang)
--llvm_shlib_dir = getattr(config, 'shlibdir', None)
--if not llvm_shlib_dir:
-- lit_config.fatal('No shlibdir set!')
--# Point the dynamic loader at dynamic libraries in 'lib'.
--llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
--if not llvm_libs_dir:
-- lit_config.fatal('No LLVM libs dir set!')
--shlibpath = os.path.pathsep.join((llvm_shlib_dir, llvm_libs_dir,
-- config.environment.get(shlibpath_var,'')))
--
--config.environment[shlibpath_var] = shlibpath
-+def find_shlibpath_var():
-+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD']:
-+ yield 'LD_LIBRARY_PATH'
-+ elif platform.system() == 'Darwin':
-+ yield 'DYLD_LIBRARY_PATH'
-+ elif platform.system() == 'Windows':
-+ yield 'PATH'
-+
-+for shlibpath_var in find_shlibpath_var():
-+ # in stand-alone builds, shlibdir is clang's build tree
-+ # while llvm_libs_dir is installed LLVM (and possibly older clang)
-+ shlibpath = os.path.pathsep.join(
-+ (config.shlibdir,
-+ config.llvm_libs_dir,
-+ config.environment.get(shlibpath_var, '')))
-+ config.environment[shlibpath_var] = shlibpath
-+ break
-+else:
-+ lit_config.warning("unable to inject shared library path on '{}'"
-+ .format(platform.system()))
---
-2.17.0.rc2
-
diff --git a/sys-devel/clang/files/5.0.1/0003-Add-Gentoo-Linux-distro.patch b/sys-devel/clang/files/5.0.1/0003-Add-Gentoo-Linux-distro.patch
deleted file mode 100644
index 68770a6..0000000
--- a/sys-devel/clang/files/5.0.1/0003-Add-Gentoo-Linux-distro.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- a/include/clang/Driver/Distro.h
-+++ b/include/clang/Driver/Distro.h
-@@ -26,6 +26,7 @@ public:
- // NB: Releases of a particular Linux distro should be kept together
- // in this enum, because some tests are done by integer comparison against
- // the first and last known member in the family, e.g. IsRedHat().
-+ GentooLinux,
- ArchLinux,
- DebianLenny,
- DebianSqueeze,
-@@ -98,6 +99,10 @@ public:
- /// @name Convenience Predicates
- /// @{
-
-+ bool IsGentooLinux() const {
-+ return DistroVal == GentooLinux;
-+ }
-+
- bool IsRedhat() const {
- return DistroVal == Fedora || (DistroVal >= RHEL5 && DistroVal <= RHEL7);
- }
---- a/lib/Driver/Distro.cpp
-+++ b/lib/Driver/Distro.cpp
-@@ -129,6 +129,9 @@ static Distro::DistroType DetectDistro(vfs::FileSystem &VFS) {
- if (VFS.exists("/etc/arch-release"))
- return Distro::ArchLinux;
-
-+ if (VFS.exists("/etc/gentoo-release"))
-+ return Distro::GentooLinux;
-+
- return Distro::UnknownDistro;
- }
-
diff --git a/sys-devel/clang/files/5.0.1/extra/0001-Assume-the-shared-library-path-variable-is-LD_LIBRAR.patch b/sys-devel/clang/files/5.0.1/extra/0001-Assume-the-shared-library-path-variable-is-LD_LIBRAR.patch
deleted file mode 100644
index cbdb0b8..0000000
--- a/sys-devel/clang/files/5.0.1/extra/0001-Assume-the-shared-library-path-variable-is-LD_LIBRAR.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 5c5bb3948697f2ca184a03dedd5666eb2de547ba Mon Sep 17 00:00:00 2001
-From: Dimitry Andric <dimitry@andric.com>
-Date: Sat, 20 Jan 2018 14:34:33 +0000
-Subject: [PATCH] Assume the shared library path variable is LD_LIBRARY_PATH on
- systems except Darwin and Windows. This prevents inserting an environment
- variable with an empty name (which is illegal and leads to a Python
- exception) on any of the BSDs.
-
-git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@323040 91177308-0d34-0410-b5e6-96231b3b80d8
----
- test/Unit/lit.cfg | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg
-index fc63afdb..b40e1cae 100644
---- a/test/Unit/lit.cfg
-+++ b/test/Unit/lit.cfg
-@@ -19,13 +19,12 @@ config.test_exec_root = config.test_source_root
- # ;-separated list of subdirectories).
- config.test_format = lit.formats.GoogleTest('.', 'Tests')
-
--shlibpath_var = ''
--if platform.system() == 'Linux':
-- shlibpath_var = 'LD_LIBRARY_PATH'
--elif platform.system() == 'Darwin':
-+if platform.system() == 'Darwin':
- shlibpath_var = 'DYLD_LIBRARY_PATH'
- elif platform.system() == 'Windows':
- shlibpath_var = 'PATH'
-+else:
-+ shlibpath_var = 'LD_LIBRARY_PATH'
-
- # Point the dynamic loader at dynamic libraries in 'lib'.
- shlibpath = os.path.pathsep.join((config.shlibdir, config.llvm_libs_dir,
---
-2.17.0.rc2
-
diff --git a/sys-devel/clang/files/5.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch b/sys-devel/clang/files/5.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
deleted file mode 100644
index eeda778..0000000
--- a/sys-devel/clang/files/5.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/lib/Driver/ToolChains/Linux.cpp
-+++ b/lib/Driver/ToolChains/Linux.cpp
-@@ -210,7 +210,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-
- Distro Distro(D.getVFS());
-
-- if (Distro.IsOpenSUSE() || Distro.IsUbuntu()) {
-+ if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsGentooLinux()) {
- ExtraOpts.push_back("-z");
- ExtraOpts.push_back("relro");
- }
diff --git a/sys-devel/clang/files/5.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch b/sys-devel/clang/files/5.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
deleted file mode 100644
index 2f5faf5..0000000
--- a/sys-devel/clang/files/5.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/lib/Driver/ToolChains/Linux.cpp
-+++ b/lib/Driver/ToolChains/Linux.cpp
-@@ -820,6 +820,10 @@ bool Linux::isPIEDefault() const {
- getTriple().isMusl() || getSanitizerArgs().requiresPIE();
- }
-
-+unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const {
-+ return 2;
-+}
-+
- SanitizerMask Linux::getSupportedSanitizers() const {
- const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
- const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
-diff --git a/lib/Driver/ToolChains/Linux.h b/lib/Driver/ToolChains/Linux.h
-index 9778c1832cc..ddd46a1d587 100644
---- a/lib/Driver/ToolChains/Linux.h
-+++ b/lib/Driver/ToolChains/Linux.h
-@@ -36,6 +36,7 @@ public:
- void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs,
- llvm::opt::ArgStringList &CC1Args) const override;
- bool isPIEDefault() const override;
-+ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override;
- SanitizerMask getSupportedSanitizers() const override;
- void addProfileRTLibs(const llvm::opt::ArgList &Args,
- llvm::opt::ArgStringList &CmdArgs) const override;
diff --git a/sys-devel/clang/files/5.0.1/hardened/0003-Enable-PIE-by-default.patch b/sys-devel/clang/files/5.0.1/hardened/0003-Enable-PIE-by-default.patch
deleted file mode 100644
index 301ee11..0000000
--- a/sys-devel/clang/files/5.0.1/hardened/0003-Enable-PIE-by-default.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/lib/Driver/ToolChains/Gnu.cpp
-+++ b/lib/Driver/ToolChains/Gnu.cpp
-@@ -443,7 +443,9 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
- if (!D.SysRoot.empty())
- CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
-
-- if (IsPIE)
-+ if (Args.hasArg(options::OPT_nopie))
-+ CmdArgs.push_back("-nopie");
-+ else if (IsPIE)
- CmdArgs.push_back("-pie");
-
- if (Args.hasArg(options::OPT_rdynamic))
---- a/lib/Driver/ToolChains/Linux.cpp
-+++ b/lib/Driver/ToolChains/Linux.cpp
-@@ -819,7 +819,7 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs,
- }
- }
-
--bool Linux::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); }
-+bool Linux::isPIEDefault() const { return true; }
-
- SanitizerMask Linux::getSupportedSanitizers() const {
- const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
diff --git a/sys-devel/clang/files/5.0.1/hardened/0004-Enable-FORTIFY_SOURCE-macro-by-default.patch b/sys-devel/clang/files/5.0.1/hardened/0004-Enable-FORTIFY_SOURCE-macro-by-default.patch
deleted file mode 100644
index 410bae9..0000000
--- a/sys-devel/clang/files/5.0.1/hardened/0004-Enable-FORTIFY_SOURCE-macro-by-default.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 68d39575cdff576b85907bea8e42b7ef26384dbb Mon Sep 17 00:00:00 2001
-From: Matthias Dahl <matthias.dahl@binary-island.eu>
-Date: Wed, 20 Sep 2017 16:17:31 +0200
-Subject: [PATCH 3/3] Enable FORTIFY_SOURCE macro by default
-
-FORTIFY_SOURCE only works for optimization levels > 0 and is currently not
-compatible with the address sanitizer, thus the macro is only set if the input
-language is C or C++ and the optimization level > 0 while the address sanitizer
-is not requested.
----
- lib/Frontend/CompilerInvocation.cpp | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
-index 0d0869c815d..88c16534103 100644
---- a/lib/Frontend/CompilerInvocation.cpp
-+++ b/lib/Frontend/CompilerInvocation.cpp
-@@ -2694,6 +2694,14 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
- !LangOpts.Sanitize.has(SanitizerKind::Address) &&
- !LangOpts.Sanitize.has(SanitizerKind::Memory);
-
-+ // Set the macro before the command line macros are being processed, so it can be
-+ // properly unset if required to in case of incompatibilities.
-+ if (Res.getCodeGenOpts().OptimizationLevel > 0 &&
-+ (DashX.getLanguage() == InputKind::C || DashX.getLanguage() == InputKind::CXX) &&
-+ !LangOpts.Sanitize.has(SanitizerKind::Address)) {
-+ Res.getPreprocessorOpts().addMacroDef("_FORTIFY_SOURCE=2");
-+ }
-+
- // FIXME: ParsePreprocessorArgs uses the FileManager to read the contents of
- // PCH file and find the original header name. Remove the need to do that in
- // ParsePreprocessorArgs and remove the FileManager
---
-2.14.1
-
diff --git a/sys-devel/clang/files/5.0.1/hardened/0005-Link-with-z-now-by-default-for-Gentoo.patch b/sys-devel/clang/files/5.0.1/hardened/0005-Link-with-z-now-by-default-for-Gentoo.patch
deleted file mode 100644
index ff0642f..0000000
--- a/sys-devel/clang/files/5.0.1/hardened/0005-Link-with-z-now-by-default-for-Gentoo.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/lib/Driver/ToolChains/Linux.cpp
-+++ b/lib/Driver/ToolChains/Linux.cpp
-@@ -212,6 +212,11 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-
- Distro Distro(D.getVFS());
-
-+ if (Distro.IsGentooLinux()) {
-+ ExtraOpts.push_back("-z");
-+ ExtraOpts.push_back("now");
-+ }
-+
- if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsGentooLinux()) {
- ExtraOpts.push_back("-z");
- ExtraOpts.push_back("relro");
diff --git a/sys-devel/clang/files/5.0.1/darwin_prefix-include-paths.patch b/sys-devel/clang/files/6.0.1/darwin_prefix-include-paths.patch
index 7744b94..7744b94 100644
--- a/sys-devel/clang/files/5.0.1/darwin_prefix-include-paths.patch
+++ b/sys-devel/clang/files/6.0.1/darwin_prefix-include-paths.patch