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, 09 Jan 2018 20:45:41
Message-Id: 1515530721.69f0549cf61cd3a3f1293565ad46698c81cd8802.mgorny@gentoo
1 commit: 69f0549cf61cd3a3f1293565ad46698c81cd8802
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 9 20:38:34 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 9 20:45:21 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69f0549c
7
8 sys-libs/compiler-rt-sanitizers: Default to building using clang
9
10 Default to building using clang rather than gcc since the latter
11 is starting to cause more issues, most notably GotsanRuntimeCheck
12 segfaulting more commonly than it used to.
13
14 Closes: https://bugs.gentoo.org/630958
15
16 .../compiler-rt-sanitizers-6.0.9999.ebuild | 11 +++++++++--
17 .../compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild | 11 +++++++++--
18 sys-libs/compiler-rt-sanitizers/metadata.xml | 4 ++++
19 3 files changed, 22 insertions(+), 4 deletions(-)
20
21 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.9999.ebuild
22 index 879e08005bb..5e10ee47eeb 100644
23 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.9999.ebuild
24 +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.9999.ebuild
25 @@ -21,13 +21,14 @@ LICENSE="|| ( UoI-NCSA MIT )"
26 # Note: this needs to be updated to match version of clang-9999
27 SLOT="6.0.0"
28 KEYWORDS=""
29 -IUSE="test"
30 -RESTRICT="!test? ( test )"
31 +IUSE="+clang test"
32 +RESTRICT="!test? ( test ) !clang? ( test )"
33
34 LLVM_SLOT=${SLOT%%.*}
35 # llvm-4 needed for --cmakedir
36 DEPEND="
37 >=sys-devel/llvm-4
38 + clang? ( sys-devel/clang )
39 test? (
40 app-portage/unsandbox
41 $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
42 @@ -74,6 +75,12 @@ src_configure() {
43 # pre-set since we need to pass it to cmake
44 BUILD_DIR=${WORKDIR}/${P}_build
45
46 + if use clang; then
47 + local -x CC=${CHOST}-clang
48 + local -x CXX=${CHOST}-clang++
49 + strip-unsupported-flags
50 + fi
51 +
52 local mycmakeargs=(
53 -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
54 # use a build dir structure consistent with install
55
56 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
57 index 97b8b578d56..5821a6f3c0e 100644
58 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
59 +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
60 @@ -20,13 +20,14 @@ LICENSE="|| ( UoI-NCSA MIT )"
61 # Note: this needs to be updated to match version of clang-9999
62 SLOT="7.0.0"
63 KEYWORDS=""
64 -IUSE="test"
65 -RESTRICT="!test? ( test )"
66 +IUSE="+clang test"
67 +RESTRICT="!test? ( test ) !clang? ( test )"
68
69 LLVM_SLOT=${SLOT%%.*}
70 # llvm-4 needed for --cmakedir
71 DEPEND="
72 >=sys-devel/llvm-4
73 + clang? ( sys-devel/clang )
74 test? (
75 app-portage/unsandbox
76 $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
77 @@ -73,6 +74,12 @@ src_configure() {
78 # pre-set since we need to pass it to cmake
79 BUILD_DIR=${WORKDIR}/${P}_build
80
81 + if use clang; then
82 + local -x CC=${CHOST}-clang
83 + local -x CXX=${CHOST}-clang++
84 + strip-unsupported-flags
85 + fi
86 +
87 local mycmakeargs=(
88 -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
89 # use a build dir structure consistent with install
90
91 diff --git a/sys-libs/compiler-rt-sanitizers/metadata.xml b/sys-libs/compiler-rt-sanitizers/metadata.xml
92 index 89c4bdb9604..3b996021381 100644
93 --- a/sys-libs/compiler-rt-sanitizers/metadata.xml
94 +++ b/sys-libs/compiler-rt-sanitizers/metadata.xml
95 @@ -4,4 +4,8 @@
96 <maintainer type="project">
97 <email>llvm@g.o</email>
98 </maintainer>
99 + <use>
100 + <flag name='clang'>Force building using installed clang (rather
101 + than the default CC/CXX).</flag>
102 + </use>
103 </pkgmetadata>