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/
Date: Fri, 09 Feb 2018 16:00:18
Message-Id: 1518192002.8274f827479dd945caef9d3a9038684af77306b8.mgorny@gentoo
1 commit: 8274f827479dd945caef9d3a9038684af77306b8
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 9 10:02:41 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 9 16:00:02 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8274f827
7
8 sys-libs/compiler-rt: Bump to 6.0.0rc2
9
10 sys-libs/compiler-rt/Manifest | 1 +
11 sys-libs/compiler-rt/compiler-rt-6.0.0_rc2.ebuild | 108 ++++++++++++++++++++++
12 2 files changed, 109 insertions(+)
13
14 diff --git a/sys-libs/compiler-rt/Manifest b/sys-libs/compiler-rt/Manifest
15 index 7065b881249..a05df80762b 100644
16 --- a/sys-libs/compiler-rt/Manifest
17 +++ b/sys-libs/compiler-rt/Manifest
18 @@ -1,2 +1,3 @@
19 DIST compiler-rt-4.0.1.src.tar.xz 1434100 BLAKE2B ca6bf78fc07f387b7244a52ef648b06a5685effb46a66b241a9ee847ecafb17d02602f49b0dbe473d47202586874a043a6d75141400062f526d2f808da323e1e SHA512 cfeb625884b273f7c0e6767b81a8d3e5f24e0b96a510d5764d9d47a0e215fc841b4cb9d1843c8fb428cd21def720cfbfe8d3593ff5bb390548ebc8c32a902649
20 DIST compiler-rt-5.0.1.src.tar.xz 1498220 BLAKE2B 61503df8a4075c2fe1e42d480753b861321b5de127e340f48d648fc38d81c7967cead17e136beaa5235cc92540f158915fccec77cf39aa7c336d106c9d265222 SHA512 61e23775db78bdeed3003a509b45ae609287db31302fed186f3210d481ecf062d1828571e63482215ab00ff732df8f3fa6c77334dfb677e4b76eb555d476b8c4
21 +DIST compiler-rt-6.0.0rc2.src.tar.xz 1635928 BLAKE2B 6d60e40e61f4d3496d259dff9471bbe41656a1ced8aa1eff3d2443ddd17ffb1a13c54e1dc632d326f8185cc0ace8af72eaaeed3c7e5b1e86411240349b2858ca SHA512 3c279f2c5fdad6ed3a2c49809eb2879cb6615d27920046f4d9bb1cc4d66da949b3b90f26dc8208dbea5602cb5f85e1a4d1e72daca7b7dfa4d405aed4743c7604
22
23 diff --git a/sys-libs/compiler-rt/compiler-rt-6.0.0_rc2.ebuild b/sys-libs/compiler-rt/compiler-rt-6.0.0_rc2.ebuild
24 new file mode 100644
25 index 00000000000..8a3c3d0bdf1
26 --- /dev/null
27 +++ b/sys-libs/compiler-rt/compiler-rt-6.0.0_rc2.ebuild
28 @@ -0,0 +1,108 @@
29 +# Copyright 1999-2018 Gentoo Foundation
30 +# Distributed under the terms of the GNU General Public License v2
31 +
32 +EAPI=6
33 +
34 +: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
35 +# (needed due to CMAKE_BUILD_TYPE != Gentoo)
36 +CMAKE_MIN_VERSION=3.7.0-r1
37 +PYTHON_COMPAT=( python2_7 )
38 +
39 +inherit cmake-utils flag-o-matic llvm python-any-r1 toolchain-funcs
40 +
41 +DESCRIPTION="Compiler runtime library for clang (built-in part)"
42 +HOMEPAGE="https://llvm.org/"
43 +SRC_URI="http://prereleases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz"
44 +
45 +LICENSE="|| ( UoI-NCSA MIT )"
46 +SLOT="${PV%_*}"
47 +KEYWORDS=""
48 +IUSE="+clang test"
49 +RESTRICT="!test? ( test ) !clang? ( test )"
50 +
51 +LLVM_SLOT=${SLOT%%.*}
52 +# llvm-6 for new lit options
53 +DEPEND="
54 + >=sys-devel/llvm-6
55 + clang? ( sys-devel/clang )
56 + test? (
57 + $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
58 + =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} )
59 + ${PYTHON_DEPS}"
60 +
61 +S=${WORKDIR}/${P/_/}.src
62 +
63 +# least intrusive of all
64 +CMAKE_BUILD_TYPE=RelWithDebInfo
65 +
66 +pkg_pretend() {
67 + if ! use clang && ! tc-is-clang; then
68 + ewarn "Building using a compiler other than clang may result in broken atomics"
69 + ewarn "library. Enable USE=clang unless you have a very good reason not to."
70 + fi
71 +}
72 +
73 +pkg_setup() {
74 + llvm_pkg_setup
75 + python-any-r1_pkg_setup
76 +}
77 +
78 +test_compiler() {
79 + $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
80 + <<<'int main() { return 0; }' &>/dev/null
81 +}
82 +
83 +src_configure() {
84 + # pre-set since we need to pass it to cmake
85 + BUILD_DIR=${WORKDIR}/${P}_build
86 +
87 + local nolib_flags=( -nodefaultlibs -lc )
88 + if use clang; then
89 + local -x CC=${CHOST}-clang
90 + local -x CXX=${CHOST}-clang++
91 + # ensure we can use clang before installing compiler-rt
92 + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
93 + strip-unsupported-flags
94 + elif ! test_compiler; then
95 + if test_compiler "${nolib_flags[@]}"; then
96 + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
97 + ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
98 + fi
99 + fi
100 +
101 + local mycmakeargs=(
102 + -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
103 +
104 + -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
105 + -DCOMPILER_RT_BUILD_LIBFUZZER=OFF
106 + -DCOMPILER_RT_BUILD_PROFILE=OFF
107 + -DCOMPILER_RT_BUILD_SANITIZERS=OFF
108 + -DCOMPILER_RT_BUILD_XRAY=OFF
109 + )
110 +
111 + if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then
112 + mycmakeargs+=(
113 + # disable use of SDK for the system itself
114 + -DDARWIN_macosx_CACHED_SYSROOT=/
115 + )
116 + fi
117 +
118 + if use test; then
119 + mycmakeargs+=(
120 + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
121 + -DLLVM_LIT_ARGS="-vv"
122 +
123 + -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang"
124 + -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++"
125 + )
126 + fi
127 +
128 + cmake-utils_src_configure
129 +}
130 +
131 +src_test() {
132 + # respect TMPDIR!
133 + local -x LIT_PRESERVES_TMP=1
134 +
135 + cmake-utils_src_make check-builtins
136 +}