summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <zhanglei.april@gmail.com>2016-07-16 17:45:54 +0800
committerMichał Górny <mgorny@gentoo.org>2016-08-01 23:49:26 +0200
commit8fd5ec6ed78c005139cc7ef4aab6bd7e6798e26d (patch)
tree7c5d2d754dea20ba657fca27bca3373dd352a6e4 /sys-libs/libcxx/libcxx-9999.ebuild
parentsys-libs/libcxxrt: add support for llvm-libunwind (diff)
downloadgentoo-8fd5ec6ed78c005139cc7ef4aab6bd7e6798e26d.tar.gz
gentoo-8fd5ec6ed78c005139cc7ef4aab6bd7e6798e26d.tar.bz2
gentoo-8fd5ec6ed78c005139cc7ef4aab6bd7e6798e26d.zip
sys-libs/libcxx: bump to 3.8.1, support libunwind & musl (#589352)
With USE=libunwind, libcxx will be built against libunwind (either sys-libs/libunwind or sys-libs/llvm-libunwind), instead of libgcc_s. In addition, a patch will be applied when building libcxx against musl. Package-Manager: portage-2.2.28
Diffstat (limited to 'sys-libs/libcxx/libcxx-9999.ebuild')
-rw-r--r--sys-libs/libcxx/libcxx-9999.ebuild16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys-libs/libcxx/libcxx-9999.ebuild b/sys-libs/libcxx/libcxx-9999.ebuild
index 92689d826fc6..06a6211b8564 100644
--- a/sys-libs/libcxx/libcxx-9999.ebuild
+++ b/sys-libs/libcxx/libcxx-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -26,9 +26,10 @@ if [ "${PV%9999}" = "${PV}" ] ; then
else
KEYWORDS=""
fi
-IUSE="elibc_glibc +libcxxrt +static-libs test"
+IUSE="elibc_glibc elibc_musl +libcxxrt libunwind +static-libs test"
+REQUIRED_USE="libunwind? ( libcxxrt )"
-RDEPEND="libcxxrt? ( >=sys-libs/libcxxrt-0.0_p20130725[static-libs?,${MULTILIB_USEDEP}] )
+RDEPEND="libcxxrt? ( >=sys-libs/libcxxrt-0.0_p20130725[libunwind?,static-libs?,${MULTILIB_USEDEP}] )
!libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] )"
DEPEND="${RDEPEND}
test? ( sys-devel/clang )
@@ -51,11 +52,12 @@ pkg_setup() {
src_prepare() {
cp -f "${FILESDIR}/Makefile" lib/ || die
+ use elibc_musl && epatch "${FILESDIR}/${P}-musl-support.patch"
multilib_copy_sources
}
src_configure() {
- export LIBS="-lpthread -lrt -lc -lgcc_s"
+ export LIBS="-lpthread -lrt -lc -l$(usex libunwind unwind gcc_s)"
if use libcxxrt ; then
append-cppflags -DLIBCXXRT "-I${EPREFIX}/usr/include/libcxxrt/"
LIBS="-lcxxrt ${LIBS}"
@@ -131,6 +133,9 @@ gen_static_ldscript() {
# fine on FreeBSD.
use elibc_glibc && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libpthread.a ${EPREFIX}/usr/$(get_libdir)/libdl.a"
+ # unlike libgcc_s, libunwind is not implicitly linked
+ use libunwind && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libunwind.a"
+
gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.a"
fi
# TODO: Generate a libc++.a ldscript when building against libsupc++
@@ -140,9 +145,10 @@ gen_shared_ldscript() {
if use libcxxrt ; then
mv "${ED}/usr/$(get_libdir)/libc++.so" "${ED}/usr/$(get_libdir)/libc++_shared.so" || die
local deps="${EPREFIX}/usr/$(get_libdir)/libc++_shared.so ${EPREFIX}/usr/$(get_libdir)/libcxxrt.so"
+ use libunwind && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libunwind.so"
gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.so"
fi
- # TODO: Generate the linker script for other confiurations too.
+ # TODO: Generate the linker script for other configurations too.
}
multilib_src_install() {