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: Tue, 27 Jun 2017 19:18:15
Message-Id: 1498591079.d359c29180da093c4dce4d9b7547737a69c2a2d0.mgorny@gentoo
1 commit: d359c29180da093c4dce4d9b7547737a69c2a2d0
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 26 14:48:05 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 27 19:17:59 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d359c291
7
8 sys-libs/compiler-rt-sanitizers: Bump to 4.0.1
9
10 sys-libs/compiler-rt-sanitizers/Manifest | 2 +
11 .../compiler-rt-sanitizers-4.0.1.ebuild | 127 +++++++++++++++++++++
12 2 files changed, 129 insertions(+)
13
14 diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
15 index 2e74b3b46ca..440de3834d8 100644
16 --- a/sys-libs/compiler-rt-sanitizers/Manifest
17 +++ b/sys-libs/compiler-rt-sanitizers/Manifest
18 @@ -1,2 +1,4 @@
19 DIST compiler-rt-4.0.0.src.tar.xz 1435104 SHA256 d3f25b23bef24c305137e6b44f7e81c51bbec764c119e01512a9bd2330be3115 SHA512 ed52436a2399ca82c1af46a523e89e88c23367f74cd110f0267af49a72aa4912ae8f48c6093e6b01c9ea68c48354a12201d26baf721d254fb017ddb98af2e3dd WHIRLPOOL ea5d6fbb34809067825306b1158979946c43c8aec458d946f8c853f3c0e0cd72a6c92a8e4ad8d1b35e10f9bd079a73dd26fde368f919937ad413bdfd83ab4018
20 +DIST compiler-rt-4.0.1.src.tar.xz 1434100 SHA256 a3c87794334887b93b7a766c507244a7cdcce1d48b2e9249fc9a94f2c3beb440 SHA512 cfeb625884b273f7c0e6767b81a8d3e5f24e0b96a510d5764d9d47a0e215fc841b4cb9d1843c8fb428cd21def720cfbfe8d3593ff5bb390548ebc8c32a902649 WHIRLPOOL 8b33c6841cacefe98da92435418b13b8f8ed97a982903be827e5c37f937dc9001975d6a709d60423b21509dd5670ee2e90cb34c96473fb4a66c2ab6f47af09e5
21 DIST llvm-4.0.0.src.tar.xz 21016340 SHA256 8d10511df96e73b8ff9e7abbfb4d4d432edbdbe965f1f4f07afaf370b8a533be SHA512 cf681f0626ef6d568d951cdc3e143471a1d7715a0ba11e52aa273cf5d8d421e1357ef2645cc85879eaefcd577e99e74d07b01566825b3d0461171ef2cbfc7704 WHIRLPOOL 9783e8f47306c1deb2e114d4b46a7db9b0260b4965076345c88765413c5fc8e73fab5f88ae4903adbdea31406022948b16d32ae47d98f5def074509d5d794579
22 +DIST llvm-4.0.1.src.tar.xz 21065652 SHA256 da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51 SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d WHIRLPOOL 1626ff270f7ce4801d02a0797b227fda9314ff5c0c01d653111599e9a4d2854c4d9edc3c698a7abee8d79d6bce8b18dc619fbced3c07ca610d44a248d65830cc
23
24 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild
25 new file mode 100644
26 index 00000000000..70c0d1d6fde
27 --- /dev/null
28 +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild
29 @@ -0,0 +1,127 @@
30 +# Copyright 1999-2017 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=6
34 +
35 +: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
36 +# (needed due to CMAKE_BUILD_TYPE != Gentoo)
37 +CMAKE_MIN_VERSION=3.7.0-r1
38 +PYTHON_COMPAT=( python2_7 )
39 +
40 +inherit check-reqs cmake-utils flag-o-matic llvm python-any-r1 versionator
41 +
42 +DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
43 +HOMEPAGE="http://llvm.org/"
44 +SRC_URI="http://releases.llvm.org/${PV/_//}/compiler-rt-${PV/_/}.src.tar.xz
45 + test? ( http://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
46 +
47 +LICENSE="|| ( UoI-NCSA MIT )"
48 +SLOT="${PV%_*}"
49 +KEYWORDS="~amd64 ~arm64 ~x86"
50 +IUSE="test"
51 +
52 +LLVM_SLOT=${SLOT%%.*}
53 +RDEPEND="!=sys-libs/compiler-rt-sanitizers-${SLOT}*:0"
54 +# llvm-4 needed for --cmakedir
55 +DEPEND="
56 + >=sys-devel/llvm-4
57 + test? (
58 + app-portage/unsandbox
59 + $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
60 + =sys-devel/clang-${PV%_*}*:${LLVM_SLOT}
61 + sys-libs/compiler-rt:${SLOT} )
62 + ${PYTHON_DEPS}"
63 +
64 +S=${WORKDIR}/compiler-rt-${PV/_/}.src
65 +
66 +# least intrusive of all
67 +CMAKE_BUILD_TYPE=RelWithDebInfo
68 +
69 +check_space() {
70 + if use test; then
71 + local CHECKREQS_DISK_BUILD=11G
72 + check-reqs_pkg_pretend
73 + fi
74 +}
75 +
76 +pkg_pretend() {
77 + check_space
78 +}
79 +
80 +pkg_setup() {
81 + check_space
82 + llvm_pkg_setup
83 + python-any-r1_pkg_setup
84 +}
85 +
86 +src_unpack() {
87 + default
88 +
89 + if use test; then
90 + mv llvm-* llvm || die
91 + fi
92 +}
93 +
94 +src_configure() {
95 + # pre-set since we need to pass it to cmake
96 + BUILD_DIR=${WORKDIR}/${P}_build
97 +
98 + local mycmakeargs=(
99 + -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
100 + # use a build dir structure consistent with install
101 + # this makes it possible to easily deploy test-friendly clang
102 + -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}"
103 +
104 + -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
105 + # built-ins installed by sys-libs/compiler-rt
106 + -DCOMPILER_RT_BUILD_BUILTINS=OFF
107 + -DCOMPILER_RT_BUILD_SANITIZERS=ON
108 + -DCOMPILER_RT_BUILD_XRAY=ON
109 + )
110 + if use test; then
111 + mycmakeargs+=(
112 + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
113 + -DLIT_COMMAND="${EPREFIX}/usr/bin/unsandbox;${EPREFIX}/usr/bin/lit"
114 +
115 + # they are created during src_test()
116 + -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang"
117 + -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang++"
118 + )
119 +
120 + # same flags are passed for build & tests, so we need to strip
121 + # them down to a subset supported by clang
122 + CC=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang \
123 + CXX=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++ \
124 + strip-unsupported-flags
125 + fi
126 +
127 + cmake-utils_src_configure
128 +
129 + if use test; then
130 + local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* )
131 + [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}"
132 + [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}"
133 +
134 + # copy clang over since resource_dir is located relatively to binary
135 + # therefore, we can put our new libraries in it
136 + mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die
137 + cp "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/bin/clang{,++} \
138 + "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/bin/ || die
139 + cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \
140 + "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die
141 + cp "${sys_dir}"/*builtins*.a \
142 + "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die
143 + # we also need LLVMgold.so for gold-based tests
144 + if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
145 + ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so \
146 + "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/$(get_libdir)/ || die
147 + fi
148 + fi
149 +}
150 +
151 +src_test() {
152 + # respect TMPDIR!
153 + local -x LIT_PRESERVES_TMP=1
154 +
155 + cmake-utils_src_make check-all
156 +}