1 |
commit: d9ba06250217a629aa52865d39cb1b8300aa7d99 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Mar 18 07:39:17 2023 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Mar 18 15:03:11 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9ba0625 |
7 |
|
8 |
sys-libs/compiler-rt-sanitizers: Bump to 16.0.0 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-libs/compiler-rt-sanitizers/Manifest | 2 + |
13 |
.../compiler-rt-sanitizers-16.0.0.ebuild | 223 +++++++++++++++++++++ |
14 |
2 files changed, 225 insertions(+) |
15 |
|
16 |
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest |
17 |
index 2cb1614c504f..14953c635899 100644 |
18 |
--- a/sys-libs/compiler-rt-sanitizers/Manifest |
19 |
+++ b/sys-libs/compiler-rt-sanitizers/Manifest |
20 |
@@ -4,6 +4,8 @@ DIST llvm-project-14.0.6.src.tar.xz 105618228 BLAKE2B ee67c5407df8cef493b9c0004f |
21 |
DIST llvm-project-14.0.6.src.tar.xz.sig 566 BLAKE2B cb658ad43d8ab6c43a5773aedadf0569c97b5ee4b1bd58eceb10e1879a30880c741c3d66bedd462c892309b688fb7b2673115a62d1f74d71ee375a578de9547f SHA512 b4a7b368532a7a4a24376cfa7db8f6d3478f6d4446474342fc00b474ecf466330cd0f16783209263c4c72d5fc7ddedfb11b95578842e700cfb7ee0bb34cc95d6 |
22 |
DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52 |
23 |
DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2 |
24 |
+DIST llvm-project-16.0.0.src.tar.xz 117933476 BLAKE2B fa09cd8f647ce0daf5a7eae9ac03b99594a9b3193b12065f43f9a6731875243f2f5b354136bcadcb31622b246054e94f880eec3dab0bcd6ae89973fa9dca845c SHA512 3f040abc1b03205693824aeff2ee6efb0cff25fe04bd5265141c093f294655a1f3fcda73cab9c57cbed7523c8f186a7e2484afce0792c55e90e3fb80450fabb7 |
25 |
+DIST llvm-project-16.0.0.src.tar.xz.sig 566 BLAKE2B daba130aa5662fbf7cc2e7aa8fa6b64f9cb355a72330f7a01a21b86389c6f2f85ae93de19ff08ba3f1cfe2834d9a2b7648bdf659caba3afdb2a0d13984774a54 SHA512 38e2449dce20cfbf813d1a9a68b36807722ac8ebb5ee07360fa215b2de8534d2329d3e41cfc3ed33e59e36714b94a6683a6d8077950bcf0037973492e0820fb3 |
26 |
DIST llvm-project-16.0.0rc3.src.tar.xz 117914548 BLAKE2B 18ffa35eb73c7cc4626d7b6b7b30aade7171ee2e17fb8d72e79a67185e809f611fefa4cfef17e5cd16822a5a70de2222534dc9f146fc53987eb49ff6a9d98c18 SHA512 d14e5e5ec984a0dc0292a2d27440398b3e32f120c1579517054dcb1a05dbc4ac5f1c6d078a3d6ef8597a71af6f22863868680a972a571839dcd573418b4a4697 |
27 |
DIST llvm-project-16.0.0rc3.src.tar.xz.sig 566 BLAKE2B 43683d2d7b266a847516f71412bf6236a355462430330fc0da1d624fb8dfbc98bfc982d367baee74d5b4964a9e82e7a4a6ea84bdcff3996d246932f516cced1a SHA512 61adc4dc3eb5a4c11a7f96f9267ff37895e5845a08d48a609a03a2696c1b6bca5af5861a6f28de936c48e6d621bf282170589187f2cb593a912b9078300cf47c |
28 |
DIST llvm-project-16.0.0rc4.src.tar.xz 117930024 BLAKE2B 55cf032ad3ba52d2af0942fe1c627319ae95b466122d04b24a917c33e29139fae546d92c375715600190c02426b798803ead0ab7a97d86960cf98fca80e8815c SHA512 8d628205c5b93fe6683b67b97b5c7f98bae945bd87cccebcdac00ddd4362108bd171f077a5196242be0fb909c795592b34bfa1c96c50a744fb68f287fd9781cc |
29 |
|
30 |
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0.ebuild |
31 |
new file mode 100644 |
32 |
index 000000000000..d7d5778a3c8c |
33 |
--- /dev/null |
34 |
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0.ebuild |
35 |
@@ -0,0 +1,223 @@ |
36 |
+# Copyright 1999-2023 Gentoo Authors |
37 |
+# Distributed under the terms of the GNU General Public License v2 |
38 |
+ |
39 |
+EAPI=8 |
40 |
+ |
41 |
+PYTHON_COMPAT=( python3_{9..11} ) |
42 |
+inherit check-reqs cmake flag-o-matic llvm llvm.org python-any-r1 |
43 |
+ |
44 |
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" |
45 |
+HOMEPAGE="https://llvm.org/" |
46 |
+ |
47 |
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" |
48 |
+SLOT="${LLVM_MAJOR}" |
49 |
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86 ~amd64-linux ~ppc-macos ~x64-macos" |
50 |
+IUSE="+abi_x86_32 abi_x86_64 +clang debug test" |
51 |
+# base targets |
52 |
+IUSE+=" +libfuzzer +memprof +orc +profile +xray" |
53 |
+# sanitizer targets, keep in sync with config-ix.cmake |
54 |
+# NB: ubsan, scudo deliberately match two entries |
55 |
+SANITIZER_FLAGS=( |
56 |
+ asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo |
57 |
+ shadowcallstack gwp-asan |
58 |
+) |
59 |
+IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" |
60 |
+REQUIRED_USE=" |
61 |
+ || ( ${SANITIZER_FLAGS[*]} libfuzzer orc profile xray ) |
62 |
+ test? ( |
63 |
+ cfi? ( ubsan ) |
64 |
+ gwp-asan? ( scudo ) |
65 |
+ ) |
66 |
+" |
67 |
+RESTRICT=" |
68 |
+ !clang? ( test ) |
69 |
+ !test? ( test ) |
70 |
+" |
71 |
+ |
72 |
+DEPEND=" |
73 |
+ sys-devel/llvm:${LLVM_MAJOR} |
74 |
+ virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?] |
75 |
+" |
76 |
+BDEPEND=" |
77 |
+ >=dev-util/cmake-3.16 |
78 |
+ clang? ( sys-devel/clang ) |
79 |
+ elibc_glibc? ( net-libs/libtirpc ) |
80 |
+ test? ( |
81 |
+ $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") |
82 |
+ =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR} |
83 |
+ sys-libs/compiler-rt:${LLVM_MAJOR} |
84 |
+ ) |
85 |
+ !test? ( |
86 |
+ ${PYTHON_DEPS} |
87 |
+ ) |
88 |
+" |
89 |
+ |
90 |
+LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) |
91 |
+LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support third-party ) |
92 |
+llvm.org_set_globals |
93 |
+ |
94 |
+python_check_deps() { |
95 |
+ use test || return 0 |
96 |
+ python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]" |
97 |
+} |
98 |
+ |
99 |
+check_space() { |
100 |
+ if use test; then |
101 |
+ local CHECKREQS_DISK_BUILD=11G |
102 |
+ check-reqs_pkg_pretend |
103 |
+ fi |
104 |
+} |
105 |
+ |
106 |
+pkg_pretend() { |
107 |
+ check_space |
108 |
+} |
109 |
+ |
110 |
+pkg_setup() { |
111 |
+ check_space |
112 |
+ LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup |
113 |
+ python-any-r1_pkg_setup |
114 |
+} |
115 |
+ |
116 |
+src_prepare() { |
117 |
+ sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die |
118 |
+ |
119 |
+ local flag |
120 |
+ for flag in "${SANITIZER_FLAGS[@]}"; do |
121 |
+ if ! use "${flag}"; then |
122 |
+ local cmake_flag=${flag/-/_} |
123 |
+ sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \ |
124 |
+ cmake/config-ix.cmake || die |
125 |
+ fi |
126 |
+ done |
127 |
+ |
128 |
+ # TODO: fix these tests to be skipped upstream |
129 |
+ if use asan && ! use profile; then |
130 |
+ rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die |
131 |
+ fi |
132 |
+ if use ubsan && ! use cfi; then |
133 |
+ > test/cfi/CMakeLists.txt || die |
134 |
+ fi |
135 |
+ |
136 |
+ if has_version -b ">=sys-libs/glibc-2.37"; then |
137 |
+ # known failures with glibc-2.37 |
138 |
+ # https://github.com/llvm/llvm-project/issues/60678 |
139 |
+ rm test/dfsan/custom.cpp || die |
140 |
+ rm test/dfsan/release_shadow_space.c || die |
141 |
+ fi |
142 |
+ |
143 |
+ llvm.org_src_prepare |
144 |
+} |
145 |
+ |
146 |
+src_configure() { |
147 |
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 |
148 |
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" |
149 |
+ |
150 |
+ # pre-set since we need to pass it to cmake |
151 |
+ BUILD_DIR=${WORKDIR}/compiler-rt_build |
152 |
+ |
153 |
+ if use clang; then |
154 |
+ local -x CC=${CHOST}-clang |
155 |
+ local -x CXX=${CHOST}-clang++ |
156 |
+ strip-unsupported-flags |
157 |
+ fi |
158 |
+ |
159 |
+ local flag want_sanitizer=OFF |
160 |
+ for flag in "${SANITIZER_FLAGS[@]}"; do |
161 |
+ if use "${flag}"; then |
162 |
+ want_sanitizer=ON |
163 |
+ break |
164 |
+ fi |
165 |
+ done |
166 |
+ |
167 |
+ local mycmakeargs=( |
168 |
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}" |
169 |
+ # use a build dir structure consistent with install |
170 |
+ # this makes it possible to easily deploy test-friendly clang |
171 |
+ -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${LLVM_MAJOR}" |
172 |
+ |
173 |
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) |
174 |
+ # builtins & crt installed by sys-libs/compiler-rt |
175 |
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF |
176 |
+ -DCOMPILER_RT_BUILD_CRT=OFF |
177 |
+ -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer) |
178 |
+ -DCOMPILER_RT_BUILD_MEMPROF=$(usex memprof) |
179 |
+ -DCOMPILER_RT_BUILD_ORC=$(usex orc) |
180 |
+ -DCOMPILER_RT_BUILD_PROFILE=$(usex profile) |
181 |
+ -DCOMPILER_RT_BUILD_SANITIZERS="${want_sanitizer}" |
182 |
+ -DCOMPILER_RT_BUILD_XRAY=$(usex xray) |
183 |
+ |
184 |
+ -DPython3_EXECUTABLE="${PYTHON}" |
185 |
+ ) |
186 |
+ |
187 |
+ if use amd64; then |
188 |
+ mycmakeargs+=( |
189 |
+ -DCAN_TARGET_i386=$(usex abi_x86_32) |
190 |
+ -DCAN_TARGET_x86_64=$(usex abi_x86_64) |
191 |
+ ) |
192 |
+ fi |
193 |
+ |
194 |
+ if use test; then |
195 |
+ mycmakeargs+=( |
196 |
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
197 |
+ -DLLVM_LIT_ARGS="$(get_lit_flags)" |
198 |
+ |
199 |
+ # they are created during src_test() |
200 |
+ -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang" |
201 |
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang++" |
202 |
+ ) |
203 |
+ |
204 |
+ # same flags are passed for build & tests, so we need to strip |
205 |
+ # them down to a subset supported by clang |
206 |
+ CC=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang \ |
207 |
+ CXX=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++ \ |
208 |
+ strip-unsupported-flags |
209 |
+ fi |
210 |
+ |
211 |
+ if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then |
212 |
+ mycmakeargs+=( |
213 |
+ # setting -isysroot is disabled with compiler-rt-prefix-paths.patch |
214 |
+ # this allows adding arm64 support using SDK in EPREFIX |
215 |
+ -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk" |
216 |
+ # Set version based on the SDK in EPREFIX |
217 |
+ # This disables i386 for SDK >= 10.15 |
218 |
+ # Will error if has_use tsan and SDK < 10.12 |
219 |
+ -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')" |
220 |
+ # Use our libtool instead of looking it up with xcrun |
221 |
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool" |
222 |
+ ) |
223 |
+ fi |
224 |
+ |
225 |
+ cmake_src_configure |
226 |
+ |
227 |
+ if use test; then |
228 |
+ local sys_dir=( "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/lib/* ) |
229 |
+ [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}" |
230 |
+ [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}" |
231 |
+ |
232 |
+ # copy clang over since resource_dir is located relatively to binary |
233 |
+ # therefore, we can put our new libraries in it |
234 |
+ mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_MAJOR}/{bin,$(get_libdir)},clang/${LLVM_MAJOR}/include} || die |
235 |
+ cp "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/bin/clang{,++} \ |
236 |
+ "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/bin/ || die |
237 |
+ cp "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/include/*.h \ |
238 |
+ "${BUILD_DIR}"/lib/clang/${LLVM_MAJOR}/include/ || die |
239 |
+ cp "${sys_dir}"/*builtins*.a \ |
240 |
+ "${BUILD_DIR}/lib/clang/${LLVM_MAJOR}/lib/${sys_dir##*/}/" || die |
241 |
+ # we also need LLVMgold.so for gold-based tests |
242 |
+ if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so ]]; then |
243 |
+ ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so \ |
244 |
+ "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/ || die |
245 |
+ fi |
246 |
+ fi |
247 |
+} |
248 |
+ |
249 |
+src_test() { |
250 |
+ # respect TMPDIR! |
251 |
+ local -x LIT_PRESERVES_TMP=1 |
252 |
+ # disable sandbox to have it stop clobbering LD_PRELOAD |
253 |
+ local -x SANDBOX_ON=0 |
254 |
+ # wipe LD_PRELOAD to make ASAN happy |
255 |
+ local -x LD_PRELOAD= |
256 |
+ |
257 |
+ cmake_build check-all |
258 |
+} |