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