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