Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: sys-devel/clang/files/4.0.1/, sys-devel/clang/, ...
Date: Fri, 03 Aug 2018 01:13:07
Message-Id: 1533258765.2ef8e38366c5f264aee458099f38bb049ae0c62f.blueness@gentoo
1 commit: 2ef8e38366c5f264aee458099f38bb049ae0c62f
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 3 01:12:45 2018 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 3 01:12:45 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=2ef8e383
7
8 sys-devel/clang: clean up older versions, sync with upstream
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 sys-devel/clang/Manifest | 16 -
13 sys-devel/clang/clang-4.0.1.ebuild | 309 -------------------
14 sys-devel/clang/clang-5.0.1.ebuild | 333 --------------------
15 sys-devel/clang/clang-5.0.2.ebuild | 333 --------------------
16 sys-devel/clang/clang-6.0.0-r1.ebuild | 337 ---------------------
17 sys-devel/clang/clang-6.0.1.ebuild | 4 +-
18 ...rrect-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch | 87 ------
19 ...port-stand-alone-Sphinx-doxygen-doc-build.patch | 64 ----
20 .../files/4.0.1/0003-Add-Gentoo-Linux-distro.patch | 32 --
21 ...st-dependencies-when-using-installed-tool.patch | 48 ---
22 ...ang-library-dir-in-LD_LIBRARY_PATH-For-st.patch | 83 -----
23 .../hardened/0001-Use-z-relro-on-Gentoo.patch | 11 -
24 .../0002-Enable-Stack-Protector-by-default.patch | 23 --
25 .../hardened/0003-Enable-PIE-by-default.patch | 26 --
26 ...004-Link-with-z-now-by-default-for-Gentoo.patch | 14 -
27 ...arch-type-to-find-compiler-rt-libraries-o.patch | 136 ---------
28 ...est-Fix-clang-test-for-FreeBSD-and-NetBSD.patch | 76 -----
29 .../files/5.0.1/0003-Add-Gentoo-Linux-distro.patch | 33 --
30 ...shared-library-path-variable-is-LD_LIBRAR.patch | 37 ---
31 .../hardened/0001-Use-z-relro-on-Gentoo.patch | 11 -
32 .../0002-Enable-Stack-Protector-by-default.patch | 25 --
33 .../hardened/0003-Enable-PIE-by-default.patch | 24 --
34 ...04-Enable-FORTIFY_SOURCE-macro-by-default.patch | 35 ---
35 ...005-Link-with-z-now-by-default-for-Gentoo.patch | 14 -
36 .../darwin_prefix-include-paths.patch | 0
37 25 files changed, 2 insertions(+), 2109 deletions(-)
38
39 diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest
40 index abed5a7..6abbf06 100644
41 --- a/sys-devel/clang/Manifest
42 +++ b/sys-devel/clang/Manifest
43 @@ -1,20 +1,4 @@
44 -DIST cfe-4.0.1.src.tar.xz 10933628 BLAKE2B bc1bb8875e83ccecd446a48cfa41f5c98a09d6ad24ff439a983f629711b4513b9c4bee4070f8df13b6b2a52d673b0706733a4c151ce5021a0233147debff14ac SHA512 936c9e1626b27e63a4fb11f3c0cb998eeaf9a520ad6e2bcd67cb4352e59e7781ecc700df79794f3fd70473d90b7e2ba418a39038eb0146b68e843f0705c1f964
45 -DIST cfe-5.0.1.src.tar.xz 11483036 BLAKE2B c4eb54cd8271b62cf7a2219db0b599b68c00b6e574d1946220efbd1633e841796e6717d6eeb35e84a6db32a731a3285b59cedeb3b1a8f3c3c502b799fdd0a720 SHA512 6619177a2ff9934fe8b15d6aa229abb8e34d0b1a75228d9efba9393daf71d6419a7256de57b31e2f9f829f71f842118556f996e86ee076f1e0a7cd394dfd31a2
46 -DIST cfe-5.0.2.src.tar.xz 11459216 BLAKE2B 80d9b2ab70b00c0dfd5c5386a44e0c15d8252e6175c9da55a0519c4f9b8192e32e215110d7d3808225786e2c7f906f2dfbe11dd09bdf21574e99709ae237ed0b SHA512 9931afceb5569ad6caec85d506180c810f7fea94af8c997143b0a37cbf413fcea0d92520478610627eeee1efb65fde684066ace0dfcbbf7b61ecd709d22dd0b1
47 -DIST cfe-6.0.0.src.tar.xz 11959224 BLAKE2B 257edbaedf72bd941b67b4aa2f152a96a37bbea72d21d22d4445152685efe40d75b9a7a39955545643e841ad6693ef12e52b207b9119098774f39e858b64bc09 SHA512 e886dd27448503bbfc7fd4f68eb089c19b2f2be4f0e5b26d3df253833f60b91d70b472a6b530063386e2252075b110ce9f5942800feddf6c34b94a75cf7bd5c6
48 DIST cfe-6.0.1.src.tar.xz 11905772 BLAKE2B abb60e9f9827d1d8a24f0aaf8a1d1e32979293cc401258d230f93290e633645747fd0344af189ac7081b06be2cada503364e1e432b37110ade4b3578e40c7605 SHA512 f64ba9290059f6e36fee41c8f32bf483609d31c291fcd2f77d41fecfdf3c8233a5e23b93a1c73fed03683823bd6e72757ed993dd32527de3d5f2b7a64bb031b9
49 -DIST clang-tools-extra-4.0.1.src.tar.xz 581788 BLAKE2B 52ca89eda6fe1e0fbbdc46e17f4067f03a9a9440dcdcc98811651087d0c9ab24dfe3eefb0b80a32ec41abe0766cb3e47031de61c4cff02b7d0e08c8fd03e3faa SHA512 ea26d926f428e62e76cf8a073e63ffe05645f6592e05d7717d5c257908870ae9217727d3e1578227b14eda5937085872463f1a8e99970256179c68b8a92e69e0
50 -DIST clang-tools-extra-5.0.1.src.tar.xz 646328 BLAKE2B 472eb1e73a17564790919ec392dddcd91f131c1cbf2a5f3cab09a9f7126d4d18ec6785ffcb3c3230eec6edc90acbe2bf859367c37f62ba77d7542f4c18b925f3 SHA512 2e6a811cccd22281f7567f5626ff0484ed1fefee4a9244a717e3ccb9516dce9e7ff315044fb10e505e91c3f1c6d2774558debb9559915d053886599bcb153d7b
51 -DIST clang-tools-extra-5.0.2.src.tar.xz 646272 BLAKE2B 8a15a0c3ed9e8c31706d744017aa8be52616037790075c2314c3a613c9e1aa86b0b980c4e3bd9a775b234440f17436392196b41f1691ab25a33b432a25affb68 SHA512 241d85652e7c3ad5d77754ad9a694bddab3c14098067da4119223007c5a4a765d1cd7e7c7dba91666ccd5506f8703c82c9ee487f28249a00c2c4edbd0d1f2640
52 -DIST clang-tools-extra-6.0.0.src.tar.xz 757680 BLAKE2B 708e21055a702c41a94f6b8673bab405f8b1339a75ec66f14c31565ef802245900bafc25e636c6e82f01e74060a6429a19442317f948011cae59af6825808343 SHA512 9c5720b8694c235ca988ef45da1d564ac06e31c0a40600b32c0b9df399693e4eba296ca43b077ed97adba085362ddb0fb94e0d28232afc3e7351820b1285061f
53 DIST clang-tools-extra-6.0.1.src.tar.xz 757256 BLAKE2B 1d91d7459a34e7251007af91db1803ee6d04f1ef3e0fcf134a7e0d1d3456b094a80339ee60db3f0bdd12961f3a05caee7edfc5c6b9c48d49cd55a5dc3c102c3a SHA512 cf29d117b6dabcb7a8e5f6dab5016ce5a5c8f475679001a43fd5c935f2c368f37cdef50aae2080a1e4524f647f6d83458d4a5dec5b45d03fb374f463caf7c3f5
54 -DIST llvm-4.0.1.src.tar.xz 21065652 BLAKE2B 6327eed2d1feb108440f22d2581d1ff86c10a10c29793538d8d899c7e2dc83d3f7b147d3fd4bcce2bd2bf57c071b08c624aeafe40a3e7a3914506e7751727e6c SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d
55 -DIST llvm-5.0.1-manpages.tar.bz2 94004 BLAKE2B 34eb29361ad7aa881e64d1dd2992fd89ce44adafd2521284c27b6ffe7082bc7e70458204e6f34d582b704bf7c5dad93c6a6dc41fc7abc41862aab8f5ec53ed07 SHA512 3444cc8e06009f5dd2669b92af662a1049d9294c8ca0dcf45486e1dc1aaf10160860b7856d30ad70bbe5864b21d1539316e89f5237549f5653954e23baf64334
56 -DIST llvm-5.0.1.src.tar.xz 23428720 BLAKE2B 3db4d33df21018d17eef0042c0d8d82a8412bd5daa99cfb5405a6ec83c5774178fa76b220e8731c2a9a64dabf898aa90fe29c685327bd63a4f078e8e94a9a77e SHA512 bee1d45fca15ce725b1f2b1339b13eb6f750a3a321cfd099075477ec25835a8ca55b5366172c4aad46592dfd8afe372349ecf264f581463d017f9cee2d63c1cb
57 -DIST llvm-5.0.2-manpages.tar.bz2 93977 BLAKE2B 8c5e8899e0df9d6037fb7d5c373de6492ccdc9fd2c26cc7dfbd8fb2b9e68418ca8fdf42cdc303c361e649cc6939bf5229cbad017bdccbd5d791e92752328252f SHA512 568615bce5a75d42e4b6d592557472d366d49a99f8e81be10ae679804f1fe674c7fd0bbdac09af44fc67ee5aa34c4ed2153c2767c536ac8e45dd15c811c92dcb
58 -DIST llvm-5.0.2.src.tar.xz 23451868 BLAKE2B b7082be2e4ad557b29b9f6869811f262adcf5c73d552faf91b339bede75cf5eab58afefa12fa779a38be71fe2b8f4ea297c3213ee4e8370cc01972c59249d91c SHA512 3588be5ed969c3f7f6f16f56a12a6af2814d3d3c960d4a36ffebb0446cc75f19220bccee7fc605f9b01f5d5c188a905a046193cc12dec42dd5922048b5c27fe1
59 -DIST llvm-6.0.0-manpages.tar.bz2 102668 BLAKE2B f458cbfcfdd6600f90f9bbe8cd9681de3dc11c62dbfcaa5ba7a281ad30d6367c33bebd5090c255e85a10b00b7bcb9c988d340b67f1db51982f55956acba109e9 SHA512 a7ed3e246e6488254f19dbb8484c079be39bc52f9b2fab3f736dd013683b7f46e8e036ee571dec5066c86ee7c25713608a2426555e8ad04b81891912314ee48e
60 -DIST llvm-6.0.0.src.tar.xz 25296048 BLAKE2B 7ea90bb63d6f26cfbc1c1ed2f243b0fcd8ad2ceb7963cf768d262cd55e9a0c71a9cfdea0333fb220faacf4540d924d2512532774dcfb52b52490ad74e38c09e0 SHA512 a71fdd5ddc46f01327ad891cfcc198febdbe10769c57f14d8a4fb7d514621ee4080e1a641200d3353c16a16731d390270499ec6cd3dc98fadc570f3eb6b52b8c
61 DIST llvm-6.0.1-manpages.tar.bz2 102656 BLAKE2B 9088ca0bdda69f63354e61b7495df54505d5db2504bc61860a7260343722ec8cdd5e937d0843263a5bf5077b9cf386c337fa127039b996bab10d2ca5c2caeb59 SHA512 c468e97a2d5610aee9e72cb795e4e65375a079d733550f05380230fb44ba0ed67d407ad06e2340b66f13d19c06583b657e8d01fcdca2146ae43964cea309e0b3
62 DIST llvm-6.0.1.src.tar.xz 25306628 BLAKE2B 60232d4d22f8096b565cc8d81fea0639f24f14e8fc4f66ade69fa15479181f07f655f26dff3fa24bf105762b495da316c5c9352db234bd0af6b9c3fff6d4d881 SHA512 cbbb00eb99cfeb4aff623ee1a5ba075e7b5a76fc00c5f9f539ff28c108598f5708a0369d5bd92683def5a20c2fe60cab7827b42d628dbfcc79b57e0e91b84dd9
63 -DIST llvm-manpages-4.0.1.tar.bz2 87981 BLAKE2B 79ffd254ee5c6e09159c954913ef820f74107d4fcea5e3ed82592dc36af8fdfbf1e850547ba8bfc20aa9a5ecdd26c50329e6a6d558ae3aa5475a930789ce3e01 SHA512 d5b3213567c25db58ef364d272314a79c311a80fc21d98c09a5540af45a8190a38f489228663fe9a9b63bf0f2b952c460c4196a8fc8d6f221619f6e7ed2fc415
64
65 diff --git a/sys-devel/clang/clang-4.0.1.ebuild b/sys-devel/clang/clang-4.0.1.ebuild
66 deleted file mode 100644
67 index edb31a7..0000000
68 --- a/sys-devel/clang/clang-4.0.1.ebuild
69 +++ /dev/null
70 @@ -1,309 +0,0 @@
71 -# Copyright 1999-2018 Gentoo Foundation
72 -# Distributed under the terms of the GNU General Public License v2
73 -
74 -EAPI=6
75 -
76 -: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
77 -# (needed due to CMAKE_BUILD_TYPE != Gentoo)
78 -CMAKE_MIN_VERSION=3.7.0-r1
79 -PYTHON_COMPAT=( python2_7 )
80 -
81 -inherit cmake-utils flag-o-matic llvm multilib-minimal \
82 - python-single-r1 toolchain-funcs pax-utils versionator
83 -
84 -DESCRIPTION="C language family frontend for LLVM"
85 -HOMEPAGE="https://llvm.org/"
86 -SRC_URI="https://releases.llvm.org/${PV/_//}/cfe-${PV/_/}.src.tar.xz
87 - https://releases.llvm.org/${PV/_//}/clang-tools-extra-${PV/_/}.src.tar.xz
88 - !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-manpages-${PV}.tar.bz2 )
89 - test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
90 -
91 -# Keep in sync with sys-devel/llvm
92 -ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
93 - NVPTX PowerPC RISCV Sparc SystemZ X86 XCore )
94 -ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
95 -LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
96 -
97 -LICENSE="UoI-NCSA"
98 -SLOT="$(get_major_version)"
99 -KEYWORDS="amd64 ~arm64 x86"
100 -IUSE="debug default-compiler-rt default-libcxx doc hardened +static-analyzer
101 - test xml elibc_musl kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
102 -
103 -RDEPEND="
104 - ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
105 - static-analyzer? ( dev-lang/perl:* )
106 - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
107 - ${PYTHON_DEPS}"
108 -# configparser-3.2 breaks the build (3.3 or none at all are fine)
109 -DEPEND="${RDEPEND}
110 - doc? ( dev-python/sphinx )
111 - xml? ( virtual/pkgconfig )
112 - !!<dev-python/configparser-3.3.0.2
113 - ${PYTHON_DEPS}"
114 -RDEPEND="${RDEPEND}
115 - !<sys-devel/llvm-4.0.0_rc:0
116 - !sys-devel/clang:0"
117 -PDEPEND="
118 - ~sys-devel/clang-runtime-${PV}
119 - default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
120 - default-libcxx? ( >=sys-libs/libcxx-${PV} )"
121 -
122 -REQUIRED_USE="${PYTHON_REQUIRED_USE}
123 - || ( ${ALL_LLVM_TARGETS[*]} )"
124 -
125 -# We need extra level of indirection for CLANG_RESOURCE_DIR
126 -S=${WORKDIR}/x/y/cfe-${PV/_/}.src
127 -
128 -# least intrusive of all
129 -CMAKE_BUILD_TYPE=RelWithDebInfo
130 -
131 -# Multilib notes:
132 -# 1. ABI_* flags control ABIs libclang* is built for only.
133 -# 2. clang is always capable of compiling code for all ABIs for enabled
134 -# target. However, you will need appropriate crt* files (installed
135 -# e.g. by sys-devel/gcc and sys-libs/glibc).
136 -# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
137 -# in the current profile (i.e. alike supported by sys-devel/gcc).
138 -#
139 -# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
140 -# multilib clang* libraries (not runtime, not wrappers).
141 -
142 -pkg_setup() {
143 - LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
144 - python-single-r1_pkg_setup
145 -}
146 -
147 -src_unpack() {
148 - # create extra parent dirs for CLANG_RESOURCE_DIR
149 - mkdir -p x/y || die
150 - cd x/y || die
151 -
152 - default
153 -
154 - mv clang-tools-extra-*.src "${S}"/tools/extra || die
155 - if use test; then
156 - mv llvm-*.src "${WORKDIR}"/llvm || die
157 - fi
158 -}
159 -
160 -src_prepare() {
161 - # fix finding compiler-rt libs
162 - eapply "${FILESDIR}"/5.0.1/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
163 -
164 - # fix stand-alone doc build
165 - eapply "${FILESDIR}"/4.0.1/0002-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
166 -
167 - # fix value of ATOMIC_*_LOCK_FREE
168 - # (backport, temporary reverted upstream because of FreeBSD issues)
169 - eapply "${FILESDIR}"/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
170 -
171 - # only used in hardened patches at the moment
172 - eapply "${FILESDIR}"/4.0.1/0003-Add-Gentoo-Linux-distro.patch
173 -
174 - cd tools/extra || die
175 - # fix stand-alone test build for extra tools
176 - eapply "${FILESDIR}"/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
177 - eapply "${FILESDIR}"/4.0.1/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
178 - cd - >/dev/null || die
179 -
180 - if use hardened; then
181 - eapply "${FILESDIR}"/4.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
182 - eapply "${FILESDIR}"/4.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
183 - eapply "${FILESDIR}"/4.0.1/hardened/0003-Enable-PIE-by-default.patch
184 - eapply "${FILESDIR}"/4.0.1/hardened/0004-Link-with-z-now-by-default-for-Gentoo.patch
185 - fi
186 -
187 - # User patches
188 - cmake-utils_src_prepare
189 -}
190 -
191 -multilib_src_configure() {
192 - local llvm_version=$(llvm-config --version) || die
193 - local clang_version=$(get_version_component_range 1-3 "${llvm_version}")
194 -
195 - local mycmakeargs=(
196 - # ensure that the correct llvm-config is used
197 - -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
198 - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
199 - -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
200 - # relative to bindir
201 - -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
202 -
203 - -DBUILD_SHARED_LIBS=ON
204 - -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
205 - -DLLVM_BUILD_TESTS=$(usex test)
206 -
207 - # these are not propagated reliably, so redefine them
208 - -DLLVM_ENABLE_EH=ON
209 - -DLLVM_ENABLE_RTTI=ON
210 -
211 - -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
212 - # libgomp support fails to find headers without explicit -I
213 - # furthermore, it provides only syntax checking
214 - -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
215 -
216 - # override default stdlib and rtlib
217 - -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
218 - -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
219 -
220 - -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
221 - -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
222 - )
223 - use test && mycmakeargs+=(
224 - -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
225 - )
226 -
227 - if multilib_is_native_abi; then
228 - mycmakeargs+=(
229 - -DLLVM_BUILD_DOCS=$(usex doc)
230 - -DLLVM_ENABLE_SPHINX=$(usex doc)
231 - -DLLVM_ENABLE_DOXYGEN=OFF
232 -
233 - # workaround pthread
234 - -DPTHREAD_LIB=-pthread
235 - )
236 - use doc && mycmakeargs+=(
237 - -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
238 - -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
239 - -DSPHINX_WARNINGS_AS_ERRORS=OFF
240 - )
241 - else
242 - mycmakeargs+=(
243 - -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
244 - )
245 - fi
246 -
247 - if [[ -n ${EPREFIX} ]]; then
248 - mycmakeargs+=(
249 - -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
250 - )
251 - fi
252 -
253 - if tc-is-cross-compiler; then
254 - [[ -x "/usr/bin/clang-tblgen" ]] \
255 - || die "/usr/bin/clang-tblgen not found or usable"
256 - mycmakeargs+=(
257 - -DCMAKE_CROSSCOMPILING=ON
258 - -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
259 - )
260 - fi
261 -
262 - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
263 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
264 - cmake-utils_src_configure
265 -}
266 -
267 -multilib_src_compile() {
268 - cmake-utils_src_compile
269 -
270 - # provide a symlink for tests
271 - if [[ ! -L ${WORKDIR}/lib/clang ]]; then
272 - mkdir -p "${WORKDIR}"/lib || die
273 - ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
274 - fi
275 -}
276 -
277 -multilib_src_test() {
278 - # respect TMPDIR!
279 - local -x LIT_PRESERVES_TMP=1
280 - cmake-utils_src_make check-clang
281 - # clang-tidy requires [static-analyzer] and tests are not split
282 - # correctly, so they are all disabled when static-analyzer is off
283 - if multilib_is_native_abi && use static-analyzer; then
284 - cmake-utils_src_make check-clang-tools
285 - fi
286 -}
287 -
288 -src_install() {
289 - MULTILIB_WRAPPED_HEADERS=(
290 - /usr/include/clang/Config/config.h
291 - )
292 -
293 - multilib-minimal_src_install
294 -
295 - # Move runtime headers to /usr/lib/clang, where they belong
296 - mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
297 - # move (remaining) wrapped headers back
298 - mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
299 -
300 - # Apply CHOST and version suffix to clang tools
301 - # note: we use two version components here (vs 3 in runtime path)
302 - local llvm_version=$(llvm-config --version) || die
303 - local clang_version=$(get_version_component_range 1-2 "${llvm_version}")
304 - local clang_full_version=$(get_version_component_range 1-3 "${llvm_version}")
305 - local clang_tools=( clang clang++ clang-cl clang-cpp )
306 - local abi i
307 -
308 - # cmake gives us:
309 - # - clang-X.Y
310 - # - clang -> clang-X.Y
311 - # - clang++, clang-cl, clang-cpp -> clang
312 - # we want to have:
313 - # - clang-X.Y
314 - # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
315 - # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
316 - # also in CHOST variant
317 - for i in "${clang_tools[@]:1}"; do
318 - rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
319 - dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
320 - dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
321 - done
322 -
323 - # now create target symlinks for all supported ABIs
324 - for abi in $(get_all_abis); do
325 - local abi_chost=$(get_abi_CHOST "${abi}")
326 - for i in "${clang_tools[@]}"; do
327 - dosym "${i}-${clang_version}" \
328 - "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
329 - dosym "${abi_chost}-${i}-${clang_version}" \
330 - "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
331 - done
332 - done
333 -
334 - # Remove unnecessary headers on FreeBSD, bug #417171
335 - if use kernel_FreeBSD; then
336 - rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
337 - fi
338 -}
339 -
340 -multilib_src_install() {
341 - cmake-utils_src_install
342 -
343 - # move headers to /usr/include for wrapping & ABI mismatch checks
344 - # (also drop the version suffix from runtime headers)
345 - rm -rf "${ED%/}"/usr/include || die
346 - mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
347 - mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
348 -}
349 -
350 -multilib_src_install_all() {
351 - python_fix_shebang "${ED}"
352 - if use static-analyzer; then
353 - python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
354 - fi
355 -
356 - # install pre-generated manpages
357 - if ! use doc; then
358 - insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
359 - doins "${WORKDIR}/x/y/llvm-manpages-${PV}/clang"/*.1
360 - fi
361 -
362 - docompress "/usr/lib/llvm/${SLOT}/share/man"
363 - # match 'html' non-compression
364 - use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
365 - # +x for some reason; TODO: investigate
366 - use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
367 -}
368 -
369 -pkg_postinst() {
370 - if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
371 - eselect compiler-shadow update all
372 - fi
373 -}
374 -
375 -pkg_postrm() {
376 - if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
377 - eselect compiler-shadow clean all
378 - fi
379 -}
380
381 diff --git a/sys-devel/clang/clang-5.0.1.ebuild b/sys-devel/clang/clang-5.0.1.ebuild
382 deleted file mode 100644
383 index 326b27e..0000000
384 --- a/sys-devel/clang/clang-5.0.1.ebuild
385 +++ /dev/null
386 @@ -1,333 +0,0 @@
387 -# Copyright 1999-2018 Gentoo Foundation
388 -# Distributed under the terms of the GNU General Public License v2
389 -
390 -EAPI=6
391 -
392 -: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
393 -# (needed due to CMAKE_BUILD_TYPE != Gentoo)
394 -CMAKE_MIN_VERSION=3.7.0-r1
395 -PYTHON_COMPAT=( python2_7 )
396 -
397 -inherit cmake-utils eapi7-ver flag-o-matic llvm \
398 - multilib-minimal pax-utils prefix python-single-r1 toolchain-funcs
399 -
400 -MY_P=cfe-${PV/_/}.src
401 -EXTRA_P=clang-tools-extra-${PV/_/}.src
402 -LLVM_P=llvm-${PV/_/}.src
403 -
404 -DESCRIPTION="C language family frontend for LLVM"
405 -HOMEPAGE="https://llvm.org/"
406 -SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz
407 - https://releases.llvm.org/${PV/_//}/${EXTRA_P}.tar.xz
408 - test? ( https://releases.llvm.org/${PV/_//}/${LLVM_P}.tar.xz )
409 - !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-${PV}-manpages.tar.bz2 )"
410 -
411 -# Keep in sync with sys-devel/llvm
412 -ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
413 - NVPTX PowerPC Sparc SystemZ X86 XCore )
414 -ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
415 -LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
416 -
417 -LICENSE="UoI-NCSA"
418 -SLOT="$(ver_cut 1)"
419 -KEYWORDS="amd64 ~arm64 x86 ~amd64-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
420 -IUSE="debug default-compiler-rt default-libcxx doc hardened +static-analyzer
421 - test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
422 -
423 -RDEPEND="
424 - ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
425 - static-analyzer? (
426 - dev-lang/perl:*
427 - z3? ( sci-mathematics/z3:0= )
428 - )
429 - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
430 - ${PYTHON_DEPS}"
431 -# configparser-3.2 breaks the build (3.3 or none at all are fine)
432 -DEPEND="${RDEPEND}
433 - doc? ( dev-python/sphinx )
434 - xml? ( virtual/pkgconfig )
435 - !!<dev-python/configparser-3.3.0.2
436 - ${PYTHON_DEPS}"
437 -RDEPEND="${RDEPEND}
438 - !<sys-devel/llvm-4.0.0_rc:0
439 - !sys-devel/clang:0"
440 -PDEPEND="
441 - ~sys-devel/clang-runtime-${PV}
442 - default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
443 - default-libcxx? ( >=sys-libs/libcxx-${PV} )"
444 -
445 -REQUIRED_USE="${PYTHON_REQUIRED_USE}
446 - || ( ${ALL_LLVM_TARGETS[*]} )"
447 -
448 -# We need extra level of indirection for CLANG_RESOURCE_DIR
449 -S=${WORKDIR}/x/y/${MY_P}
450 -
451 -# least intrusive of all
452 -CMAKE_BUILD_TYPE=RelWithDebInfo
453 -
454 -# Multilib notes:
455 -# 1. ABI_* flags control ABIs libclang* is built for only.
456 -# 2. clang is always capable of compiling code for all ABIs for enabled
457 -# target. However, you will need appropriate crt* files (installed
458 -# e.g. by sys-devel/gcc and sys-libs/glibc).
459 -# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
460 -# in the current profile (i.e. alike supported by sys-devel/gcc).
461 -#
462 -# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
463 -# multilib clang* libraries (not runtime, not wrappers).
464 -
465 -pkg_setup() {
466 - LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
467 - python-single-r1_pkg_setup
468 -}
469 -
470 -src_unpack() {
471 - # create extra parent dir for CLANG_RESOURCE_DIR
472 - mkdir -p x/y || die
473 - cd x/y || die
474 -
475 - einfo "Unpacking ${MY_P}.tar.xz ..."
476 - tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die
477 - einfo "Unpacking ${EXTRA_P}.tar.xz ..."
478 - tar -xf "${DISTDIR}/${EXTRA_P}.tar.xz" || die
479 -
480 - mv "${EXTRA_P}" "${S}"/tools/extra || die
481 - if use test; then
482 - einfo "Unpacking parts of ${LLVM_P}.tar.xz ..."
483 - tar -xf "${DISTDIR}/${LLVM_P}.tar.xz" \
484 - "${LLVM_P}"/utils/{lit,unittest} || die
485 - mv "${LLVM_P}" "${WORKDIR}"/llvm || die
486 - fi
487 -
488 - if ! use doc; then
489 - einfo "Unpacking llvm-${PV}-manpages.tar.bz2 ..."
490 - tar -xf "${DISTDIR}/llvm-${PV}-manpages.tar.bz2" || die
491 - fi
492 -}
493 -
494 -src_prepare() {
495 - # fix finding compiler-rt libs
496 - eapply "${FILESDIR}"/5.0.1/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
497 - # fix setting LD_LIBRARY_PATH for tests on *BSD
498 - eapply "${FILESDIR}"/5.0.1/0002-test-Fix-clang-test-for-FreeBSD-and-NetBSD.patch
499 - # add Prefix include paths for Darwin
500 - eapply "${FILESDIR}"/5.0.1/darwin_prefix-include-paths.patch
501 - # only used in hardened patches at the moment
502 - eapply "${FILESDIR}"/5.0.1/0003-Add-Gentoo-Linux-distro.patch
503 -
504 - cd tools/extra || die
505 - # fix setting LD_LIBRARY_PATH for tests on *BSD (extra part)
506 - eapply "${FILESDIR}"/5.0.1/extra/0001-Assume-the-shared-library-path-variable-is-LD_LIBRAR.patch
507 - cd ../.. || die
508 -
509 - if use hardened; then
510 - eapply "${FILESDIR}"/5.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
511 - eapply "${FILESDIR}"/5.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
512 - eapply "${FILESDIR}"/5.0.1/hardened/0003-Enable-PIE-by-default.patch
513 - eapply "${FILESDIR}"/5.0.1/hardened/0004-Enable-FORTIFY_SOURCE-macro-by-default.patch
514 - eapply "${FILESDIR}"/5.0.1/hardened/0005-Link-with-z-now-by-default-for-Gentoo.patch
515 - fi
516 -
517 - cmake-utils_src_prepare
518 - eprefixify lib/Frontend/InitHeaderSearch.cpp
519 -}
520 -
521 -multilib_src_configure() {
522 - local llvm_version=$(llvm-config --version) || die
523 - local clang_version=$(ver_cut 1-3 "${llvm_version}")
524 -
525 - local mycmakeargs=(
526 - # ensure that the correct llvm-config is used
527 - -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
528 - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
529 - -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
530 - # relative to bindir
531 - -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
532 -
533 - -DBUILD_SHARED_LIBS=ON
534 - -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
535 - -DLLVM_BUILD_TESTS=$(usex test)
536 -
537 - # these are not propagated reliably, so redefine them
538 - -DLLVM_ENABLE_EH=ON
539 - -DLLVM_ENABLE_RTTI=ON
540 -
541 - -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
542 - # libgomp support fails to find headers without explicit -I
543 - # furthermore, it provides only syntax checking
544 - -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
545 -
546 - # override default stdlib and rtlib
547 - -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
548 - -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
549 -
550 - -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
551 - -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
552 - # z3 is not multilib-friendly
553 - -DCLANG_ANALYZER_BUILD_Z3=$(multilib_native_usex z3)
554 - )
555 - use test && mycmakeargs+=(
556 - -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
557 - )
558 -
559 - if multilib_is_native_abi; then
560 - mycmakeargs+=(
561 - # normally copied from LLVM_INCLUDE_DOCS but the latter
562 - # is lacking value in stand-alone builds
563 - -DCLANG_INCLUDE_DOCS=$(usex doc)
564 - -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=$(usex doc)
565 - )
566 - use doc && mycmakeargs+=(
567 - -DLLVM_BUILD_DOCS=ON
568 - -DLLVM_ENABLE_SPHINX=ON
569 - -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
570 - -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
571 - -DSPHINX_WARNINGS_AS_ERRORS=OFF
572 - )
573 - use z3 && mycmakeargs+=(
574 - -DZ3_INCLUDE_DIR="${EPREFIX}/usr/include/z3"
575 - )
576 - else
577 - mycmakeargs+=(
578 - -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
579 - )
580 - fi
581 -
582 - if [[ -n ${EPREFIX} ]]; then
583 - mycmakeargs+=(
584 - -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
585 - )
586 - fi
587 -
588 - if tc-is-cross-compiler; then
589 - [[ -x "/usr/bin/clang-tblgen" ]] \
590 - || die "/usr/bin/clang-tblgen not found or usable"
591 - mycmakeargs+=(
592 - -DCMAKE_CROSSCOMPILING=ON
593 - -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
594 - )
595 - fi
596 -
597 - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
598 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
599 - cmake-utils_src_configure
600 -}
601 -
602 -multilib_src_compile() {
603 - cmake-utils_src_compile
604 -
605 - # provide a symlink for tests
606 - if [[ ! -L ${WORKDIR}/lib/clang ]]; then
607 - mkdir -p "${WORKDIR}"/lib || die
608 - ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
609 - fi
610 -}
611 -
612 -multilib_src_test() {
613 - # respect TMPDIR!
614 - local -x LIT_PRESERVES_TMP=1
615 - cmake-utils_src_make check-clang
616 - # clang-tidy requires [static-analyzer] and tests are not split
617 - # correctly, so they are all disabled when static-analyzer is off
618 - if multilib_is_native_abi && use static-analyzer; then
619 - cmake-utils_src_make check-clang-tools
620 - fi
621 -}
622 -
623 -src_install() {
624 - MULTILIB_WRAPPED_HEADERS=(
625 - /usr/include/clang/Config/config.h
626 - )
627 -
628 - multilib-minimal_src_install
629 -
630 - # Move runtime headers to /usr/lib/clang, where they belong
631 - mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
632 - # move (remaining) wrapped headers back
633 - mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
634 -
635 - # Apply CHOST and version suffix to clang tools
636 - # note: we use two version components here (vs 3 in runtime path)
637 - local llvm_version=$(llvm-config --version) || die
638 - local clang_version=$(ver_cut 1-2 "${llvm_version}")
639 - local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
640 - local clang_tools=( clang clang++ clang-cl clang-cpp )
641 - local abi i
642 -
643 - # cmake gives us:
644 - # - clang-X.Y
645 - # - clang -> clang-X.Y
646 - # - clang++, clang-cl, clang-cpp -> clang
647 - # we want to have:
648 - # - clang-X.Y
649 - # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
650 - # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
651 - # also in CHOST variant
652 - for i in "${clang_tools[@]:1}"; do
653 - rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
654 - dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
655 - dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
656 - done
657 -
658 - # now create target symlinks for all supported ABIs
659 - for abi in $(get_all_abis); do
660 - local abi_chost=$(get_abi_CHOST "${abi}")
661 - for i in "${clang_tools[@]}"; do
662 - dosym "${i}-${clang_version}" \
663 - "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
664 - dosym "${abi_chost}-${i}-${clang_version}" \
665 - "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
666 - done
667 - done
668 -
669 - # Remove unnecessary headers on FreeBSD, bug #417171
670 - if use kernel_FreeBSD; then
671 - rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
672 - fi
673 -}
674 -
675 -multilib_src_install() {
676 - cmake-utils_src_install
677 -
678 - # move headers to /usr/include for wrapping & ABI mismatch checks
679 - # (also drop the version suffix from runtime headers)
680 - rm -rf "${ED%/}"/usr/include || die
681 - mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
682 - mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
683 -}
684 -
685 -multilib_src_install_all() {
686 - python_fix_shebang "${ED}"
687 - if use static-analyzer; then
688 - python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
689 - fi
690 -
691 - # install pre-generated manpages
692 - if ! use doc; then
693 - insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
694 - doins "${WORKDIR}/x/y/llvm-${PV}-manpages/clang"/*.1
695 - fi
696 -
697 - docompress "/usr/lib/llvm/${SLOT}/share/man"
698 - # match 'html' non-compression
699 - use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
700 - # +x for some reason; TODO: investigate
701 - use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
702 -}
703 -
704 -pkg_postinst() {
705 - if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
706 - eselect compiler-shadow update all
707 - fi
708 -
709 - elog "You can find additional utility scripts in:"
710 - elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
711 - elog "To use these scripts, you will need Python 2.7. Some of them are vim"
712 - elog "integration scripts (with instructions inside)."
713 -}
714 -
715 -pkg_postrm() {
716 - if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
717 - eselect compiler-shadow clean all
718 - fi
719 -}
720
721 diff --git a/sys-devel/clang/clang-5.0.2.ebuild b/sys-devel/clang/clang-5.0.2.ebuild
722 deleted file mode 100644
723 index dd73691..0000000
724 --- a/sys-devel/clang/clang-5.0.2.ebuild
725 +++ /dev/null
726 @@ -1,333 +0,0 @@
727 -# Copyright 1999-2018 Gentoo Foundation
728 -# Distributed under the terms of the GNU General Public License v2
729 -
730 -EAPI=6
731 -
732 -: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
733 -# (needed due to CMAKE_BUILD_TYPE != Gentoo)
734 -CMAKE_MIN_VERSION=3.7.0-r1
735 -PYTHON_COMPAT=( python2_7 )
736 -
737 -inherit cmake-utils eapi7-ver flag-o-matic llvm \
738 - multilib-minimal pax-utils prefix python-single-r1 toolchain-funcs
739 -
740 -MY_P=cfe-${PV/_/}.src
741 -EXTRA_P=clang-tools-extra-${PV/_/}.src
742 -LLVM_P=llvm-${PV/_/}.src
743 -
744 -DESCRIPTION="C language family frontend for LLVM"
745 -HOMEPAGE="https://llvm.org/"
746 -SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz
747 - https://releases.llvm.org/${PV/_//}/${EXTRA_P}.tar.xz
748 - test? ( https://releases.llvm.org/${PV/_//}/${LLVM_P}.tar.xz )
749 - !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-${PV}-manpages.tar.bz2 )"
750 -
751 -# Keep in sync with sys-devel/llvm
752 -ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
753 - NVPTX PowerPC Sparc SystemZ X86 XCore )
754 -ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
755 -LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
756 -
757 -LICENSE="UoI-NCSA"
758 -SLOT="$(ver_cut 1)"
759 -KEYWORDS="amd64 ~arm64 ~ppc64 x86 ~amd64-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
760 -IUSE="debug default-compiler-rt default-libcxx doc hardened +static-analyzer
761 - test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
762 -
763 -RDEPEND="
764 - ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
765 - static-analyzer? (
766 - dev-lang/perl:*
767 - z3? ( sci-mathematics/z3:0= )
768 - )
769 - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
770 - ${PYTHON_DEPS}"
771 -# configparser-3.2 breaks the build (3.3 or none at all are fine)
772 -DEPEND="${RDEPEND}
773 - doc? ( dev-python/sphinx )
774 - xml? ( virtual/pkgconfig )
775 - !!<dev-python/configparser-3.3.0.2
776 - ${PYTHON_DEPS}"
777 -RDEPEND="${RDEPEND}
778 - !<sys-devel/llvm-4.0.0_rc:0
779 - !sys-devel/clang:0"
780 -PDEPEND="
781 - ~sys-devel/clang-runtime-${PV}
782 - default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
783 - default-libcxx? ( >=sys-libs/libcxx-${PV} )"
784 -
785 -REQUIRED_USE="${PYTHON_REQUIRED_USE}
786 - || ( ${ALL_LLVM_TARGETS[*]} )"
787 -
788 -# We need extra level of indirection for CLANG_RESOURCE_DIR
789 -S=${WORKDIR}/x/y/${MY_P}
790 -
791 -# least intrusive of all
792 -CMAKE_BUILD_TYPE=RelWithDebInfo
793 -
794 -# Multilib notes:
795 -# 1. ABI_* flags control ABIs libclang* is built for only.
796 -# 2. clang is always capable of compiling code for all ABIs for enabled
797 -# target. However, you will need appropriate crt* files (installed
798 -# e.g. by sys-devel/gcc and sys-libs/glibc).
799 -# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
800 -# in the current profile (i.e. alike supported by sys-devel/gcc).
801 -#
802 -# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
803 -# multilib clang* libraries (not runtime, not wrappers).
804 -
805 -pkg_setup() {
806 - LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
807 - python-single-r1_pkg_setup
808 -}
809 -
810 -src_unpack() {
811 - # create extra parent dir for CLANG_RESOURCE_DIR
812 - mkdir -p x/y || die
813 - cd x/y || die
814 -
815 - einfo "Unpacking ${MY_P}.tar.xz ..."
816 - tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die
817 - einfo "Unpacking ${EXTRA_P}.tar.xz ..."
818 - tar -xf "${DISTDIR}/${EXTRA_P}.tar.xz" || die
819 -
820 - mv "${EXTRA_P}" "${S}"/tools/extra || die
821 - if use test; then
822 - einfo "Unpacking parts of ${LLVM_P}.tar.xz ..."
823 - tar -xf "${DISTDIR}/${LLVM_P}.tar.xz" \
824 - "${LLVM_P}"/utils/{lit,unittest} || die
825 - mv "${LLVM_P}" "${WORKDIR}"/llvm || die
826 - fi
827 -
828 - if ! use doc; then
829 - einfo "Unpacking llvm-${PV}-manpages.tar.bz2 ..."
830 - tar -xf "${DISTDIR}/llvm-${PV}-manpages.tar.bz2" || die
831 - fi
832 -}
833 -
834 -src_prepare() {
835 - # fix finding compiler-rt libs
836 - eapply "${FILESDIR}"/5.0.1/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
837 - # fix setting LD_LIBRARY_PATH for tests on *BSD
838 - eapply "${FILESDIR}"/5.0.1/0002-test-Fix-clang-test-for-FreeBSD-and-NetBSD.patch
839 - # add Prefix include paths for Darwin
840 - eapply "${FILESDIR}"/5.0.1/darwin_prefix-include-paths.patch
841 - # only used in hardened patches at the moment
842 - eapply "${FILESDIR}"/5.0.1/0003-Add-Gentoo-Linux-distro.patch
843 -
844 - cd tools/extra || die
845 - # fix setting LD_LIBRARY_PATH for tests on *BSD (extra part)
846 - eapply "${FILESDIR}"/5.0.1/extra/0001-Assume-the-shared-library-path-variable-is-LD_LIBRAR.patch
847 - cd ../.. || die
848 -
849 - if use hardened; then
850 - eapply "${FILESDIR}"/5.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
851 - eapply "${FILESDIR}"/5.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
852 - eapply "${FILESDIR}"/5.0.1/hardened/0003-Enable-PIE-by-default.patch
853 - eapply "${FILESDIR}"/5.0.1/hardened/0004-Enable-FORTIFY_SOURCE-macro-by-default.patch
854 - eapply "${FILESDIR}"/5.0.1/hardened/0005-Link-with-z-now-by-default-for-Gentoo.patch
855 - fi
856 -
857 - cmake-utils_src_prepare
858 - eprefixify lib/Frontend/InitHeaderSearch.cpp
859 -}
860 -
861 -multilib_src_configure() {
862 - local llvm_version=$(llvm-config --version) || die
863 - local clang_version=$(ver_cut 1-3 "${llvm_version}")
864 -
865 - local mycmakeargs=(
866 - # ensure that the correct llvm-config is used
867 - -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
868 - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
869 - -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
870 - # relative to bindir
871 - -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
872 -
873 - -DBUILD_SHARED_LIBS=ON
874 - -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
875 - -DLLVM_BUILD_TESTS=$(usex test)
876 -
877 - # these are not propagated reliably, so redefine them
878 - -DLLVM_ENABLE_EH=ON
879 - -DLLVM_ENABLE_RTTI=ON
880 -
881 - -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
882 - # libgomp support fails to find headers without explicit -I
883 - # furthermore, it provides only syntax checking
884 - -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
885 -
886 - # override default stdlib and rtlib
887 - -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
888 - -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
889 -
890 - -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
891 - -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
892 - # z3 is not multilib-friendly
893 - -DCLANG_ANALYZER_BUILD_Z3=$(multilib_native_usex z3)
894 - )
895 - use test && mycmakeargs+=(
896 - -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
897 - )
898 -
899 - if multilib_is_native_abi; then
900 - mycmakeargs+=(
901 - # normally copied from LLVM_INCLUDE_DOCS but the latter
902 - # is lacking value in stand-alone builds
903 - -DCLANG_INCLUDE_DOCS=$(usex doc)
904 - -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=$(usex doc)
905 - )
906 - use doc && mycmakeargs+=(
907 - -DLLVM_BUILD_DOCS=ON
908 - -DLLVM_ENABLE_SPHINX=ON
909 - -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
910 - -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
911 - -DSPHINX_WARNINGS_AS_ERRORS=OFF
912 - )
913 - use z3 && mycmakeargs+=(
914 - -DZ3_INCLUDE_DIR="${EPREFIX}/usr/include/z3"
915 - )
916 - else
917 - mycmakeargs+=(
918 - -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
919 - )
920 - fi
921 -
922 - if [[ -n ${EPREFIX} ]]; then
923 - mycmakeargs+=(
924 - -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
925 - )
926 - fi
927 -
928 - if tc-is-cross-compiler; then
929 - [[ -x "/usr/bin/clang-tblgen" ]] \
930 - || die "/usr/bin/clang-tblgen not found or usable"
931 - mycmakeargs+=(
932 - -DCMAKE_CROSSCOMPILING=ON
933 - -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
934 - )
935 - fi
936 -
937 - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
938 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
939 - cmake-utils_src_configure
940 -}
941 -
942 -multilib_src_compile() {
943 - cmake-utils_src_compile
944 -
945 - # provide a symlink for tests
946 - if [[ ! -L ${WORKDIR}/lib/clang ]]; then
947 - mkdir -p "${WORKDIR}"/lib || die
948 - ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
949 - fi
950 -}
951 -
952 -multilib_src_test() {
953 - # respect TMPDIR!
954 - local -x LIT_PRESERVES_TMP=1
955 - cmake-utils_src_make check-clang
956 - # clang-tidy requires [static-analyzer] and tests are not split
957 - # correctly, so they are all disabled when static-analyzer is off
958 - if multilib_is_native_abi && use static-analyzer; then
959 - cmake-utils_src_make check-clang-tools
960 - fi
961 -}
962 -
963 -src_install() {
964 - MULTILIB_WRAPPED_HEADERS=(
965 - /usr/include/clang/Config/config.h
966 - )
967 -
968 - multilib-minimal_src_install
969 -
970 - # Move runtime headers to /usr/lib/clang, where they belong
971 - mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
972 - # move (remaining) wrapped headers back
973 - mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
974 -
975 - # Apply CHOST and version suffix to clang tools
976 - # note: we use two version components here (vs 3 in runtime path)
977 - local llvm_version=$(llvm-config --version) || die
978 - local clang_version=$(ver_cut 1-2 "${llvm_version}")
979 - local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
980 - local clang_tools=( clang clang++ clang-cl clang-cpp )
981 - local abi i
982 -
983 - # cmake gives us:
984 - # - clang-X.Y
985 - # - clang -> clang-X.Y
986 - # - clang++, clang-cl, clang-cpp -> clang
987 - # we want to have:
988 - # - clang-X.Y
989 - # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
990 - # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
991 - # also in CHOST variant
992 - for i in "${clang_tools[@]:1}"; do
993 - rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
994 - dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
995 - dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
996 - done
997 -
998 - # now create target symlinks for all supported ABIs
999 - for abi in $(get_all_abis); do
1000 - local abi_chost=$(get_abi_CHOST "${abi}")
1001 - for i in "${clang_tools[@]}"; do
1002 - dosym "${i}-${clang_version}" \
1003 - "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
1004 - dosym "${abi_chost}-${i}-${clang_version}" \
1005 - "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
1006 - done
1007 - done
1008 -
1009 - # Remove unnecessary headers on FreeBSD, bug #417171
1010 - if use kernel_FreeBSD; then
1011 - rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
1012 - fi
1013 -}
1014 -
1015 -multilib_src_install() {
1016 - cmake-utils_src_install
1017 -
1018 - # move headers to /usr/include for wrapping & ABI mismatch checks
1019 - # (also drop the version suffix from runtime headers)
1020 - rm -rf "${ED%/}"/usr/include || die
1021 - mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
1022 - mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
1023 -}
1024 -
1025 -multilib_src_install_all() {
1026 - python_fix_shebang "${ED}"
1027 - if use static-analyzer; then
1028 - python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
1029 - fi
1030 -
1031 - # install pre-generated manpages
1032 - if ! use doc; then
1033 - insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
1034 - doins "${WORKDIR}/x/y/llvm-${PV}-manpages/clang"/*.1
1035 - fi
1036 -
1037 - docompress "/usr/lib/llvm/${SLOT}/share/man"
1038 - # match 'html' non-compression
1039 - use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
1040 - # +x for some reason; TODO: investigate
1041 - use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
1042 -}
1043 -
1044 -pkg_postinst() {
1045 - if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
1046 - eselect compiler-shadow update all
1047 - fi
1048 -
1049 - elog "You can find additional utility scripts in:"
1050 - elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
1051 - elog "To use these scripts, you will need Python 2.7. Some of them are vim"
1052 - elog "integration scripts (with instructions inside)."
1053 -}
1054 -
1055 -pkg_postrm() {
1056 - if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
1057 - eselect compiler-shadow clean all
1058 - fi
1059 -}
1060
1061 diff --git a/sys-devel/clang/clang-6.0.0-r1.ebuild b/sys-devel/clang/clang-6.0.0-r1.ebuild
1062 deleted file mode 100644
1063 index fc14879..0000000
1064 --- a/sys-devel/clang/clang-6.0.0-r1.ebuild
1065 +++ /dev/null
1066 @@ -1,337 +0,0 @@
1067 -# Copyright 1999-2018 Gentoo Foundation
1068 -# Distributed under the terms of the GNU General Public License v2
1069 -
1070 -EAPI=6
1071 -
1072 -: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
1073 -# (needed due to CMAKE_BUILD_TYPE != Gentoo)
1074 -CMAKE_MIN_VERSION=3.7.0-r1
1075 -PYTHON_COMPAT=( python2_7 )
1076 -
1077 -inherit cmake-utils eapi7-ver flag-o-matic llvm \
1078 - multilib-minimal multiprocessing pax-utils prefix python-single-r1 \
1079 - toolchain-funcs
1080 -
1081 -MY_P=cfe-${PV/_/}.src
1082 -EXTRA_P=clang-tools-extra-${PV/_/}.src
1083 -LLVM_P=llvm-${PV/_/}.src
1084 -
1085 -DESCRIPTION="C language family frontend for LLVM"
1086 -HOMEPAGE="https://llvm.org/"
1087 -SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz
1088 - https://releases.llvm.org/${PV/_//}/${EXTRA_P}.tar.xz
1089 - test? ( https://releases.llvm.org/${PV/_//}/${LLVM_P}.tar.xz )
1090 - !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-${PV}-manpages.tar.bz2 )"
1091 -
1092 -# Keep in sync with sys-devel/llvm
1093 -ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
1094 - NVPTX PowerPC Sparc SystemZ X86 XCore )
1095 -ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
1096 -LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
1097 -
1098 -LICENSE="UoI-NCSA"
1099 -SLOT="$(ver_cut 1)"
1100 -KEYWORDS="~amd64 ~arm64 ~x86 ~amd64-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
1101 -IUSE="debug default-compiler-rt default-libcxx doc hardened +static-analyzer
1102 - test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
1103 -RESTRICT="!test? ( test )"
1104 -
1105 -RDEPEND="
1106 - ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
1107 - static-analyzer? (
1108 - dev-lang/perl:*
1109 - z3? ( sci-mathematics/z3:0= )
1110 - )
1111 - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
1112 - ${PYTHON_DEPS}"
1113 -# configparser-3.2 breaks the build (3.3 or none at all are fine)
1114 -DEPEND="${RDEPEND}
1115 - doc? ( dev-python/sphinx )
1116 - xml? ( virtual/pkgconfig )
1117 - !!<dev-python/configparser-3.3.0.2
1118 - ${PYTHON_DEPS}"
1119 -RDEPEND="${RDEPEND}
1120 - !<sys-devel/llvm-4.0.0_rc:0
1121 - !sys-devel/clang:0"
1122 -PDEPEND="
1123 - sys-devel/clang-common
1124 - ~sys-devel/clang-runtime-${PV}
1125 - default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
1126 - default-libcxx? ( >=sys-libs/libcxx-${PV} )"
1127 -
1128 -REQUIRED_USE="${PYTHON_REQUIRED_USE}
1129 - || ( ${ALL_LLVM_TARGETS[*]} )"
1130 -
1131 -# We need extra level of indirection for CLANG_RESOURCE_DIR
1132 -S=${WORKDIR}/x/y/${MY_P}
1133 -
1134 -# least intrusive of all
1135 -CMAKE_BUILD_TYPE=RelWithDebInfo
1136 -
1137 -PATCHES=(
1138 - # add Prefix include paths for Darwin
1139 - "${FILESDIR}"/5.0.1/darwin_prefix-include-paths.patch
1140 -
1141 - # fix Driver crash with CHOST prefix and long command-line
1142 - # https://bugs.gentoo.org/650082
1143 - "${FILESDIR}"/6.0.0/0001-Driver-Avoid-invalidated-iterator-in-insertTargetAnd.patch
1144 - # fix test failure with default-compiler-rt
1145 - # https://bugs.gentoo.org/650316
1146 - "${FILESDIR}"/6.0.0/0002-test-Fix-Cross-DSO-CFI-Android-sanitizer-test-for-rt.patch
1147 -
1148 - # IsGentooLinux() is only used in hardened patches at the moment
1149 - "${FILESDIR}"/6.0.0/0003-Add-Gentoo-Linux-distro.patch
1150 -)
1151 -HARDENED_PATCHES=(
1152 - "${FILESDIR}"/6.0.0/hardened/0001-Use-z-relro-on-Gentoo.patch
1153 - "${FILESDIR}"/6.0.0/hardened/0002-Enable-Stack-Protector-by-default.patch
1154 - "${FILESDIR}"/6.0.0/hardened/0003-Enable-PIE-by-default.patch
1155 - "${FILESDIR}"/6.0.0/hardened/0004-Enable-FORTIFY_SOURCE-macro-by-default.patch
1156 - "${FILESDIR}"/6.0.0/hardened/0005-Link-with-z-now-by-default-for-Gentoo.patch
1157 -)
1158 -
1159 -# Multilib notes:
1160 -# 1. ABI_* flags control ABIs libclang* is built for only.
1161 -# 2. clang is always capable of compiling code for all ABIs for enabled
1162 -# target. However, you will need appropriate crt* files (installed
1163 -# e.g. by sys-devel/gcc and sys-libs/glibc).
1164 -# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
1165 -# in the current profile (i.e. alike supported by sys-devel/gcc).
1166 -#
1167 -# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
1168 -# multilib clang* libraries (not runtime, not wrappers).
1169 -
1170 -pkg_setup() {
1171 - LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
1172 - python-single-r1_pkg_setup
1173 -}
1174 -
1175 -src_unpack() {
1176 - # create extra parent dir for CLANG_RESOURCE_DIR
1177 - mkdir -p x/y || die
1178 - cd x/y || die
1179 -
1180 - einfo "Unpacking ${MY_P}.tar.xz ..."
1181 - tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die
1182 - einfo "Unpacking ${EXTRA_P}.tar.xz ..."
1183 - tar -xf "${DISTDIR}/${EXTRA_P}.tar.xz" || die
1184 -
1185 - mv "${EXTRA_P}" "${S}"/tools/extra || die
1186 - if use test; then
1187 - einfo "Unpacking parts of ${LLVM_P}.tar.xz ..."
1188 - tar -xf "${DISTDIR}/${LLVM_P}.tar.xz" \
1189 - "${LLVM_P}"/utils/{lit,llvm-lit,unittest} || die
1190 - mv "${LLVM_P}" "${WORKDIR}"/llvm || die
1191 - fi
1192 -
1193 - if ! use doc; then
1194 - einfo "Unpacking llvm-${PV}-manpages.tar.bz2 ..."
1195 - tar -xf "${DISTDIR}/llvm-${PV}-manpages.tar.bz2" || die
1196 - fi
1197 -}
1198 -
1199 -src_prepare() {
1200 - use hardened && eapply "${HARDENED_PATCHES[@]}"
1201 -
1202 - cmake-utils_src_prepare
1203 - eprefixify lib/Frontend/InitHeaderSearch.cpp
1204 -}
1205 -
1206 -multilib_src_configure() {
1207 - local llvm_version=$(llvm-config --version) || die
1208 - local clang_version=$(ver_cut 1-3 "${llvm_version}")
1209 -
1210 - local mycmakeargs=(
1211 - # ensure that the correct llvm-config is used
1212 - -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
1213 - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
1214 - -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
1215 - # relative to bindir
1216 - -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
1217 -
1218 - -DBUILD_SHARED_LIBS=ON
1219 - -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
1220 - -DLLVM_BUILD_TESTS=$(usex test)
1221 -
1222 - # these are not propagated reliably, so redefine them
1223 - -DLLVM_ENABLE_EH=ON
1224 - -DLLVM_ENABLE_RTTI=ON
1225 -
1226 - -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
1227 - # libgomp support fails to find headers without explicit -I
1228 - # furthermore, it provides only syntax checking
1229 - -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
1230 -
1231 - # override default stdlib and rtlib
1232 - -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
1233 - -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
1234 -
1235 - -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
1236 - -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
1237 - # z3 is not multilib-friendly
1238 - -DCLANG_ANALYZER_BUILD_Z3=$(multilib_native_usex z3)
1239 - )
1240 - use test && mycmakeargs+=(
1241 - -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
1242 - -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
1243 - )
1244 -
1245 - if multilib_is_native_abi; then
1246 - mycmakeargs+=(
1247 - # normally copied from LLVM_INCLUDE_DOCS but the latter
1248 - # is lacking value in stand-alone builds
1249 - -DCLANG_INCLUDE_DOCS=$(usex doc)
1250 - -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=$(usex doc)
1251 - )
1252 - use doc && mycmakeargs+=(
1253 - -DLLVM_BUILD_DOCS=ON
1254 - -DLLVM_ENABLE_SPHINX=ON
1255 - -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
1256 - -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
1257 - -DSPHINX_WARNINGS_AS_ERRORS=OFF
1258 - )
1259 - use z3 && mycmakeargs+=(
1260 - -DZ3_INCLUDE_DIR="${EPREFIX}/usr/include/z3"
1261 - )
1262 - else
1263 - mycmakeargs+=(
1264 - -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
1265 - )
1266 - fi
1267 -
1268 - if [[ -n ${EPREFIX} ]]; then
1269 - mycmakeargs+=(
1270 - -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
1271 - )
1272 - fi
1273 -
1274 - if tc-is-cross-compiler; then
1275 - [[ -x "/usr/bin/clang-tblgen" ]] \
1276 - || die "/usr/bin/clang-tblgen not found or usable"
1277 - mycmakeargs+=(
1278 - -DCMAKE_CROSSCOMPILING=ON
1279 - -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
1280 - )
1281 - fi
1282 -
1283 - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
1284 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
1285 - cmake-utils_src_configure
1286 -}
1287 -
1288 -multilib_src_compile() {
1289 - cmake-utils_src_compile
1290 -
1291 - # provide a symlink for tests
1292 - if [[ ! -L ${WORKDIR}/lib/clang ]]; then
1293 - mkdir -p "${WORKDIR}"/lib || die
1294 - ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
1295 - fi
1296 -}
1297 -
1298 -multilib_src_test() {
1299 - # respect TMPDIR!
1300 - local -x LIT_PRESERVES_TMP=1
1301 - cmake-utils_src_make check-clang
1302 - multilib_is_native_abi && cmake-utils_src_make check-clang-tools
1303 -}
1304 -
1305 -src_install() {
1306 - MULTILIB_WRAPPED_HEADERS=(
1307 - /usr/include/clang/Config/config.h
1308 - )
1309 -
1310 - multilib-minimal_src_install
1311 -
1312 - # Move runtime headers to /usr/lib/clang, where they belong
1313 - mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
1314 - # move (remaining) wrapped headers back
1315 - mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
1316 -
1317 - # Apply CHOST and version suffix to clang tools
1318 - # note: we use two version components here (vs 3 in runtime path)
1319 - local llvm_version=$(llvm-config --version) || die
1320 - local clang_version=$(ver_cut 1-2 "${llvm_version}")
1321 - local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
1322 - local clang_tools=( clang clang++ clang-cl clang-cpp )
1323 - local abi i
1324 -
1325 - # cmake gives us:
1326 - # - clang-X.Y
1327 - # - clang -> clang-X.Y
1328 - # - clang++, clang-cl, clang-cpp -> clang
1329 - # we want to have:
1330 - # - clang-X.Y
1331 - # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
1332 - # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
1333 - # also in CHOST variant
1334 - for i in "${clang_tools[@]:1}"; do
1335 - rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
1336 - dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
1337 - dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
1338 - done
1339 -
1340 - # now create target symlinks for all supported ABIs
1341 - for abi in $(get_all_abis); do
1342 - local abi_chost=$(get_abi_CHOST "${abi}")
1343 - for i in "${clang_tools[@]}"; do
1344 - dosym "${i}-${clang_version}" \
1345 - "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
1346 - dosym "${abi_chost}-${i}-${clang_version}" \
1347 - "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
1348 - done
1349 - done
1350 -
1351 - # Remove unnecessary headers on FreeBSD, bug #417171
1352 - if use kernel_FreeBSD; then
1353 - rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
1354 - fi
1355 -}
1356 -
1357 -multilib_src_install() {
1358 - cmake-utils_src_install
1359 -
1360 - # move headers to /usr/include for wrapping & ABI mismatch checks
1361 - # (also drop the version suffix from runtime headers)
1362 - rm -rf "${ED%/}"/usr/include || die
1363 - mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
1364 - mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
1365 -}
1366 -
1367 -multilib_src_install_all() {
1368 - python_fix_shebang "${ED}"
1369 - if use static-analyzer; then
1370 - python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
1371 - fi
1372 -
1373 - # install pre-generated manpages
1374 - if ! use doc; then
1375 - insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
1376 - doins "${WORKDIR}/x/y/llvm-${PV}-manpages/clang"/*.1
1377 - fi
1378 -
1379 - docompress "/usr/lib/llvm/${SLOT}/share/man"
1380 - # match 'html' non-compression
1381 - use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
1382 - # +x for some reason; TODO: investigate
1383 - use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
1384 -}
1385 -
1386 -pkg_postinst() {
1387 - if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
1388 - eselect compiler-shadow update all
1389 - fi
1390 -
1391 - elog "You can find additional utility scripts in:"
1392 - elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
1393 - elog "To use these scripts, you will need Python 2.7. Some of them are vim"
1394 - elog "integration scripts (with instructions inside). The run-clang-tidy.py"
1395 - elog "scripts requires the following additional package:"
1396 - elog " dev-python/pyyaml"
1397 -}
1398 -
1399 -pkg_postrm() {
1400 - if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
1401 - eselect compiler-shadow clean all
1402 - fi
1403 -}
1404
1405 diff --git a/sys-devel/clang/clang-6.0.1.ebuild b/sys-devel/clang/clang-6.0.1.ebuild
1406 index db1615a..3cf5d11 100644
1407 --- a/sys-devel/clang/clang-6.0.1.ebuild
1408 +++ b/sys-devel/clang/clang-6.0.1.ebuild
1409 @@ -31,7 +31,7 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
1410
1411 LICENSE="UoI-NCSA"
1412 SLOT="$(ver_cut 1)"
1413 -KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
1414 +KEYWORDS="amd64 arm64 ~ppc64 x86"
1415 IUSE="debug default-compiler-rt default-libcxx doc hardened +static-analyzer
1416 test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
1417 RESTRICT="!test? ( test )"
1418 @@ -70,7 +70,7 @@ CMAKE_BUILD_TYPE=RelWithDebInfo
1419
1420 PATCHES=(
1421 # add Prefix include paths for Darwin
1422 - "${FILESDIR}"/5.0.1/darwin_prefix-include-paths.patch
1423 + "${FILESDIR}"/6.0.1/darwin_prefix-include-paths.patch
1424
1425 # fix test failure with default-compiler-rt
1426 # https://bugs.gentoo.org/650316
1427
1428 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
1429 deleted file mode 100644
1430 index f52d445..0000000
1431 --- a/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
1432 +++ /dev/null
1433 @@ -1,87 +0,0 @@
1434 -From f1ea62e93cba334828c427146cc2ca7718a9ffb3 Mon Sep 17 00:00:00 2001
1435 -From: Michal Gorny <mgorny@g.o>
1436 -Date: Mon, 9 Jan 2017 20:54:20 +0000
1437 -Subject: [PATCH] [Frontend] Correct values of ATOMIC_*_LOCK_FREE to match
1438 - builtin
1439 -
1440 -Correct the logic used to set ATOMIC_*_LOCK_FREE preprocessor macros not
1441 -to rely on the ABI alignment of types. Instead, just assume all those
1442 -types are aligned correctly by default since clang uses safe alignment
1443 -for _Atomic types even if the underlying types are aligned to a lower
1444 -boundary by default.
1445 -
1446 -For example, the 'long long' and 'double' types on x86 are aligned to
1447 -32-bit boundary by default. However, '_Atomic long long' and '_Atomic
1448 -double' are aligned to 64-bit boundary, therefore satisfying
1449 -the requirements of lock-free atomic operations.
1450 -
1451 -This fixes PR #19355 by correcting the value of
1452 -__GCC_ATOMIC_LLONG_LOCK_FREE on x86, and therefore also fixing
1453 -the assumption made in libc++ tests. This also fixes PR #30581 by
1454 -applying a consistent logic between the functions used to implement
1455 -both interfaces.
1456 -
1457 -Differential Revision: https://reviews.llvm.org/D28213
1458 -
1459 -git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291477 91177308-0d34-0410-b5e6-96231b3b80d8
1460 ----
1461 - lib/Frontend/InitPreprocessor.cpp | 10 ++++------
1462 - test/Sema/atomic-ops.c | 4 ----
1463 - 2 files changed, 4 insertions(+), 10 deletions(-)
1464 -
1465 -diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp
1466 -index 17603ada11..4502c92499 100644
1467 ---- a/lib/Frontend/InitPreprocessor.cpp
1468 -+++ b/lib/Frontend/InitPreprocessor.cpp
1469 -@@ -286,12 +286,12 @@ static void DefineFastIntType(unsigned TypeWidth, bool IsSigned,
1470 -
1471 - /// Get the value the ATOMIC_*_LOCK_FREE macro should have for a type with
1472 - /// the specified properties.
1473 --static const char *getLockFreeValue(unsigned TypeWidth, unsigned TypeAlign,
1474 -- unsigned InlineWidth) {
1475 -+static const char *getLockFreeValue(unsigned TypeWidth, unsigned InlineWidth) {
1476 - // Fully-aligned, power-of-2 sizes no larger than the inline
1477 - // width will be inlined as lock-free operations.
1478 -- if (TypeWidth == TypeAlign && (TypeWidth & (TypeWidth - 1)) == 0 &&
1479 -- TypeWidth <= InlineWidth)
1480 -+ // Note: we do not need to check alignment since _Atomic(T) is always
1481 -+ // appropriately-aligned in clang.
1482 -+ if ((TypeWidth & (TypeWidth - 1)) == 0 && TypeWidth <= InlineWidth)
1483 - return "2"; // "always lock free"
1484 - // We cannot be certain what operations the lib calls might be
1485 - // able to implement as lock-free on future processors.
1486 -@@ -881,7 +881,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
1487 - #define DEFINE_LOCK_FREE_MACRO(TYPE, Type) \
1488 - Builder.defineMacro("__GCC_ATOMIC_" #TYPE "_LOCK_FREE", \
1489 - getLockFreeValue(TI.get##Type##Width(), \
1490 -- TI.get##Type##Align(), \
1491 - InlineWidthBits));
1492 - DEFINE_LOCK_FREE_MACRO(BOOL, Bool);
1493 - DEFINE_LOCK_FREE_MACRO(CHAR, Char);
1494 -@@ -894,7 +893,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
1495 - DEFINE_LOCK_FREE_MACRO(LLONG, LongLong);
1496 - Builder.defineMacro("__GCC_ATOMIC_POINTER_LOCK_FREE",
1497 - getLockFreeValue(TI.getPointerWidth(0),
1498 -- TI.getPointerAlign(0),
1499 - InlineWidthBits));
1500 - #undef DEFINE_LOCK_FREE_MACRO
1501 - }
1502 -diff --git a/test/Sema/atomic-ops.c b/test/Sema/atomic-ops.c
1503 -index 8ebf3eaed4..d3ebdf67db 100644
1504 ---- a/test/Sema/atomic-ops.c
1505 -+++ b/test/Sema/atomic-ops.c
1506 -@@ -14,11 +14,7 @@ _Static_assert(__GCC_ATOMIC_WCHAR_T_LOCK_FREE == 2, "");
1507 - _Static_assert(__GCC_ATOMIC_SHORT_LOCK_FREE == 2, "");
1508 - _Static_assert(__GCC_ATOMIC_INT_LOCK_FREE == 2, "");
1509 - _Static_assert(__GCC_ATOMIC_LONG_LOCK_FREE == 2, "");
1510 --#ifdef __i386__
1511 --_Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 1, "");
1512 --#else
1513 - _Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 2, "");
1514 --#endif
1515 - _Static_assert(__GCC_ATOMIC_POINTER_LOCK_FREE == 2, "");
1516 -
1517 - _Static_assert(__c11_atomic_is_lock_free(1), "");
1518 ---
1519 -2.12.0
1520 -
1521
1522 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
1523 deleted file mode 100644
1524 index 0ecd5bc..0000000
1525 --- a/sys-devel/clang/files/4.0.1/0002-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
1526 +++ /dev/null
1527 @@ -1,64 +0,0 @@
1528 -From 8dd12df445c9a35f7b1c0202eb7c74b954b0980d Mon Sep 17 00:00:00 2001
1529 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
1530 -Date: Sun, 21 Aug 2016 23:31:55 +0200
1531 -Subject: [PATCH 7/7] cmake: Support stand-alone Sphinx & doxygen doc build
1532 -
1533 -Copy the necessary options and configuration checks from LLVM to clang,
1534 -to support stand-alone documentation builds.
1535 -
1536 -Patch: https://reviews.llvm.org/D23758
1537 ----
1538 - CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++++
1539 - 1 file changed, 37 insertions(+)
1540 -
1541 -diff --git a/CMakeLists.txt b/CMakeLists.txt
1542 -index 8ed8c10..3f34d8c 100644
1543 ---- a/CMakeLists.txt
1544 -+++ b/CMakeLists.txt
1545 -@@ -162,6 +162,43 @@ Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
1546 - endif()
1547 - endif()
1548 -
1549 -+ option (LLVM_BUILD_DOCS "Build the llvm documentation." OFF)
1550 -+ option (LLVM_INCLUDE_DOCS "Generate build targets for llvm documentation." ON)
1551 -+ option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OFF)
1552 -+ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
1553 -+
1554 -+ if (LLVM_ENABLE_DOXYGEN)
1555 -+ message(STATUS "Doxygen enabled.")
1556 -+ find_package(Doxygen REQUIRED)
1557 -+
1558 -+ if (DOXYGEN_FOUND)
1559 -+ # If we find doxygen and we want to enable doxygen by default create a
1560 -+ # global aggregate doxygen target for generating llvm and any/all
1561 -+ # subprojects doxygen documentation.
1562 -+ if (LLVM_BUILD_DOCS)
1563 -+ add_custom_target(doxygen ALL)
1564 -+ endif()
1565 -+
1566 -+ option(LLVM_DOXYGEN_EXTERNAL_SEARCH "Enable doxygen external search." OFF)
1567 -+ if (LLVM_DOXYGEN_EXTERNAL_SEARCH)
1568 -+ set(LLVM_DOXYGEN_SEARCHENGINE_URL "" CACHE STRING "URL to use for external search.")
1569 -+ set(LLVM_DOXYGEN_SEARCH_MAPPINGS "" CACHE STRING "Doxygen Search Mappings")
1570 -+ endif()
1571 -+ endif()
1572 -+ else()
1573 -+ message(STATUS "Doxygen disabled.")
1574 -+ endif()
1575 -+
1576 -+ if (LLVM_ENABLE_SPHINX)
1577 -+ message(STATUS "Sphinx enabled.")
1578 -+ find_package(Sphinx REQUIRED)
1579 -+ if (LLVM_BUILD_DOCS)
1580 -+ add_custom_target(sphinx ALL)
1581 -+ endif()
1582 -+ else()
1583 -+ message(STATUS "Sphinx disabled.")
1584 -+ endif()
1585 -+
1586 - set( CLANG_BUILT_STANDALONE 1 )
1587 - set(BACKEND_PACKAGE_STRING "LLVM ${LLVM_PACKAGE_VERSION}")
1588 - else()
1589 ---
1590 -2.9.3
1591 -
1592
1593 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
1594 deleted file mode 100644
1595 index eb85ba5..0000000
1596 --- a/sys-devel/clang/files/4.0.1/0003-Add-Gentoo-Linux-distro.patch
1597 +++ /dev/null
1598 @@ -1,32 +0,0 @@
1599 ---- a/include/clang/Driver/Distro.h
1600 -+++ b/include/clang/Driver/Distro.h
1601 -@@ -26,6 +26,7 @@
1602 - // NB: Releases of a particular Linux distro should be kept together
1603 - // in this enum, because some tests are done by integer comparison against
1604 - // the first and last known member in the family, e.g. IsRedHat().
1605 -+ GentooLinux,
1606 - ArchLinux,
1607 - DebianLenny,
1608 - DebianSqueeze,
1609 -@@ -97,6 +98,10 @@
1610 - /// @name Convenience Predicates
1611 - /// @{
1612 -
1613 -+ bool IsGentooLinux() const {
1614 -+ return DistroVal == GentooLinux;
1615 -+ }
1616 -+
1617 - bool IsRedhat() const {
1618 - return DistroVal == Fedora || (DistroVal >= RHEL5 && DistroVal <= RHEL7);
1619 - }
1620 ---- a/lib/Driver/Distro.cpp
1621 -+++ b/lib/Driver/Distro.cpp
1622 -@@ -128,6 +128,9 @@
1623 - if (VFS.exists("/etc/arch-release"))
1624 - return Distro::ArchLinux;
1625 -
1626 -+ if (VFS.exists("/etc/gentoo-release"))
1627 -+ return Distro::GentooLinux;
1628 -+
1629 - return Distro::UnknownDistro;
1630 - }
1631
1632 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
1633 deleted file mode 100644
1634 index 3779bc6..0000000
1635 --- a/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
1636 +++ /dev/null
1637 @@ -1,48 +0,0 @@
1638 -From f1355920fbe819c5b1f5a870fc76cffcdd6328f0 Mon Sep 17 00:00:00 2001
1639 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
1640 -Date: Fri, 10 Feb 2017 22:44:53 +0100
1641 -Subject: [PATCH 1/2] [test] Fix test dependencies when using installed tools
1642 -
1643 -Use the LLVM_UTILS_PROVIDED variable to determine whether test tool
1644 -dependencies should be exposed for clang-tools-extra tests. If clang is
1645 -being built stand-alone and LLVM test tools (FileCheck, count and not)
1646 -are installed, the top-level CMakeLists.txt of clang sets this variable
1647 -to indicate that they will not be built as a part of this build,
1648 -and therefore no dependencies should be emitted for them. This fixes
1649 -the dependency errors when building clang stand-alone with tests
1650 -enabled.
1651 ----
1652 - test/CMakeLists.txt | 10 +++++++---
1653 - 1 file changed, 7 insertions(+), 3 deletions(-)
1654 -
1655 -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
1656 -index a852ef60..c26bd5c4 100644
1657 ---- a/test/CMakeLists.txt
1658 -+++ b/test/CMakeLists.txt
1659 -@@ -31,9 +31,6 @@ if(CLANG_TOOLS_TEST_USE_VG)
1660 - endif()
1661 -
1662 - set(CLANG_TOOLS_TEST_DEPS
1663 -- # Base line deps.
1664 -- FileCheck count not
1665 --
1666 - # clang-tidy tests require it.
1667 - clang-headers
1668 -
1669 -@@ -58,6 +55,13 @@ set(CLANG_TOOLS_TEST_DEPS
1670 - ExtraToolsUnitTests
1671 - )
1672 -
1673 -+if(NOT LLVM_UTILS_PROVIDED)
1674 -+ list(APPEND CLANG_TOOLS_TEST_DEPS
1675 -+ # Base line deps.
1676 -+ FileCheck count not
1677 -+ )
1678 -+endif()
1679 -+
1680 - add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests"
1681 - ${CMAKE_CURRENT_BINARY_DIR}
1682 - DEPENDS ${CLANG_TOOLS_TEST_DEPS}
1683 ---
1684 -2.12.0
1685 -
1686
1687 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
1688 deleted file mode 100644
1689 index 22f6d56..0000000
1690 --- a/sys-devel/clang/files/4.0.1/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
1691 +++ /dev/null
1692 @@ -1,83 +0,0 @@
1693 -From f3ff810e81c35133f6a7e463d860bcd4ca30be84 Mon Sep 17 00:00:00 2001
1694 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
1695 -Date: Sun, 19 Feb 2017 12:13:04 +0100
1696 -Subject: [PATCH 2/2] [test] Fix clang library dir in LD_LIBRARY_PATH For
1697 - stand-alone build
1698 -
1699 -Prepend the clang library directory (determined using SHLIBDIR, alike
1700 -in clang) to the LD_LIBRARY_PATH to ensure that just-built clang
1701 -libraries will be used instead of a previous installed version.
1702 -
1703 -When a stand-alone build is performed, LLVM_LIBS_DIR contains the path
1704 -to installed LLVM library directory. The same directory frequently
1705 -contains a previously installed version of clang. SHLIBDIR, on the other
1706 -hand, is always the build-tree directory, and therefore contains
1707 -the freshly built clang libraries.
1708 -
1709 -In a non-stand-alone build, both paths will be the same and therefore
1710 -including them both will not cause any issues.
1711 ----
1712 - test/Unit/lit.cfg | 9 ++++++---
1713 - test/lit.cfg | 5 ++++-
1714 - test/lit.site.cfg.in | 1 +
1715 - 3 files changed, 11 insertions(+), 4 deletions(-)
1716 -
1717 -diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg
1718 -index ff70123c..3a1da187 100644
1719 ---- a/test/Unit/lit.cfg
1720 -+++ b/test/Unit/lit.cfg
1721 -@@ -41,14 +41,17 @@ elif platform.system() == 'Windows':
1722 - shlibpath_var = 'PATH'
1723 -
1724 - # Point the dynamic loader at dynamic libraries in 'lib'.
1725 -+shlibdir = getattr(config, 'shlibdir', None)
1726 -+if not shlibdir:
1727 -+ lit_config.fatal('No shlibdir set!')
1728 - llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
1729 - if not llvm_libs_dir:
1730 - lit_config.fatal('No LLVM libs dir set!')
1731 --shlibpath = os.path.pathsep.join((llvm_libs_dir,
1732 -+shlibpath = os.path.pathsep.join((shlibdir, llvm_libs_dir,
1733 - config.environment.get(shlibpath_var,'')))
1734 -
1735 - # Win32 seeks DLLs along %PATH%.
1736 --if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
1737 -- shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
1738 -+if sys.platform in ['win32', 'cygwin'] and os.path.isdir(shlibdir):
1739 -+ shlibpath = os.path.pathsep.join((shlibdir, shlibpath))
1740 -
1741 - config.environment[shlibpath_var] = shlibpath
1742 -diff --git a/test/lit.cfg b/test/lit.cfg
1743 -index bb592936..0e7de849 100644
1744 ---- a/test/lit.cfg
1745 -+++ b/test/lit.cfg
1746 -@@ -99,10 +99,13 @@ if clang_tools_binary_dir is not None:
1747 - clang_tools_dir, llvm_tools_dir, config.environment['PATH']))
1748 - config.environment['PATH'] = path
1749 -
1750 -+ clang_libs_dir = getattr(config, 'clang_libs_dir', None)
1751 -+ if not clang_libs_dir:
1752 -+ lit_config.fatal('No Clang libs dir set!')
1753 - llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
1754 - if not llvm_libs_dir:
1755 - lit_config.fatal('No LLVM libs dir set!')
1756 -- path = os.path.pathsep.join((llvm_libs_dir,
1757 -+ path = os.path.pathsep.join((clang_libs_dir, llvm_libs_dir,
1758 - config.environment.get('LD_LIBRARY_PATH','')))
1759 - config.environment['LD_LIBRARY_PATH'] = path
1760 -
1761 -diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
1762 -index dfd0164c..f310b59a 100644
1763 ---- a/test/lit.site.cfg.in
1764 -+++ b/test/lit.site.cfg.in
1765 -@@ -7,6 +7,7 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
1766 - config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
1767 - config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
1768 - config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
1769 -+config.clang_libs_dir = "@SHLIBDIR@"
1770 - config.python_executable = "@PYTHON_EXECUTABLE@"
1771 - config.target_triple = "@TARGET_TRIPLE@"
1772 -
1773 ---
1774 -2.12.0
1775 -
1776
1777 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
1778 deleted file mode 100644
1779 index 93e7c6a..0000000
1780 --- a/sys-devel/clang/files/4.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
1781 +++ /dev/null
1782 @@ -1,11 +0,0 @@
1783 ---- a/lib/Driver/ToolChains.cpp
1784 -+++ b/lib/Driver/ToolChains.cpp
1785 -@@ -4112,7 +4112,7 @@
1786 -
1787 - Distro Distro(D.getVFS());
1788 -
1789 -- if (Distro.IsOpenSUSE() || Distro.IsUbuntu()) {
1790 -+ if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsGentooLinux()) {
1791 - ExtraOpts.push_back("-z");
1792 - ExtraOpts.push_back("relro");
1793 - }
1794
1795 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
1796 deleted file mode 100644
1797 index 13ac645..0000000
1798 --- a/sys-devel/clang/files/4.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
1799 +++ /dev/null
1800 @@ -1,23 +0,0 @@
1801 ---- a/lib/Driver/ToolChains.cpp
1802 -+++ b/lib/Driver/ToolChains.cpp
1803 -@@ -4866,6 +4866,10 @@
1804 - CmdArgs.push_back("-lunwind");
1805 - }
1806 -
1807 -+unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const {
1808 -+ return 2;
1809 -+}
1810 -+
1811 - /// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly.
1812 -
1813 - DragonFly::DragonFly(const Driver &D, const llvm::Triple &Triple,
1814 ---- a/lib/Driver/ToolChains.h
1815 -+++ b/lib/Driver/ToolChains.h
1816 -@@ -880,6 +880,7 @@
1817 - void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs,
1818 - llvm::opt::ArgStringList &CC1Args) const override;
1819 - bool isPIEDefault() const override;
1820 -+ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override;
1821 - SanitizerMask getSupportedSanitizers() const override;
1822 - void addProfileRTLibs(const llvm::opt::ArgList &Args,
1823 - llvm::opt::ArgStringList &CmdArgs) const override;
1824
1825 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
1826 deleted file mode 100644
1827 index e1908bc..0000000
1828 --- a/sys-devel/clang/files/4.0.1/hardened/0003-Enable-PIE-by-default.patch
1829 +++ /dev/null
1830 @@ -1,26 +0,0 @@
1831 ---- a/lib/Driver/ToolChains.cpp
1832 -+++ b/lib/Driver/ToolChains.cpp
1833 -@@ -4721,7 +4721,9 @@
1834 - }
1835 - }
1836 -
1837 --bool Linux::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); }
1838 -+bool Linux::isPIEDefault() const {
1839 -+ return true;
1840 -+}
1841 -
1842 - SanitizerMask Linux::getSupportedSanitizers() const {
1843 - const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
1844 ---- a/lib/Driver/Tools.cpp
1845 -+++ b/lib/Driver/Tools.cpp
1846 -@@ -9258,7 +9258,9 @@
1847 - if (!D.SysRoot.empty())
1848 - CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
1849 -
1850 -- if (IsPIE)
1851 -+ if (Args.hasArg(options::OPT_nopie))
1852 -+ CmdArgs.push_back("-nopie");
1853 -+ else if (IsPIE)
1854 - CmdArgs.push_back("-pie");
1855 -
1856 - CmdArgs.push_back("--eh-frame-hdr");
1857
1858 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
1859 deleted file mode 100644
1860 index b404db5..0000000
1861 --- a/sys-devel/clang/files/4.0.1/hardened/0004-Link-with-z-now-by-default-for-Gentoo.patch
1862 +++ /dev/null
1863 @@ -1,14 +0,0 @@
1864 ---- a/lib/Driver/ToolChains.cpp
1865 -+++ b/lib/Driver/ToolChains.cpp
1866 -@@ -4112,6 +4112,11 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
1867 -
1868 - Distro Distro(D.getVFS());
1869 -
1870 -+ if (Distro.IsGentooLinux()) {
1871 -+ ExtraOpts.push_back("-z");
1872 -+ ExtraOpts.push_back("now");
1873 -+ }
1874 -+
1875 - if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsGentooLinux()) {
1876 - ExtraOpts.push_back("-z");
1877 - ExtraOpts.push_back("relro");
1878
1879 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
1880 deleted file mode 100644
1881 index 7d53cbd..0000000
1882 --- a/sys-devel/clang/files/5.0.1/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
1883 +++ /dev/null
1884 @@ -1,136 +0,0 @@
1885 -From 19e3dc0ce4949cc7f869b4552c6a7f28cd59c3b7 Mon Sep 17 00:00:00 2001
1886 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
1887 -Date: Thu, 17 Nov 2016 14:19:18 +0100
1888 -Subject: [PATCH] [Driver] Use arch type to find compiler-rt libraries (on
1889 - Linux)
1890 -
1891 -Use llvm::Triple::getArchTypeName() when looking for compiler-rt
1892 -libraries, rather than the exact arch string from the triple. This is
1893 -more correct as it matches the values used when building compiler-rt
1894 -(builtin-config-ix.cmake) which are the subset of the values allowed
1895 -in triples.
1896 -
1897 -For example, this fixes an issue when the compiler set for
1898 -i686-pc-linux-gnu triple would not find an i386 compiler-rt library,
1899 -while this is the exact arch that is detected by compiler-rt. The same
1900 -applies to any other i?86 variant allowed by LLVM.
1901 -
1902 -This also makes the special case for MSVC unnecessary, since now i386
1903 -will be used reliably for all 32-bit x86 variants.
1904 ----
1905 - lib/Driver/ToolChain.cpp | 5 +----
1906 - .../usr/i686-unknown-linux/lib/.keep | 0
1907 - .../usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o | 0
1908 - test/Driver/linux-ld.c | 21 +++++++++++++++++++++
1909 - test/Driver/nostdlib.c | 2 +-
1910 - test/Driver/print-libgcc-file-name-clangrt.c | 10 ++++++++--
1911 - test/Driver/windows-cross.c | 2 +-
1912 - 7 files changed, 32 insertions(+), 8 deletions(-)
1913 - create mode 100644 test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep
1914 - create mode 100644 test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o
1915 -
1916 -diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
1917 -index 6adc0386ee..7e4222f087 100644
1918 ---- a/lib/Driver/ToolChain.cpp
1919 -+++ b/lib/Driver/ToolChain.cpp
1920 -@@ -283,15 +283,12 @@ static StringRef getArchNameForCompilerRTLib(const ToolChain &TC,
1921 - const llvm::Triple &Triple = TC.getTriple();
1922 - bool IsWindows = Triple.isOSWindows();
1923 -
1924 -- if (Triple.isWindowsMSVCEnvironment() && TC.getArch() == llvm::Triple::x86)
1925 -- return "i386";
1926 --
1927 - if (TC.getArch() == llvm::Triple::arm || TC.getArch() == llvm::Triple::armeb)
1928 - return (arm::getARMFloatABI(TC, Args) == arm::FloatABI::Hard && !IsWindows)
1929 - ? "armhf"
1930 - : "arm";
1931 -
1932 -- return TC.getArchName();
1933 -+ return llvm::Triple::getArchTypeName(TC.getArch());
1934 - }
1935 -
1936 - std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
1937 -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
1938 -new file mode 100644
1939 -index 0000000000..e69de29bb2
1940 -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
1941 -new file mode 100644
1942 -index 0000000000..e69de29bb2
1943 -diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c
1944 -index e5aa870866..92b199b9d4 100644
1945 ---- a/test/Driver/linux-ld.c
1946 -+++ b/test/Driver/linux-ld.c
1947 -@@ -71,6 +71,27 @@
1948 - // CHECK-LD-RT: libclang_rt.builtins-x86_64.a"
1949 - //
1950 - // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1951 -+// RUN: --target=i686-unknown-linux \
1952 -+// RUN: --gcc-toolchain="" \
1953 -+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
1954 -+// RUN: --rtlib=compiler-rt \
1955 -+// RUN: | FileCheck --check-prefix=CHECK-LD-RT-I686 %s
1956 -+// CHECK-LD-RT-I686-NOT: warning:
1957 -+// CHECK-LD-RT-I686: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1958 -+// CHECK-LD-RT-I686: "--eh-frame-hdr"
1959 -+// CHECK-LD-RT-I686: "-m" "elf_i386"
1960 -+// CHECK-LD-RT-I686: "-dynamic-linker"
1961 -+// CHECK-LD-RT-I686: "{{.*}}/usr/lib/gcc/i686-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
1962 -+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0"
1963 -+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../../../i686-unknown-linux/lib"
1964 -+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../.."
1965 -+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/lib"
1966 -+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib"
1967 -+// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a"
1968 -+// CHECK-LD-RT-I686: "-lc"
1969 -+// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a"
1970 -+//
1971 -+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1972 - // RUN: --target=arm-linux-androideabi \
1973 - // RUN: --gcc-toolchain="" \
1974 - // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1975 -diff --git a/test/Driver/nostdlib.c b/test/Driver/nostdlib.c
1976 -index a9ef665c57..c9793d968c 100644
1977 ---- a/test/Driver/nostdlib.c
1978 -+++ b/test/Driver/nostdlib.c
1979 -@@ -27,5 +27,5 @@
1980 - //
1981 - // CHECK-LINUX-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt'
1982 - // CHECK-LINUX-NOSTDLIB: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
1983 --// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i686.a"
1984 -+// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i386.a"
1985 - // CHECK-MSVC-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt'
1986 -diff --git a/test/Driver/print-libgcc-file-name-clangrt.c b/test/Driver/print-libgcc-file-name-clangrt.c
1987 -index 9f8120c31d..28c758881d 100644
1988 ---- a/test/Driver/print-libgcc-file-name-clangrt.c
1989 -+++ b/test/Driver/print-libgcc-file-name-clangrt.c
1990 -@@ -6,6 +6,12 @@
1991 - // CHECK-CLANGRT-X8664: libclang_rt.builtins-x86_64.a
1992 -
1993 - // RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
1994 -+// RUN: --target=i386-pc-linux \
1995 -+// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
1996 -+// CHECK-CLANGRT-I386: libclang_rt.builtins-i386.a
1997 -+
1998 -+// Check whether alternate arch values map to the correct library.
1999 -+//
2000 -+// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
2001 - // RUN: --target=i686-pc-linux \
2002 --// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I686 %s
2003 --// CHECK-CLANGRT-I686: libclang_rt.builtins-i686.a
2004 -+// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
2005 -diff --git a/test/Driver/windows-cross.c b/test/Driver/windows-cross.c
2006 -index 5a2fe52b09..78b4981c9d 100644
2007 ---- a/test/Driver/windows-cross.c
2008 -+++ b/test/Driver/windows-cross.c
2009 -@@ -59,7 +59,7 @@
2010 - // RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-ADDRESS-EXE-X86
2011 -
2012 - // CHECK-SANITIZE-ADDRESS-EXE-X86: "-fsanitize=address"
2013 --// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i686.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i686.lib" "--undefined" "___asan_seh_interceptor"
2014 -+// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i386.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib" "--undefined" "___asan_seh_interceptor"
2015 -
2016 - // 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 \
2017 - // RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-TSAN
2018 ---
2019 -2.11.0
2020 -
2021
2022 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
2023 deleted file mode 100644
2024 index 1751a4f..0000000
2025 --- a/sys-devel/clang/files/5.0.1/0002-test-Fix-clang-test-for-FreeBSD-and-NetBSD.patch
2026 +++ /dev/null
2027 @@ -1,76 +0,0 @@
2028 -From 4650c277d616e5d297baf28682eb792e2e0144b1 Mon Sep 17 00:00:00 2001
2029 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
2030 -Date: Sun, 1 Apr 2018 23:20:56 +0200
2031 -Subject: [PATCH] [test] Fix clang-test for FreeBSD and NetBSD
2032 -
2033 -Lit tries to inject the shared library paths, but no action is taken
2034 -when platform.system() is not recognized, results in an environment
2035 -variable with an empty name, which is illegal.
2036 -
2037 -The patch fixes this mechanism for FreeBSD and NetBSD, and gives an
2038 -warning on other platforms, so that the latecomers don't have to spend
2039 -time on debugging lit.
2040 -
2041 -Thanks Zhihao Yuan for the patch!
2042 -
2043 -Differential Revision: https://reviews.llvm.org/D39162
2044 -
2045 -git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316411 91177308-0d34-0410-b5e6-96231b3b80d8
2046 -
2047 -(rebased for release_50 branch)
2048 ----
2049 - test/Unit/lit.cfg | 41 ++++++++++++++++++++---------------------
2050 - 1 file changed, 20 insertions(+), 21 deletions(-)
2051 -
2052 -diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg
2053 -index 90eb2ac604..2cabf4bba1 100644
2054 ---- a/test/Unit/lit.cfg
2055 -+++ b/test/Unit/lit.cfg
2056 -@@ -87,24 +87,23 @@ if config.test_exec_root is None:
2057 - lit_config.load_config(config, site_cfg)
2058 - raise SystemExit
2059 -
2060 --shlibpath_var = ''
2061 --if platform.system() == 'Linux':
2062 -- shlibpath_var = 'LD_LIBRARY_PATH'
2063 --elif platform.system() == 'Darwin':
2064 -- shlibpath_var = 'DYLD_LIBRARY_PATH'
2065 --elif platform.system() == 'Windows':
2066 -- shlibpath_var = 'PATH'
2067 --
2068 --# in stand-alone builds, shlibdir is clang's build tree
2069 --# while llvm_libs_dir is installed LLVM (and possibly older clang)
2070 --llvm_shlib_dir = getattr(config, 'shlibdir', None)
2071 --if not llvm_shlib_dir:
2072 -- lit_config.fatal('No shlibdir set!')
2073 --# Point the dynamic loader at dynamic libraries in 'lib'.
2074 --llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
2075 --if not llvm_libs_dir:
2076 -- lit_config.fatal('No LLVM libs dir set!')
2077 --shlibpath = os.path.pathsep.join((llvm_shlib_dir, llvm_libs_dir,
2078 -- config.environment.get(shlibpath_var,'')))
2079 --
2080 --config.environment[shlibpath_var] = shlibpath
2081 -+def find_shlibpath_var():
2082 -+ if platform.system() in ['Linux', 'FreeBSD', 'NetBSD']:
2083 -+ yield 'LD_LIBRARY_PATH'
2084 -+ elif platform.system() == 'Darwin':
2085 -+ yield 'DYLD_LIBRARY_PATH'
2086 -+ elif platform.system() == 'Windows':
2087 -+ yield 'PATH'
2088 -+
2089 -+for shlibpath_var in find_shlibpath_var():
2090 -+ # in stand-alone builds, shlibdir is clang's build tree
2091 -+ # while llvm_libs_dir is installed LLVM (and possibly older clang)
2092 -+ shlibpath = os.path.pathsep.join(
2093 -+ (config.shlibdir,
2094 -+ config.llvm_libs_dir,
2095 -+ config.environment.get(shlibpath_var, '')))
2096 -+ config.environment[shlibpath_var] = shlibpath
2097 -+ break
2098 -+else:
2099 -+ lit_config.warning("unable to inject shared library path on '{}'"
2100 -+ .format(platform.system()))
2101 ---
2102 -2.17.0.rc2
2103 -
2104
2105 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
2106 deleted file mode 100644
2107 index 68770a6..0000000
2108 --- a/sys-devel/clang/files/5.0.1/0003-Add-Gentoo-Linux-distro.patch
2109 +++ /dev/null
2110 @@ -1,33 +0,0 @@
2111 ---- a/include/clang/Driver/Distro.h
2112 -+++ b/include/clang/Driver/Distro.h
2113 -@@ -26,6 +26,7 @@ public:
2114 - // NB: Releases of a particular Linux distro should be kept together
2115 - // in this enum, because some tests are done by integer comparison against
2116 - // the first and last known member in the family, e.g. IsRedHat().
2117 -+ GentooLinux,
2118 - ArchLinux,
2119 - DebianLenny,
2120 - DebianSqueeze,
2121 -@@ -98,6 +99,10 @@ public:
2122 - /// @name Convenience Predicates
2123 - /// @{
2124 -
2125 -+ bool IsGentooLinux() const {
2126 -+ return DistroVal == GentooLinux;
2127 -+ }
2128 -+
2129 - bool IsRedhat() const {
2130 - return DistroVal == Fedora || (DistroVal >= RHEL5 && DistroVal <= RHEL7);
2131 - }
2132 ---- a/lib/Driver/Distro.cpp
2133 -+++ b/lib/Driver/Distro.cpp
2134 -@@ -129,6 +129,9 @@ static Distro::DistroType DetectDistro(vfs::FileSystem &VFS) {
2135 - if (VFS.exists("/etc/arch-release"))
2136 - return Distro::ArchLinux;
2137 -
2138 -+ if (VFS.exists("/etc/gentoo-release"))
2139 -+ return Distro::GentooLinux;
2140 -+
2141 - return Distro::UnknownDistro;
2142 - }
2143 -
2144
2145 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
2146 deleted file mode 100644
2147 index cbdb0b8..0000000
2148 --- a/sys-devel/clang/files/5.0.1/extra/0001-Assume-the-shared-library-path-variable-is-LD_LIBRAR.patch
2149 +++ /dev/null
2150 @@ -1,37 +0,0 @@
2151 -From 5c5bb3948697f2ca184a03dedd5666eb2de547ba Mon Sep 17 00:00:00 2001
2152 -From: Dimitry Andric <dimitry@××××××.com>
2153 -Date: Sat, 20 Jan 2018 14:34:33 +0000
2154 -Subject: [PATCH] Assume the shared library path variable is LD_LIBRARY_PATH on
2155 - systems except Darwin and Windows. This prevents inserting an environment
2156 - variable with an empty name (which is illegal and leads to a Python
2157 - exception) on any of the BSDs.
2158 -
2159 -git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@323040 91177308-0d34-0410-b5e6-96231b3b80d8
2160 ----
2161 - test/Unit/lit.cfg | 7 +++----
2162 - 1 file changed, 3 insertions(+), 4 deletions(-)
2163 -
2164 -diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg
2165 -index fc63afdb..b40e1cae 100644
2166 ---- a/test/Unit/lit.cfg
2167 -+++ b/test/Unit/lit.cfg
2168 -@@ -19,13 +19,12 @@ config.test_exec_root = config.test_source_root
2169 - # ;-separated list of subdirectories).
2170 - config.test_format = lit.formats.GoogleTest('.', 'Tests')
2171 -
2172 --shlibpath_var = ''
2173 --if platform.system() == 'Linux':
2174 -- shlibpath_var = 'LD_LIBRARY_PATH'
2175 --elif platform.system() == 'Darwin':
2176 -+if platform.system() == 'Darwin':
2177 - shlibpath_var = 'DYLD_LIBRARY_PATH'
2178 - elif platform.system() == 'Windows':
2179 - shlibpath_var = 'PATH'
2180 -+else:
2181 -+ shlibpath_var = 'LD_LIBRARY_PATH'
2182 -
2183 - # Point the dynamic loader at dynamic libraries in 'lib'.
2184 - shlibpath = os.path.pathsep.join((config.shlibdir, config.llvm_libs_dir,
2185 ---
2186 -2.17.0.rc2
2187 -
2188
2189 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
2190 deleted file mode 100644
2191 index eeda778..0000000
2192 --- a/sys-devel/clang/files/5.0.1/hardened/0001-Use-z-relro-on-Gentoo.patch
2193 +++ /dev/null
2194 @@ -1,11 +0,0 @@
2195 ---- a/lib/Driver/ToolChains/Linux.cpp
2196 -+++ b/lib/Driver/ToolChains/Linux.cpp
2197 -@@ -210,7 +210,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
2198 -
2199 - Distro Distro(D.getVFS());
2200 -
2201 -- if (Distro.IsOpenSUSE() || Distro.IsUbuntu()) {
2202 -+ if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsGentooLinux()) {
2203 - ExtraOpts.push_back("-z");
2204 - ExtraOpts.push_back("relro");
2205 - }
2206
2207 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
2208 deleted file mode 100644
2209 index 2f5faf5..0000000
2210 --- a/sys-devel/clang/files/5.0.1/hardened/0002-Enable-Stack-Protector-by-default.patch
2211 +++ /dev/null
2212 @@ -1,25 +0,0 @@
2213 ---- a/lib/Driver/ToolChains/Linux.cpp
2214 -+++ b/lib/Driver/ToolChains/Linux.cpp
2215 -@@ -820,6 +820,10 @@ bool Linux::isPIEDefault() const {
2216 - getTriple().isMusl() || getSanitizerArgs().requiresPIE();
2217 - }
2218 -
2219 -+unsigned Linux::GetDefaultStackProtectorLevel(bool KernelOrKext) const {
2220 -+ return 2;
2221 -+}
2222 -+
2223 - SanitizerMask Linux::getSupportedSanitizers() const {
2224 - const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
2225 - const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
2226 -diff --git a/lib/Driver/ToolChains/Linux.h b/lib/Driver/ToolChains/Linux.h
2227 -index 9778c1832cc..ddd46a1d587 100644
2228 ---- a/lib/Driver/ToolChains/Linux.h
2229 -+++ b/lib/Driver/ToolChains/Linux.h
2230 -@@ -36,6 +36,7 @@ public:
2231 - void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs,
2232 - llvm::opt::ArgStringList &CC1Args) const override;
2233 - bool isPIEDefault() const override;
2234 -+ unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override;
2235 - SanitizerMask getSupportedSanitizers() const override;
2236 - void addProfileRTLibs(const llvm::opt::ArgList &Args,
2237 - llvm::opt::ArgStringList &CmdArgs) const override;
2238
2239 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
2240 deleted file mode 100644
2241 index 301ee11..0000000
2242 --- a/sys-devel/clang/files/5.0.1/hardened/0003-Enable-PIE-by-default.patch
2243 +++ /dev/null
2244 @@ -1,24 +0,0 @@
2245 ---- a/lib/Driver/ToolChains/Gnu.cpp
2246 -+++ b/lib/Driver/ToolChains/Gnu.cpp
2247 -@@ -443,7 +443,9 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
2248 - if (!D.SysRoot.empty())
2249 - CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
2250 -
2251 -- if (IsPIE)
2252 -+ if (Args.hasArg(options::OPT_nopie))
2253 -+ CmdArgs.push_back("-nopie");
2254 -+ else if (IsPIE)
2255 - CmdArgs.push_back("-pie");
2256 -
2257 - if (Args.hasArg(options::OPT_rdynamic))
2258 ---- a/lib/Driver/ToolChains/Linux.cpp
2259 -+++ b/lib/Driver/ToolChains/Linux.cpp
2260 -@@ -819,7 +819,7 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs,
2261 - }
2262 - }
2263 -
2264 --bool Linux::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); }
2265 -+bool Linux::isPIEDefault() const { return true; }
2266 -
2267 - SanitizerMask Linux::getSupportedSanitizers() const {
2268 - const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
2269
2270 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
2271 deleted file mode 100644
2272 index 410bae9..0000000
2273 --- a/sys-devel/clang/files/5.0.1/hardened/0004-Enable-FORTIFY_SOURCE-macro-by-default.patch
2274 +++ /dev/null
2275 @@ -1,35 +0,0 @@
2276 -From 68d39575cdff576b85907bea8e42b7ef26384dbb Mon Sep 17 00:00:00 2001
2277 -From: Matthias Dahl <matthias.dahl@×××××××××××××.eu>
2278 -Date: Wed, 20 Sep 2017 16:17:31 +0200
2279 -Subject: [PATCH 3/3] Enable FORTIFY_SOURCE macro by default
2280 -
2281 -FORTIFY_SOURCE only works for optimization levels > 0 and is currently not
2282 -compatible with the address sanitizer, thus the macro is only set if the input
2283 -language is C or C++ and the optimization level > 0 while the address sanitizer
2284 -is not requested.
2285 ----
2286 - lib/Frontend/CompilerInvocation.cpp | 8 ++++++++
2287 - 1 file changed, 8 insertions(+)
2288 -
2289 -diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
2290 -index 0d0869c815d..88c16534103 100644
2291 ---- a/lib/Frontend/CompilerInvocation.cpp
2292 -+++ b/lib/Frontend/CompilerInvocation.cpp
2293 -@@ -2694,6 +2694,14 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
2294 - !LangOpts.Sanitize.has(SanitizerKind::Address) &&
2295 - !LangOpts.Sanitize.has(SanitizerKind::Memory);
2296 -
2297 -+ // Set the macro before the command line macros are being processed, so it can be
2298 -+ // properly unset if required to in case of incompatibilities.
2299 -+ if (Res.getCodeGenOpts().OptimizationLevel > 0 &&
2300 -+ (DashX.getLanguage() == InputKind::C || DashX.getLanguage() == InputKind::CXX) &&
2301 -+ !LangOpts.Sanitize.has(SanitizerKind::Address)) {
2302 -+ Res.getPreprocessorOpts().addMacroDef("_FORTIFY_SOURCE=2");
2303 -+ }
2304 -+
2305 - // FIXME: ParsePreprocessorArgs uses the FileManager to read the contents of
2306 - // PCH file and find the original header name. Remove the need to do that in
2307 - // ParsePreprocessorArgs and remove the FileManager
2308 ---
2309 -2.14.1
2310 -
2311
2312 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
2313 deleted file mode 100644
2314 index ff0642f..0000000
2315 --- a/sys-devel/clang/files/5.0.1/hardened/0005-Link-with-z-now-by-default-for-Gentoo.patch
2316 +++ /dev/null
2317 @@ -1,14 +0,0 @@
2318 ---- a/lib/Driver/ToolChains/Linux.cpp
2319 -+++ b/lib/Driver/ToolChains/Linux.cpp
2320 -@@ -212,6 +212,11 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
2321 -
2322 - Distro Distro(D.getVFS());
2323 -
2324 -+ if (Distro.IsGentooLinux()) {
2325 -+ ExtraOpts.push_back("-z");
2326 -+ ExtraOpts.push_back("now");
2327 -+ }
2328 -+
2329 - if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsGentooLinux()) {
2330 - ExtraOpts.push_back("-z");
2331 - ExtraOpts.push_back("relro");
2332
2333 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
2334 similarity index 100%
2335 rename from sys-devel/clang/files/5.0.1/darwin_prefix-include-paths.patch
2336 rename to sys-devel/clang/files/6.0.1/darwin_prefix-include-paths.patch