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