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