Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/compiler-rt-sanitizers/
Date: Sat, 14 Dec 2019 09:55:22
Message-Id: 1576317305.a7d3bcef45af51b03bdaf64887bc0eca56668a39.mgorny@gentoo
1 commit: a7d3bcef45af51b03bdaf64887bc0eca56668a39
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 14 08:56:58 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 14 09:55:05 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7d3bcef
7
8 sys-libs/compiler-rt-sanitizers: Bump to 9.0.1_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-9.0.1_rc3.ebuild | 153 +++++++++++++++++++++
14 2 files changed, 154 insertions(+)
15
16 diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
17 index 2291b80fbf8..ee8179709a7 100644
18 --- a/sys-libs/compiler-rt-sanitizers/Manifest
19 +++ b/sys-libs/compiler-rt-sanitizers/Manifest
20 @@ -5,3 +5,4 @@ DIST llvm-7.1.0.src.tar.xz 28313784 BLAKE2B b78d9a7fc5ef6e352e77d339e5c4eef5cced
21 DIST llvm-8.0.1.src.tar.xz 30477608 BLAKE2B 4319c837b36111401e3b0f9659b8d875c89463bcc7816df1aefe1e3ff989860bbaa92504718f8e15416cfd9f3491c13777cd5cb661877b237b342b0e515b93f5 SHA512 82e120be5cabdfd5111aebbea68a663fe229c8861d73802d6ab09a3bf48f60de333e07e61f8fb61beaa14ac2bea24fcd74fa6f761acaf62469f536b79fcb1e16
22 DIST llvm-9.0.0.src.tar.xz 32994768 BLAKE2B 7f09bff9bcada95ab9c920c78aef92b57e665d9188bab39c734084ceb03a801c942fed48ea77fabeeb6110c648cb69363c659a6ce93ebf67dbba5c187219b13b SHA512 1bb3341e1d231559b948f1505b33c2e2e03989f9b8bbfef0e0cdaff5ac43f85574c9ec5ac53399b914f497d6899425d861411024e8d7e1d1a338c1c6951ac658
23 DIST llvmorg-9.0.1-rc2.tar.gz 113203311 BLAKE2B 6e426060853e1587febedb75189444a1451236b713f800a4f3401c54318e48b0f5e0c484e9e4ef261faceed9b43b445a4153b061d4dadcc617047f9320b4f56a SHA512 fececd9365645920b9afdad1e94d5e10553ad4a39d84b3ac811b86014c395d51f7e4dabe54bb095a99481400c408bee3c9a2044168724d5e094e3258587a5d2c
24 +DIST llvmorg-9.0.1-rc3.tar.gz 113205740 BLAKE2B 3ca81e812833ecc2ac1bacfdeb86f54609ee125ba7390ce6af0113e949496149102360f35a9a0194dff93fb5cb6ade40a68382a03a7e55771a13198abb7ca9de SHA512 ea56a4ee57aacdd00a1d6551cdc768ecce3124a0eb6a9d09fe060bb147019a5119b2a9eaca576474be42e0296293daa923edd86dadb6759df0c2d7fc7a74f9f1
25
26 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1_rc3.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1_rc3.ebuild
27 new file mode 100644
28 index 00000000000..4c388d97887
29 --- /dev/null
30 +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1_rc3.ebuild
31 @@ -0,0 +1,153 @@
32 +# Copyright 1999-2019 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
38 +inherit check-reqs cmake-utils flag-o-matic llvm llvm.org \
39 + multiprocessing python-any-r1
40 +
41 +DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
42 +HOMEPAGE="https://llvm.org/"
43 +LLVM_COMPONENTS=( compiler-rt )
44 +LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest )
45 +llvm.org_set_globals
46 +
47 +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
48 +SLOT="$(ver_cut 1-3)"
49 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
50 +IUSE="+clang +libfuzzer +profile +sanitize test +xray elibc_glibc"
51 +# FIXME: libfuzzer does not enable all its necessary dependencies
52 +REQUIRED_USE="libfuzzer? ( || ( sanitize xray ) )"
53 +RESTRICT="!test? ( test ) !clang? ( test )"
54 +
55 +CLANG_SLOT=${SLOT%%.*}
56 +# llvm-6 for new lit options
57 +DEPEND="
58 + >=sys-devel/llvm-6"
59 +BDEPEND="
60 + clang? ( sys-devel/clang )
61 + elibc_glibc? ( net-libs/libtirpc )
62 + test? (
63 + !<sys-apps/sandbox-2.13
64 + $(python_gen_any_dep ">=dev-python/lit-5[\${PYTHON_USEDEP}]")
65 + =sys-devel/clang-${PV%_*}*:${CLANG_SLOT}
66 + sys-libs/compiler-rt:${SLOT} )
67 + ${PYTHON_DEPS}"
68 +
69 +# least intrusive of all
70 +CMAKE_BUILD_TYPE=RelWithDebInfo
71 +
72 +check_space() {
73 + if use test; then
74 + local CHECKREQS_DISK_BUILD=11G
75 + check-reqs_pkg_pretend
76 + fi
77 +}
78 +
79 +pkg_pretend() {
80 + check_space
81 +}
82 +
83 +pkg_setup() {
84 + check_space
85 + llvm_pkg_setup
86 + python-any-r1_pkg_setup
87 +}
88 +
89 +src_prepare() {
90 + cmake-utils_src_prepare
91 +
92 + if use test; then
93 + # remove tests that are (still) broken by new glibc
94 + # https://bugs.llvm.org/show_bug.cgi?id=36065
95 + if use elibc_glibc && has_version '>=sys-libs/glibc-2.25'; then
96 + rm test/lsan/TestCases/Linux/fork_and_leak.cc || die
97 + fi
98 + fi
99 +}
100 +
101 +src_configure() {
102 + # pre-set since we need to pass it to cmake
103 + BUILD_DIR=${WORKDIR}/compiler-rt_build
104 +
105 + if use clang; then
106 + local -x CC=${CHOST}-clang
107 + local -x CXX=${CHOST}-clang++
108 + strip-unsupported-flags
109 + fi
110 +
111 + local mycmakeargs=(
112 + -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
113 + # use a build dir structure consistent with install
114 + # this makes it possible to easily deploy test-friendly clang
115 + -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}"
116 +
117 + -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
118 + # builtins & crt installed by sys-libs/compiler-rt
119 + -DCOMPILER_RT_BUILD_BUILTINS=OFF
120 + -DCOMPILER_RT_BUILD_CRT=OFF
121 + -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer)
122 + -DCOMPILER_RT_BUILD_PROFILE=$(usex profile)
123 + -DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize)
124 + -DCOMPILER_RT_BUILD_XRAY=$(usex xray)
125 + )
126 + if use test; then
127 + mycmakeargs+=(
128 + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
129 + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
130 + -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
131 +
132 + # they are created during src_test()
133 + -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${CLANG_SLOT}/bin/clang"
134 + -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${CLANG_SLOT}/bin/clang++"
135 + )
136 +
137 + # same flags are passed for build & tests, so we need to strip
138 + # them down to a subset supported by clang
139 + CC=${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang \
140 + CXX=${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/bin/clang++ \
141 + strip-unsupported-flags
142 + fi
143 +
144 + if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then
145 + mycmakeargs+=(
146 + # disable use of SDK for the system itself
147 + -DDARWIN_macosx_CACHED_SYSROOT=/
148 + )
149 + fi
150 +
151 + cmake-utils_src_configure
152 +
153 + if use test; then
154 + local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* )
155 + [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}"
156 + [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}"
157 +
158 + # copy clang over since resource_dir is located relatively to binary
159 + # therefore, we can put our new libraries in it
160 + mkdir -p "${BUILD_DIR}"/lib/{llvm/${CLANG_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die
161 + cp "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/bin/clang{,++} \
162 + "${BUILD_DIR}"/lib/llvm/${CLANG_SLOT}/bin/ || die
163 + cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \
164 + "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die
165 + cp "${sys_dir}"/*builtins*.a \
166 + "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die
167 + # we also need LLVMgold.so for gold-based tests
168 + if [[ -f ${EPREFIX}/usr/lib/llvm/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
169 + ln -s "${EPREFIX}"/usr/lib/llvm/${CLANG_SLOT}/$(get_libdir)/LLVMgold.so \
170 + "${BUILD_DIR}"/lib/llvm/${CLANG_SLOT}/$(get_libdir)/ || die
171 + fi
172 + fi
173 +}
174 +
175 +src_test() {
176 + # respect TMPDIR!
177 + local -x LIT_PRESERVES_TMP=1
178 + # disable sandbox to have it stop clobbering LD_PRELOAD
179 + local -x SANDBOX_ON=0
180 + # wipe LD_PRELOAD to make ASAN happy
181 + local -x LD_PRELOAD=
182 +
183 + cmake-utils_src_make check-all
184 +}