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