diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-02-16 14:36:42 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-02-16 15:16:21 +0100 |
commit | 04bb278e03b7a36b5a5682c77355c68aee632e78 (patch) | |
tree | df660162b6d39558f6faca21b9351d8ff058e434 /sys-libs | |
parent | x11-plugins/wmhdplop: fix build with future glibc, bug #604296 (diff) | |
download | gentoo-04bb278e03b7a36b5a5682c77355c68aee632e78.tar.gz gentoo-04bb278e03b7a36b5a5682c77355c68aee632e78.tar.bz2 gentoo-04bb278e03b7a36b5a5682c77355c68aee632e78.zip |
sys-libs/compiler-rt: Prefer building using clang
Add a USE=clang flag to prefer building using installed clang, to work
around limited/broken support for '#pragma redefine_extname' which
results in incomplete runtime being emitted when building using GCC.
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/compiler-rt/compiler-rt-4.0.0_rc2.ebuild | 10 | ||||
-rw-r--r-- | sys-libs/compiler-rt/compiler-rt-9999.ebuild | 11 | ||||
-rw-r--r-- | sys-libs/compiler-rt/metadata.xml | 4 |
3 files changed, 21 insertions, 4 deletions
diff --git a/sys-libs/compiler-rt/compiler-rt-4.0.0_rc2.ebuild b/sys-libs/compiler-rt/compiler-rt-4.0.0_rc2.ebuild index 43560c2edd59..82b3dcffe19b 100644 --- a/sys-libs/compiler-rt/compiler-rt-4.0.0_rc2.ebuild +++ b/sys-libs/compiler-rt/compiler-rt-4.0.0_rc2.ebuild @@ -19,7 +19,7 @@ SRC_URI="http://www.llvm.org/pre-releases/${PV/_//}/${P/_/}.src.tar.xz" LICENSE="|| ( UoI-NCSA MIT )" SLOT="${PV%_*}" KEYWORDS="~amd64 ~arm64 ~x86" -IUSE="test" +IUSE="+clang test" LLVM_SLOT=${SLOT%%.*} RDEPEND="!=sys-libs/compiler-rt-${SLOT}*:0" @@ -43,7 +43,13 @@ src_configure() { # pre-set since we need to pass it to cmake BUILD_DIR=${WORKDIR}/${P}_build - if ! test_compiler; then + if use clang; then + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + # ensure we can use clang before installing compiler-rt + local -x LDFLAGS="${LDFLAGS} -nodefaultlibs -lc" + strip-unsupported-flags + elif ! test_compiler; then local extra_flags=( -nodefaultlibs -lc ) if test_compiler "${extra_flags[@]}"; then local -x LDFLAGS="${LDFLAGS} ${extra_flags[*]}" diff --git a/sys-libs/compiler-rt/compiler-rt-9999.ebuild b/sys-libs/compiler-rt/compiler-rt-9999.ebuild index 450177ae5cf7..034b1d253154 100644 --- a/sys-libs/compiler-rt/compiler-rt-9999.ebuild +++ b/sys-libs/compiler-rt/compiler-rt-9999.ebuild @@ -22,12 +22,13 @@ LICENSE="|| ( UoI-NCSA MIT )" # Note: this needs to be updated to match version of clang-9999 SLOT="5.0.0" KEYWORDS="" -IUSE="test" +IUSE="+clang test" LLVM_SLOT=${SLOT%%.*} # llvm-4 needed for --cmakedir DEPEND=" >=sys-devel/llvm-4 + clang? ( sys-devel/clang ) test? ( =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} ) ${PYTHON_DEPS}" @@ -43,7 +44,13 @@ src_configure() { # pre-set since we need to pass it to cmake BUILD_DIR=${WORKDIR}/${P}_build - if ! test_compiler; then + if use clang; then + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + # ensure we can use clang before installing compiler-rt + local -x LDFLAGS="${LDFLAGS} -nodefaultlibs -lc" + strip-unsupported-flags + elif ! test_compiler; then local extra_flags=( -nodefaultlibs -lc ) if test_compiler "${extra_flags[@]}"; then local -x LDFLAGS="${LDFLAGS} ${extra_flags[*]}" diff --git a/sys-libs/compiler-rt/metadata.xml b/sys-libs/compiler-rt/metadata.xml index 89c4bdb96049..3b996021381a 100644 --- a/sys-libs/compiler-rt/metadata.xml +++ b/sys-libs/compiler-rt/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> |