1 |
commit: 8af6b86239228e7951b1a2d170de2f6d47010c06 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Nov 4 14:19:52 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Nov 4 17:14:48 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8af6b862 |
7 |
|
8 |
sys-libs/compiler-rt-sanitizers: Add 16.0.0_pre20221104 |
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_pre20221104.ebuild | 218 +++++++++++++++++++++ |
14 |
2 files changed, 219 insertions(+) |
15 |
|
16 |
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest |
17 |
index 27a1df862a3c..106e98079c6f 100644 |
18 |
--- a/sys-libs/compiler-rt-sanitizers/Manifest |
19 |
+++ b/sys-libs/compiler-rt-sanitizers/Manifest |
20 |
@@ -10,5 +10,6 @@ DIST llvm-project-15.0.3.src.tar.xz 112069972 BLAKE2B 3d29bab890467ba87fedcc4e76 |
21 |
DIST llvm-project-15.0.3.src.tar.xz.sig 438 BLAKE2B e7e0614e144eb878f694c12e97cf42ff8476e47cb55e8f259eb2ec52e303463ad753771271512e89baf0137c1382b11cfa028c85324174ebcd054a124000f537 SHA512 41229bebdb0c2df9a5e3a4d6f02d39fac7dc91f21895a659523beab4fa3ef99ff06eff5e4386221369b6e2b6f8fe974d67b7d8496d5911ce484d09ae0db8b916 |
22 |
DIST llvm-project-15.0.4.src.tar.xz 110936424 BLAKE2B a02b76ad161e352b4d3d84baffdada9c6a0e704de7a2c4017df4d4d05a9e9d02113791cd7d91c3edfa1f5bcb7ab95e1772d60f7061514928c6828600f41a8322 SHA512 9d5b664dd77c08130601636f9d6c006b257f369470ce823aa56d06698a9f0edfec42f2c90da934b9ad52c4d7960d9a024ea46dc9640275be6d191b1ba9869459 |
23 |
DIST llvm-project-15.0.4.src.tar.xz.sig 566 BLAKE2B f1a7be65fcce932dc125ae2b498f68a14e68dad0d7a1e031343c52c5dafb7b123e346f3efa50a7693584361abf01efe9401b1b5781dee6b92dc1045e538e9b7b SHA512 35899ffbd13fc44cade54246a423450571cb4b62b8d706864daa3eef2377c48e24ef3113218e39e29de995b7f7fa307f9187552766576c9050fd924beb517f6e |
24 |
+DIST llvm-project-1fb186198af5f183dde053c1396f899567755d64.tar.gz 170328817 BLAKE2B c79199044e8d636127d1d163ceea856c1bcb1d59c892e9c72869ab788b4feb23f8c28585ac761764b4e29b883c61e43be9341610a523d8b64471200bb3aecfaa SHA512 8b366dc70506ceb70a5584ad051e100fa1cc620388fc757536ef775d102b4baaac016d4f62dbc8b1d9dd00b587622a25d9da735196d336faf35d611145cf5fdc |
25 |
DIST llvm-project-b34ea582774c057d9bf5591174d683fd3d8aa02b.tar.gz 169735900 BLAKE2B d3a82a07f855b038071fc8eb3f41a88b4c220a577219985ecddeb9a535ea8b159dbad575699997d90a49db74c074b5f4354ad707e91d6934daaa7319e0d8ee9b SHA512 3f5525c7d893bdac701cff4cf82dafc31608920d788d9b7401654f320b2432528cf4ae8ef013182807b3dc0c5b758c71f1efeedb672dd47fdb8aa6f434dfb583 |
26 |
DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f |
27 |
|
28 |
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0_pre20221104.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0_pre20221104.ebuild |
29 |
new file mode 100644 |
30 |
index 000000000000..ca5ba940552f |
31 |
--- /dev/null |
32 |
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0_pre20221104.ebuild |
33 |
@@ -0,0 +1,218 @@ |
34 |
+# Copyright 1999-2022 Gentoo Authors |
35 |
+# Distributed under the terms of the GNU General Public License v2 |
36 |
+ |
37 |
+EAPI=8 |
38 |
+ |
39 |
+PYTHON_COMPAT=( python3_{8..11} ) |
40 |
+inherit check-reqs cmake flag-o-matic llvm llvm.org python-any-r1 |
41 |
+ |
42 |
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" |
43 |
+HOMEPAGE="https://llvm.org/" |
44 |
+ |
45 |
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" |
46 |
+SLOT="${LLVM_VERSION}" |
47 |
+KEYWORDS="" |
48 |
+IUSE="+abi_x86_32 abi_x86_64 +clang debug test" |
49 |
+# base targets |
50 |
+IUSE+=" +libfuzzer +memprof +orc +profile +xray" |
51 |
+# sanitizer targets, keep in sync with config-ix.cmake |
52 |
+# NB: ubsan, scudo deliberately match two entries |
53 |
+SANITIZER_FLAGS=( |
54 |
+ asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo |
55 |
+ shadowcallstack gwp-asan |
56 |
+) |
57 |
+IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" |
58 |
+REQUIRED_USE=" |
59 |
+ || ( ${SANITIZER_FLAGS[*]} libfuzzer orc profile xray ) |
60 |
+ test? ( |
61 |
+ cfi? ( ubsan ) |
62 |
+ gwp-asan? ( scudo ) |
63 |
+ ) |
64 |
+" |
65 |
+RESTRICT=" |
66 |
+ !clang? ( test ) |
67 |
+ !test? ( test ) |
68 |
+" |
69 |
+ |
70 |
+DEPEND=" |
71 |
+ sys-devel/llvm:${LLVM_MAJOR} |
72 |
+ virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?] |
73 |
+" |
74 |
+BDEPEND=" |
75 |
+ >=dev-util/cmake-3.16 |
76 |
+ clang? ( sys-devel/clang ) |
77 |
+ elibc_glibc? ( net-libs/libtirpc ) |
78 |
+ test? ( |
79 |
+ !!<sys-apps/sandbox-2.13 |
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_VERSION} |
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 llvm/utils/unittest ) |
91 |
+LLVM_PATCHSET=9999-1 |
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 |
+ llvm.org_src_prepare |
137 |
+} |
138 |
+ |
139 |
+src_configure() { |
140 |
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 |
141 |
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" |
142 |
+ |
143 |
+ # pre-set since we need to pass it to cmake |
144 |
+ BUILD_DIR=${WORKDIR}/compiler-rt_build |
145 |
+ |
146 |
+ if use clang; then |
147 |
+ local -x CC=${CHOST}-clang |
148 |
+ local -x CXX=${CHOST}-clang++ |
149 |
+ strip-unsupported-flags |
150 |
+ fi |
151 |
+ |
152 |
+ local flag want_sanitizer=OFF |
153 |
+ for flag in "${SANITIZER_FLAGS[@]}"; do |
154 |
+ if use "${flag}"; then |
155 |
+ want_sanitizer=ON |
156 |
+ break |
157 |
+ fi |
158 |
+ done |
159 |
+ |
160 |
+ local mycmakeargs=( |
161 |
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_VERSION}" |
162 |
+ # use a build dir structure consistent with install |
163 |
+ # this makes it possible to easily deploy test-friendly clang |
164 |
+ -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${LLVM_VERSION}" |
165 |
+ |
166 |
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) |
167 |
+ # builtins & crt installed by sys-libs/compiler-rt |
168 |
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF |
169 |
+ -DCOMPILER_RT_BUILD_CRT=OFF |
170 |
+ -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer) |
171 |
+ -DCOMPILER_RT_BUILD_MEMPROF=$(usex memprof) |
172 |
+ -DCOMPILER_RT_BUILD_ORC=$(usex orc) |
173 |
+ -DCOMPILER_RT_BUILD_PROFILE=$(usex profile) |
174 |
+ -DCOMPILER_RT_BUILD_SANITIZERS="${want_sanitizer}" |
175 |
+ -DCOMPILER_RT_BUILD_XRAY=$(usex xray) |
176 |
+ |
177 |
+ -DPython3_EXECUTABLE="${PYTHON}" |
178 |
+ ) |
179 |
+ |
180 |
+ if use amd64; then |
181 |
+ mycmakeargs+=( |
182 |
+ -DCAN_TARGET_i386=$(usex abi_x86_32) |
183 |
+ -DCAN_TARGET_x86_64=$(usex abi_x86_64) |
184 |
+ ) |
185 |
+ fi |
186 |
+ |
187 |
+ if use test; then |
188 |
+ mycmakeargs+=( |
189 |
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
190 |
+ -DLLVM_LIT_ARGS="$(get_lit_flags)" |
191 |
+ |
192 |
+ # they are created during src_test() |
193 |
+ -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang" |
194 |
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang++" |
195 |
+ ) |
196 |
+ |
197 |
+ # same flags are passed for build & tests, so we need to strip |
198 |
+ # them down to a subset supported by clang |
199 |
+ CC=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang \ |
200 |
+ CXX=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++ \ |
201 |
+ strip-unsupported-flags |
202 |
+ fi |
203 |
+ |
204 |
+ if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then |
205 |
+ mycmakeargs+=( |
206 |
+ # setting -isysroot is disabled with compiler-rt-prefix-paths.patch |
207 |
+ # this allows adding arm64 support using SDK in EPREFIX |
208 |
+ -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk" |
209 |
+ # Set version based on the SDK in EPREFIX |
210 |
+ # This disables i386 for SDK >= 10.15 |
211 |
+ # Will error if has_use tsan and SDK < 10.12 |
212 |
+ -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')" |
213 |
+ # Use our libtool instead of looking it up with xcrun |
214 |
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool" |
215 |
+ ) |
216 |
+ fi |
217 |
+ |
218 |
+ cmake_src_configure |
219 |
+ |
220 |
+ if use test; then |
221 |
+ local sys_dir=( "${EPREFIX}"/usr/lib/clang/${LLVM_VERSION}/lib/* ) |
222 |
+ [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}" |
223 |
+ [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}" |
224 |
+ |
225 |
+ # copy clang over since resource_dir is located relatively to binary |
226 |
+ # therefore, we can put our new libraries in it |
227 |
+ mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_MAJOR}/{bin,$(get_libdir)},clang/${LLVM_VERSION}/include} || die |
228 |
+ cp "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/bin/clang{,++} \ |
229 |
+ "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/bin/ || die |
230 |
+ cp "${EPREFIX}"/usr/lib/clang/${LLVM_VERSION}/include/*.h \ |
231 |
+ "${BUILD_DIR}"/lib/clang/${LLVM_VERSION}/include/ || die |
232 |
+ cp "${sys_dir}"/*builtins*.a \ |
233 |
+ "${BUILD_DIR}/lib/clang/${LLVM_VERSION}/lib/${sys_dir##*/}/" || die |
234 |
+ # we also need LLVMgold.so for gold-based tests |
235 |
+ if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so ]]; then |
236 |
+ ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so \ |
237 |
+ "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/ || die |
238 |
+ fi |
239 |
+ fi |
240 |
+} |
241 |
+ |
242 |
+src_test() { |
243 |
+ # respect TMPDIR! |
244 |
+ local -x LIT_PRESERVES_TMP=1 |
245 |
+ # disable sandbox to have it stop clobbering LD_PRELOAD |
246 |
+ local -x SANDBOX_ON=0 |
247 |
+ # wipe LD_PRELOAD to make ASAN happy |
248 |
+ local -x LD_PRELOAD= |
249 |
+ |
250 |
+ cmake_build check-all |
251 |
+} |