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