1 |
commit: 3dc6843ee3e9e6d7219207dcb1d2baf4c7ee2ce1 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 23 16:48:27 2017 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jul 24 19:03:47 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3dc6843e |
7 |
|
8 |
sys-libs/compiler-rt: Branch for 5.0.0 release |
9 |
|
10 |
sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild | 99 ++++++++++++++++++++++++ |
11 |
1 file changed, 99 insertions(+) |
12 |
|
13 |
diff --git a/sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild b/sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild |
14 |
new file mode 100644 |
15 |
index 00000000000..cb93d7d503e |
16 |
--- /dev/null |
17 |
+++ b/sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild |
18 |
@@ -0,0 +1,99 @@ |
19 |
+# Copyright 1999-2017 Gentoo Foundation |
20 |
+# Distributed under the terms of the GNU General Public License v2 |
21 |
+ |
22 |
+EAPI=6 |
23 |
+ |
24 |
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja} |
25 |
+# (needed due to CMAKE_BUILD_TYPE != Gentoo) |
26 |
+CMAKE_MIN_VERSION=3.7.0-r1 |
27 |
+PYTHON_COMPAT=( python2_7 ) |
28 |
+ |
29 |
+inherit cmake-utils flag-o-matic git-r3 llvm python-any-r1 toolchain-funcs |
30 |
+ |
31 |
+DESCRIPTION="Compiler runtime library for clang (built-in part)" |
32 |
+HOMEPAGE="https://llvm.org/" |
33 |
+SRC_URI="" |
34 |
+EGIT_REPO_URI="https://git.llvm.org/git/compiler-rt.git |
35 |
+ https://github.com/llvm-mirror/compiler-rt.git" |
36 |
+EGIT_BRANCH="release_50" |
37 |
+ |
38 |
+LICENSE="|| ( UoI-NCSA MIT )" |
39 |
+# Note: this needs to be updated to match version of clang-9999 |
40 |
+SLOT="5.0.0" |
41 |
+KEYWORDS="" |
42 |
+IUSE="+clang test" |
43 |
+ |
44 |
+LLVM_SLOT=${SLOT%%.*} |
45 |
+# llvm-4 needed for --cmakedir |
46 |
+DEPEND=" |
47 |
+ >=sys-devel/llvm-4 |
48 |
+ clang? ( sys-devel/clang ) |
49 |
+ test? ( |
50 |
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") |
51 |
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} ) |
52 |
+ ${PYTHON_DEPS}" |
53 |
+ |
54 |
+# least intrusive of all |
55 |
+CMAKE_BUILD_TYPE=RelWithDebInfo |
56 |
+ |
57 |
+pkg_pretend() { |
58 |
+ if ! use clang && ! tc-is-clang; then |
59 |
+ ewarn "Building using a compiler other than clang may result in broken atomics" |
60 |
+ ewarn "library. Enable USE=clang unless you have a very good reason not to." |
61 |
+ fi |
62 |
+} |
63 |
+ |
64 |
+pkg_setup() { |
65 |
+ llvm_pkg_setup |
66 |
+ python-any-r1_pkg_setup |
67 |
+} |
68 |
+ |
69 |
+test_compiler() { |
70 |
+ $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \ |
71 |
+ <<<'int main() { return 0; }' &>/dev/null |
72 |
+} |
73 |
+ |
74 |
+src_configure() { |
75 |
+ # pre-set since we need to pass it to cmake |
76 |
+ BUILD_DIR=${WORKDIR}/${P}_build |
77 |
+ |
78 |
+ local nolib_flags=( -nodefaultlibs -lc ) |
79 |
+ if use clang; then |
80 |
+ local -x CC=${CHOST}-clang |
81 |
+ local -x CXX=${CHOST}-clang++ |
82 |
+ # ensure we can use clang before installing compiler-rt |
83 |
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |
84 |
+ strip-unsupported-flags |
85 |
+ elif ! test_compiler; then |
86 |
+ if test_compiler "${nolib_flags[@]}"; then |
87 |
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" |
88 |
+ ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}" |
89 |
+ fi |
90 |
+ fi |
91 |
+ |
92 |
+ local mycmakeargs=( |
93 |
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}" |
94 |
+ |
95 |
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) |
96 |
+ -DCOMPILER_RT_BUILD_SANITIZERS=OFF |
97 |
+ -DCOMPILER_RT_BUILD_XRAY=OFF |
98 |
+ ) |
99 |
+ |
100 |
+ if use test; then |
101 |
+ mycmakeargs+=( |
102 |
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit" |
103 |
+ |
104 |
+ -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang" |
105 |
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++" |
106 |
+ ) |
107 |
+ fi |
108 |
+ |
109 |
+ cmake-utils_src_configure |
110 |
+} |
111 |
+ |
112 |
+src_test() { |
113 |
+ # respect TMPDIR! |
114 |
+ local -x LIT_PRESERVES_TMP=1 |
115 |
+ |
116 |
+ cmake-utils_src_make check-builtins |
117 |
+} |