Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/compiler-rt-sanitizers/
Date: Fri, 21 Jan 2022 15:38:35
Message-Id: 1642779454.d89008a6b916cd5381439b811c687e66ff40c2bc.mgorny@gentoo
1 commit: d89008a6b916cd5381439b811c687e66ff40c2bc
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 21 12:15:40 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 21 15:37:34 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d89008a6
7
8 sys-libs/compiler-rt-sanitizers: Remove 13.0.1-rc{1,2}
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 sys-libs/compiler-rt-sanitizers/Manifest | 4 -
13 .../compiler-rt-sanitizers-13.0.1_rc1.ebuild | 215 ---------------------
14 .../compiler-rt-sanitizers-13.0.1_rc2.ebuild | 215 ---------------------
15 3 files changed, 434 deletions(-)
16
17 diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
18 index 6f17b642d1e6..017ab72fa6d1 100644
19 --- a/sys-libs/compiler-rt-sanitizers/Manifest
20 +++ b/sys-libs/compiler-rt-sanitizers/Manifest
21 @@ -2,13 +2,9 @@ DIST llvm-gentoo-patchset-11.1.0-3.tar.xz 5984 BLAKE2B 89056fb8e82c7a29ae76c643a
22 DIST llvm-gentoo-patchset-12.0.1.tar.xz 5280 BLAKE2B 963d005bc7b636570be90eb841ac5bcaeb927538cc7de27683167111a17d6496677c7517de2ecfaf14b5d8ac22bad357be490b8a2ed9aba502fd5f447ecc99e9 SHA512 fc7c38e671555751650299c3a8bee44d5c7f26e11b68d5538c507fb7fe9ff2d349bdcd43bce90a448a747f082d523b3849d6bcda5e3ae2e998edcb926d6aa249
23 DIST llvm-gentoo-patchset-13.0.0-r3.tar.xz 10176 BLAKE2B fc5825a4bd3b85bd9c970901e5e036cc4c928373495a8a6f63c7f4531c7f52575d06f80dfbd80671d9f0fcd32d5c48d96f5961602b024c7a936362aeba8a612a SHA512 2289eef3f6301ade2e1110ebc4b66ad3db91ed10868ca7296a29c55667007e06739b01f38c0783bb2c56deadfb8a04605c370df9c5a4c6bc9aea9382e6ed52a5
24 DIST llvm-gentoo-patchset-13.0.0.tar.xz 5012 BLAKE2B 6760c78c086aaf6629143fd920b0a2c68cad9278628fbea8164dfeb59db95984a5b5d6b3505b510c697e8c95bf8d2be782c6b73c01622d52f2da9b07ecff39e0 SHA512 7764d49343b795b6bebae64f646ba27e3e6cc2a20b8a1aee645ce0d8474633c34acfbb73c08546fee415755dd4ea5a98c1d84db5e394cf5f4fc802eb61148ab6
25 -DIST llvm-gentoo-patchset-13.0.1-rc1.tar.xz 5988 BLAKE2B 8f1d295d4b6937518d9e0cc00cc2ba9e12ff9773b35261f0985b2d2a4ed1e3363a7f961cb385728b5ae552d0e129d99d11e63958d32c3353b0a79a88ba5cc0d5 SHA512 8272c423a5e0e99d412bb449794ba2e8134aca69d09e90e93555dbd3b7549d6ce4d68617ca11074af0a35a6f6830bf0330cbc672c5a56054cfd824e3ac1900ea
26 -DIST llvm-gentoo-patchset-13.0.1-rc2.tar.xz 5192 BLAKE2B 4a129a3d0b7c1839d79c814ea57602f5e87aadb9050fc8e91868d2c3773ff7ae8e2137f785deeded6925a4368220767526c95790c9883f2031edc3ebae25b13c SHA512 2f384281d06f5378f7d1b2f036958c7db00d1c4d799406fd188fa8388f0cf18279dae36f2fb37bff26daa91419ab1bc1c2390be0f3af42359f1aef8de81b6ac8
27 DIST llvm-gentoo-patchset-13.0.1-rc3.tar.xz 4808 BLAKE2B d8ed3ae424914437413e2e8c029880072e93d79ca79b842ad59451df46594c9b0d73ee5d49d3b65c4c7a40c86b2e0d43501ef106aea7c481f22425a5245a3411 SHA512 10430a720b120a340a681fa435a7f050741c75270607e3f5214bf829313d274c11f019f1ac072857dc5d7f868e6eb013932d1c94446e8cb2e151ac818a081914
28 DIST llvm-gentoo-patchset-9999-1.tar.xz 4032 BLAKE2B b9413484dafed8ae0c68c2c164b45fd07bb8d5d0898f03abe118fd2120ffcb1fb6c949de9649a97c2e8105f24b9d131a725c67c0a502ca4d4d192c1a0d65f49d SHA512 e64449eeaf756c5bd945109937b84ba4bd8a015222bd792d39cf3947871e87571a4ca57814790e51544cb05ad4c2d1f044e818e4caaac7c2e2a02cb1aa290fcc
29 DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
30 DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
31 DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
32 -DIST llvmorg-13.0.1-rc1.tar.gz 147284646 BLAKE2B 3a1d8d382de633b7f8fc998f8ad1e03c24b733aefc591615cbd34115d1d6d74962ae33bbf2224527b521a76930ffee425527225563a558a04173e9aa9487c781 SHA512 d487bfc9b898ad0046e0c94338d7757d8a05a1a84d683abfbc9ed4994c6d12caf88fd18575225e284070fc67b3ac0970ca6639e61b1a7cc2948b216a5364a22d
33 -DIST llvmorg-13.0.1-rc2.tar.gz 147304491 BLAKE2B 86b2c64e57e4aaab837229b25a95d5517ac077d22cf552d71ff6b996dbdbcd171ad51de7eb12d098b50a139beda4ace843727181a1c6978fc487215391e64a3a SHA512 0d890f3317504c8cef10e118b245e5a4c815cc19f07cbc511a66bde6c9b1f3d15c167942608a8987befe9115b24657d29f72305f9f2794385a7434b80167f40f
34 DIST llvmorg-13.0.1-rc3.tar.gz 147302323 BLAKE2B 9ac2f97568062d7dd618295a68d6e14898fcd69e2bb66290b999ceb8c12132371f4e9b59d8ba2b252e5e5cb249045676b24fc50c117b2afae20abab98f426582 SHA512 88a04ad02af2d41ec21c7a62bad21ee0e627b7276a16795875afd062ed29ac7fb4aadec5b5e48785a6502c9fd797a4b67d648a21f193c9f7602112870b10a3d1
35
36 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc1.ebuild
37 deleted file mode 100644
38 index 203bcf1a2488..000000000000
39 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc1.ebuild
40 +++ /dev/null
41 @@ -1,215 +0,0 @@
42 -# Copyright 1999-2022 Gentoo Authors
43 -# Distributed under the terms of the GNU General Public License v2
44 -
45 -EAPI=7
46 -
47 -PYTHON_COMPAT=( python3_{8..10} )
48 -inherit check-reqs cmake flag-o-matic llvm llvm.org python-any-r1
49 -
50 -DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
51 -HOMEPAGE="https://llvm.org/"
52 -
53 -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
54 -SLOT="$(ver_cut 1-3)"
55 -KEYWORDS=""
56 -IUSE="+abi_x86_32 abi_x86_64 +clang debug test"
57 -# base targets
58 -IUSE+=" +libfuzzer +memprof +orc +profile +xray"
59 -# sanitizer targets, keep in sync with config-ix.cmake
60 -# NB: ubsan, scudo deliberately match two entries
61 -SANITIZER_FLAGS=(
62 - asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo
63 - shadowcallstack gwp-asan
64 -)
65 -IUSE+=" ${SANITIZER_FLAGS[@]/#/+}"
66 -REQUIRED_USE="
67 - || ( ${SANITIZER_FLAGS[*]} libfuzzer orc profile xray )
68 - test? (
69 - cfi? ( ubsan )
70 - gwp-asan? ( scudo )
71 - )"
72 -RESTRICT="!test? ( test ) !clang? ( test )"
73 -
74 -CLANG_SLOT=${SLOT%%.*}
75 -# llvm-6 for new lit options
76 -DEPEND="
77 - >=sys-devel/llvm-6
78 - virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?]"
79 -BDEPEND="
80 - >=dev-util/cmake-3.16
81 - clang? ( sys-devel/clang )
82 - elibc_glibc? ( net-libs/libtirpc )
83 - test? (
84 - !<sys-apps/sandbox-2.13
85 - $(python_gen_any_dep ">=dev-python/lit-5[\${PYTHON_USEDEP}]")
86 - =sys-devel/clang-${PV%_*}*:${CLANG_SLOT}
87 - sys-libs/compiler-rt:${SLOT}
88 - )
89 - !test? (
90 - ${PYTHON_DEPS}
91 - )"
92 -
93 -LLVM_COMPONENTS=( compiler-rt )
94 -LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest )
95 -LLVM_PATCHSET=${PV/_/-}
96 -llvm.org_set_globals
97 -
98 -python_check_deps() {
99 - use test || return 0
100 - has_version "dev-python/lit[${PYTHON_USEDEP}]"
101 -}
102 -
103 -check_space() {
104 - if use test; then
105 - local CHECKREQS_DISK_BUILD=11G
106 - check-reqs_pkg_pretend
107 - fi
108 -}
109 -
110 -pkg_pretend() {
111 - check_space
112 -}
113 -
114 -pkg_setup() {
115 - check_space
116 - llvm_pkg_setup
117 - python-any-r1_pkg_setup
118 -}
119 -
120 -src_prepare() {
121 - sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die
122 -
123 - local flag
124 - for flag in "${SANITIZER_FLAGS[@]}"; do
125 - if ! use "${flag}"; then
126 - local cmake_flag=${flag/-/_}
127 - sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \
128 - cmake/config-ix.cmake || die
129 - fi
130 - done
131 -
132 - # TODO: fix these tests to be skipped upstream
133 - if use asan && ! use profile; then
134 - rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die
135 - fi
136 - if use ubsan && ! use cfi; then
137 - > test/cfi/CMakeLists.txt || die
138 - fi
139 -
140 - llvm.org_src_prepare
141 -}
142 -
143 -src_configure() {
144 - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
145 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
146 -
147 - # pre-set since we need to pass it to cmake
148 - BUILD_DIR=${WORKDIR}/compiler-rt_build
149 -
150 - if use clang; then
151 - local -x CC=${CHOST}-clang
152 - local -x CXX=${CHOST}-clang++
153 - strip-unsupported-flags
154 - fi
155 -
156 - local flag want_sanitizer=OFF
157 - for flag in "${SANITIZER_FLAGS[@]}"; do
158 - if use "${flag}"; then
159 - want_sanitizer=ON
160 - break
161 - fi
162 - done
163 -
164 - local mycmakeargs=(
165 - -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
166 - # use a build dir structure consistent with install
167 - # this makes it possible to easily deploy test-friendly clang
168 - -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}"
169 -
170 - -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
171 - # builtins & crt installed by sys-libs/compiler-rt
172 - -DCOMPILER_RT_BUILD_BUILTINS=OFF
173 - -DCOMPILER_RT_BUILD_CRT=OFF
174 - -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer)
175 - -DCOMPILER_RT_BUILD_MEMPROF=$(usex memprof)
176 - -DCOMPILER_RT_BUILD_ORC=$(usex orc)
177 - -DCOMPILER_RT_BUILD_PROFILE=$(usex profile)
178 - -DCOMPILER_RT_BUILD_SANITIZERS="${want_sanitizer}"
179 - -DCOMPILER_RT_BUILD_XRAY=$(usex xray)
180 -
181 - -DPython3_EXECUTABLE="${PYTHON}"
182 - )
183 -
184 - if use amd64; then
185 - mycmakeargs+=(
186 - -DCAN_TARGET_i386=$(usex abi_x86_32)
187 - -DCAN_TARGET_x86_64=$(usex abi_x86_64)
188 - )
189 - fi
190 -
191 - if use test; then
192 - mycmakeargs+=(
193 - -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
194 - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
195 - -DLLVM_LIT_ARGS="$(get_lit_flags)"
196 -
197 - # they are created during src_test()
198 - -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${CLANG_SLOT}/bin/clang"
199 - -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${CLANG_SLOT}/bin/clang++"
200 - )
201 -
202 - # same flags are passed for build & tests, so we need to strip
203 - # them down to a subset supported by clang
204 - CC=${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang \
205 - CXX=${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang++ \
206 - strip-unsupported-flags
207 - fi
208 -
209 - if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then
210 - mycmakeargs+=(
211 - # setting -isysroot is disabled with compiler-rt-prefix-paths.patch
212 - # this allows adding arm64 support using SDK in EPREFIX
213 - -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk"
214 - # Set version based on the SDK in EPREFIX
215 - # This disables i386 for SDK >= 10.15
216 - # Will error if has_use tsan and SDK < 10.12
217 - -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')"
218 - # Use our libtool instead of looking it up with xcrun
219 - -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
220 - )
221 - fi
222 -
223 - cmake_src_configure
224 -
225 - if use test; then
226 - local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* )
227 - [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}"
228 - [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}"
229 -
230 - # copy clang over since resource_dir is located relatively to binary
231 - # therefore, we can put our new libraries in it
232 - mkdir -p "${BUILD_DIR}"/lib/{llvm/${CLANG_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die
233 - cp "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/bin/clang{,++} \
234 - "${BUILD_DIR}"/lib/llvm/${CLANG_SLOT}/bin/ || die
235 - cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \
236 - "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die
237 - cp "${sys_dir}"/*builtins*.a \
238 - "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die
239 - # we also need LLVMgold.so for gold-based tests
240 - if [[ -f ${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
241 - ln -s "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so \
242 - "${BUILD_DIR}"/lib/llvm/${CLANG_SLOT}/$(get_libdir)/ || die
243 - fi
244 - fi
245 -}
246 -
247 -src_test() {
248 - # respect TMPDIR!
249 - local -x LIT_PRESERVES_TMP=1
250 - # disable sandbox to have it stop clobbering LD_PRELOAD
251 - local -x SANDBOX_ON=0
252 - # wipe LD_PRELOAD to make ASAN happy
253 - local -x LD_PRELOAD=
254 -
255 - cmake_build check-all
256 -}
257
258 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc2.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc2.ebuild
259 deleted file mode 100644
260 index 203bcf1a2488..000000000000
261 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-13.0.1_rc2.ebuild
262 +++ /dev/null
263 @@ -1,215 +0,0 @@
264 -# Copyright 1999-2022 Gentoo Authors
265 -# Distributed under the terms of the GNU General Public License v2
266 -
267 -EAPI=7
268 -
269 -PYTHON_COMPAT=( python3_{8..10} )
270 -inherit check-reqs cmake flag-o-matic llvm llvm.org python-any-r1
271 -
272 -DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
273 -HOMEPAGE="https://llvm.org/"
274 -
275 -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
276 -SLOT="$(ver_cut 1-3)"
277 -KEYWORDS=""
278 -IUSE="+abi_x86_32 abi_x86_64 +clang debug test"
279 -# base targets
280 -IUSE+=" +libfuzzer +memprof +orc +profile +xray"
281 -# sanitizer targets, keep in sync with config-ix.cmake
282 -# NB: ubsan, scudo deliberately match two entries
283 -SANITIZER_FLAGS=(
284 - asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo
285 - shadowcallstack gwp-asan
286 -)
287 -IUSE+=" ${SANITIZER_FLAGS[@]/#/+}"
288 -REQUIRED_USE="
289 - || ( ${SANITIZER_FLAGS[*]} libfuzzer orc profile xray )
290 - test? (
291 - cfi? ( ubsan )
292 - gwp-asan? ( scudo )
293 - )"
294 -RESTRICT="!test? ( test ) !clang? ( test )"
295 -
296 -CLANG_SLOT=${SLOT%%.*}
297 -# llvm-6 for new lit options
298 -DEPEND="
299 - >=sys-devel/llvm-6
300 - virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?]"
301 -BDEPEND="
302 - >=dev-util/cmake-3.16
303 - clang? ( sys-devel/clang )
304 - elibc_glibc? ( net-libs/libtirpc )
305 - test? (
306 - !<sys-apps/sandbox-2.13
307 - $(python_gen_any_dep ">=dev-python/lit-5[\${PYTHON_USEDEP}]")
308 - =sys-devel/clang-${PV%_*}*:${CLANG_SLOT}
309 - sys-libs/compiler-rt:${SLOT}
310 - )
311 - !test? (
312 - ${PYTHON_DEPS}
313 - )"
314 -
315 -LLVM_COMPONENTS=( compiler-rt )
316 -LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest )
317 -LLVM_PATCHSET=${PV/_/-}
318 -llvm.org_set_globals
319 -
320 -python_check_deps() {
321 - use test || return 0
322 - has_version "dev-python/lit[${PYTHON_USEDEP}]"
323 -}
324 -
325 -check_space() {
326 - if use test; then
327 - local CHECKREQS_DISK_BUILD=11G
328 - check-reqs_pkg_pretend
329 - fi
330 -}
331 -
332 -pkg_pretend() {
333 - check_space
334 -}
335 -
336 -pkg_setup() {
337 - check_space
338 - llvm_pkg_setup
339 - python-any-r1_pkg_setup
340 -}
341 -
342 -src_prepare() {
343 - sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die
344 -
345 - local flag
346 - for flag in "${SANITIZER_FLAGS[@]}"; do
347 - if ! use "${flag}"; then
348 - local cmake_flag=${flag/-/_}
349 - sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \
350 - cmake/config-ix.cmake || die
351 - fi
352 - done
353 -
354 - # TODO: fix these tests to be skipped upstream
355 - if use asan && ! use profile; then
356 - rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die
357 - fi
358 - if use ubsan && ! use cfi; then
359 - > test/cfi/CMakeLists.txt || die
360 - fi
361 -
362 - llvm.org_src_prepare
363 -}
364 -
365 -src_configure() {
366 - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
367 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
368 -
369 - # pre-set since we need to pass it to cmake
370 - BUILD_DIR=${WORKDIR}/compiler-rt_build
371 -
372 - if use clang; then
373 - local -x CC=${CHOST}-clang
374 - local -x CXX=${CHOST}-clang++
375 - strip-unsupported-flags
376 - fi
377 -
378 - local flag want_sanitizer=OFF
379 - for flag in "${SANITIZER_FLAGS[@]}"; do
380 - if use "${flag}"; then
381 - want_sanitizer=ON
382 - break
383 - fi
384 - done
385 -
386 - local mycmakeargs=(
387 - -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
388 - # use a build dir structure consistent with install
389 - # this makes it possible to easily deploy test-friendly clang
390 - -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}"
391 -
392 - -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
393 - # builtins & crt installed by sys-libs/compiler-rt
394 - -DCOMPILER_RT_BUILD_BUILTINS=OFF
395 - -DCOMPILER_RT_BUILD_CRT=OFF
396 - -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer)
397 - -DCOMPILER_RT_BUILD_MEMPROF=$(usex memprof)
398 - -DCOMPILER_RT_BUILD_ORC=$(usex orc)
399 - -DCOMPILER_RT_BUILD_PROFILE=$(usex profile)
400 - -DCOMPILER_RT_BUILD_SANITIZERS="${want_sanitizer}"
401 - -DCOMPILER_RT_BUILD_XRAY=$(usex xray)
402 -
403 - -DPython3_EXECUTABLE="${PYTHON}"
404 - )
405 -
406 - if use amd64; then
407 - mycmakeargs+=(
408 - -DCAN_TARGET_i386=$(usex abi_x86_32)
409 - -DCAN_TARGET_x86_64=$(usex abi_x86_64)
410 - )
411 - fi
412 -
413 - if use test; then
414 - mycmakeargs+=(
415 - -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
416 - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
417 - -DLLVM_LIT_ARGS="$(get_lit_flags)"
418 -
419 - # they are created during src_test()
420 - -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${CLANG_SLOT}/bin/clang"
421 - -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${CLANG_SLOT}/bin/clang++"
422 - )
423 -
424 - # same flags are passed for build & tests, so we need to strip
425 - # them down to a subset supported by clang
426 - CC=${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang \
427 - CXX=${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang++ \
428 - strip-unsupported-flags
429 - fi
430 -
431 - if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then
432 - mycmakeargs+=(
433 - # setting -isysroot is disabled with compiler-rt-prefix-paths.patch
434 - # this allows adding arm64 support using SDK in EPREFIX
435 - -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk"
436 - # Set version based on the SDK in EPREFIX
437 - # This disables i386 for SDK >= 10.15
438 - # Will error if has_use tsan and SDK < 10.12
439 - -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')"
440 - # Use our libtool instead of looking it up with xcrun
441 - -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
442 - )
443 - fi
444 -
445 - cmake_src_configure
446 -
447 - if use test; then
448 - local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* )
449 - [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}"
450 - [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}"
451 -
452 - # copy clang over since resource_dir is located relatively to binary
453 - # therefore, we can put our new libraries in it
454 - mkdir -p "${BUILD_DIR}"/lib/{llvm/${CLANG_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die
455 - cp "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/bin/clang{,++} \
456 - "${BUILD_DIR}"/lib/llvm/${CLANG_SLOT}/bin/ || die
457 - cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \
458 - "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die
459 - cp "${sys_dir}"/*builtins*.a \
460 - "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die
461 - # we also need LLVMgold.so for gold-based tests
462 - if [[ -f ${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
463 - ln -s "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so \
464 - "${BUILD_DIR}"/lib/llvm/${CLANG_SLOT}/$(get_libdir)/ || die
465 - fi
466 - fi
467 -}
468 -
469 -src_test() {
470 - # respect TMPDIR!
471 - local -x LIT_PRESERVES_TMP=1
472 - # disable sandbox to have it stop clobbering LD_PRELOAD
473 - local -x SANDBOX_ON=0
474 - # wipe LD_PRELOAD to make ASAN happy
475 - local -x LD_PRELOAD=
476 -
477 - cmake_build check-all
478 -}