summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-01-09 21:38:34 +0100
committerMichał Górny <mgorny@gentoo.org>2018-01-09 21:45:21 +0100
commit69f0549cf61cd3a3f1293565ad46698c81cd8802 (patch)
treeb2d42c3de3c2d9bc9daf0a4dad855ab9fc350d39
parentnet-proxy/squid: fix cross-compiling (diff)
downloadgentoo-69f0549cf61cd3a3f1293565ad46698c81cd8802.tar.gz
gentoo-69f0549cf61cd3a3f1293565ad46698c81cd8802.tar.bz2
gentoo-69f0549cf61cd3a3f1293565ad46698c81cd8802.zip
sys-libs/compiler-rt-sanitizers: Default to building using clang
Default to building using clang rather than gcc since the latter is starting to cause more issues, most notably GotsanRuntimeCheck segfaulting more commonly than it used to. Closes: https://bugs.gentoo.org/630958
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.9999.ebuild11
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild11
-rw-r--r--sys-libs/compiler-rt-sanitizers/metadata.xml4
3 files changed, 22 insertions, 4 deletions
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
index 879e08005bbb..5e10ee47eeb4 100644
--- 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
@@ -21,13 +21,14 @@ LICENSE="|| ( UoI-NCSA MIT )"
# Note: this needs to be updated to match version of clang-9999
SLOT="6.0.0"
KEYWORDS=""
-IUSE="test"
-RESTRICT="!test? ( test )"
+IUSE="+clang test"
+RESTRICT="!test? ( test ) !clang? ( test )"
LLVM_SLOT=${SLOT%%.*}
# llvm-4 needed for --cmakedir
DEPEND="
>=sys-devel/llvm-4
+ clang? ( sys-devel/clang )
test? (
app-portage/unsandbox
$(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
@@ -74,6 +75,12 @@ src_configure() {
# pre-set since we need to pass it to cmake
BUILD_DIR=${WORKDIR}/${P}_build
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ strip-unsupported-flags
+ fi
+
local mycmakeargs=(
-DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
# use a build dir structure consistent with install
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
index 97b8b578d56f..5821a6f3c0eb 100644
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
@@ -20,13 +20,14 @@ LICENSE="|| ( UoI-NCSA MIT )"
# Note: this needs to be updated to match version of clang-9999
SLOT="7.0.0"
KEYWORDS=""
-IUSE="test"
-RESTRICT="!test? ( test )"
+IUSE="+clang test"
+RESTRICT="!test? ( test ) !clang? ( test )"
LLVM_SLOT=${SLOT%%.*}
# llvm-4 needed for --cmakedir
DEPEND="
>=sys-devel/llvm-4
+ clang? ( sys-devel/clang )
test? (
app-portage/unsandbox
$(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
@@ -73,6 +74,12 @@ src_configure() {
# pre-set since we need to pass it to cmake
BUILD_DIR=${WORKDIR}/${P}_build
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ strip-unsupported-flags
+ fi
+
local mycmakeargs=(
-DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
# use a build dir structure consistent with install
diff --git a/sys-libs/compiler-rt-sanitizers/metadata.xml b/sys-libs/compiler-rt-sanitizers/metadata.xml
index 89c4bdb96049..3b996021381a 100644
--- a/sys-libs/compiler-rt-sanitizers/metadata.xml
+++ b/sys-libs/compiler-rt-sanitizers/metadata.xml
@@ -4,4 +4,8 @@
<maintainer type="project">
<email>llvm@gentoo.org</email>
</maintainer>
+ <use>
+ <flag name='clang'>Force building using installed clang (rather
+ than the default CC/CXX).</flag>
+ </use>
</pkgmetadata>