commit:     d7841372b9eb2a0b14c378a3b1d20eaee337df55
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 15 16:44:56 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Mar 15 17:33:53 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7841372

sys-libs/compiler-rt-sanitizers: Backport USE=clang to older versions

 .../compiler-rt-sanitizers-4.0.1.ebuild                       | 11 +++++++++--
 .../compiler-rt-sanitizers-5.0.1.ebuild                       |  9 ++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)

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
index 9d6981d1ffc..3519ecb52ac 100644
--- 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
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -19,13 +19,14 @@ 
SRC_URI="https://releases.llvm.org/${PV/_//}/compiler-rt-${PV/_/}.src.tar.xz
 LICENSE="|| ( UoI-NCSA MIT )"
 SLOT="${PV%_*}"
 KEYWORDS="amd64 ~arm64 x86"
-IUSE="test"
+IUSE="+clang test"
 
 LLVM_MAX_SLOT=${SLOT%%.*}
 RDEPEND="!=sys-libs/compiler-rt-sanitizers-${SLOT}*:0"
 # 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}]")
@@ -72,6 +73,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-5.0.1.ebuild 
b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.1.ebuild
index 686e223817f..768c64155d0 100644
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.1.ebuild
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.1.ebuild
@@ -21,12 +21,13 @@ SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz
 LICENSE="|| ( UoI-NCSA MIT )"
 SLOT="${PV%_*}"
 KEYWORDS="amd64 ~arm64 x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
-IUSE="test"
+IUSE="+clang test"
 
 LLVM_MAX_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}]")
@@ -72,6 +73,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

Reply via email to