summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2013-07-24 01:00:45 +0000
committerAlexis Ballier <aballier@gentoo.org>2013-07-24 01:00:45 +0000
commit4bb077e72b777f745b4542c3e82793e8f6e5213f (patch)
tree094c1c56e40342788c09534d2517759405ad473a /sys-libs
parentfixing ovs usedep and bug 475540 (diff)
downloadgentoo-2-4bb077e72b777f745b4542c3e82793e8f6e5213f.tar.gz
gentoo-2-4bb077e72b777f745b4542c3e82793e8f6e5213f.tar.bz2
gentoo-2-4bb077e72b777f745b4542c3e82793e8f6e5213f.zip
provide a shared ldscript for linking in libcxxrt too as its abi is more or less exposed by libcxx headers, bug #477712
(Portage version: 2.2.0_alpha188/cvs/Linux x86_64, signed Manifest commit with key 160F534A)
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/libcxx/ChangeLog6
-rw-r--r--sys-libs/libcxx/libcxx-9999.ebuild43
2 files changed, 33 insertions, 16 deletions
diff --git a/sys-libs/libcxx/ChangeLog b/sys-libs/libcxx/ChangeLog
index 43e3bce8114d..c87f3d9ac382 100644
--- a/sys-libs/libcxx/ChangeLog
+++ b/sys-libs/libcxx/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-libs/libcxx
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxx/ChangeLog,v 1.24 2013/07/03 21:52:45 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxx/ChangeLog,v 1.25 2013/07/24 01:00:45 aballier Exp $
+
+ 24 Jul 2013; Alexis Ballier <aballier@gentoo.org> libcxx-9999.ebuild:
+ provide a shared ldscript for linking in libcxxrt too as its abi is more or
+ less exposed by libcxx headers, bug #477712
03 Jul 2013; Alexis Ballier <aballier@gentoo.org> libcxx-9999.ebuild:
Go multilib, based on the work of Yuta SATOH in bug #475294
diff --git a/sys-libs/libcxx/libcxx-9999.ebuild b/sys-libs/libcxx/libcxx-9999.ebuild
index abffa7b00431..5471dcb60e73 100644
--- a/sys-libs/libcxx/libcxx-9999.ebuild
+++ b/sys-libs/libcxx/libcxx-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxx/libcxx-9999.ebuild,v 1.16 2013/07/03 21:52:45 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxx/libcxx-9999.ebuild,v 1.17 2013/07/24 01:00:45 aballier Exp $
EAPI=5
@@ -76,35 +76,47 @@ multilib_src_test() {
./testit || die
}
+# Usage: deps
+gen_ldscript() {
+ local output_format
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
+
+ cat <<-END_LDSCRIPT
+/* GNU ld script
+ Include missing dependencies
+*/
+${output_format}
+GROUP ( $@ )
+END_LDSCRIPT
+}
+
gen_static_ldscript() {
if use libcxxrt ; then
# Move it first.
- mv "${D}/${EPREFIX}/usr/$(get_libdir)/libc++.a" "${D}/${EPREFIX}/usr/$(get_libdir)/libc++_static.a" || die
+ mv "${ED}/usr/$(get_libdir)/libc++.a" "${ED}/usr/$(get_libdir)/libc++_static.a" || die
# Generate libc++.a ldscript for inclusion of its dependencies so that
# clang++ -stdlib=libc++ -static works out of the box.
- # Taken from toolchain-funcs.eclass:
- local output_format
- output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
- [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
-
local deps="${EPREFIX}/usr/$(get_libdir)/libc++_static.a ${EPREFIX}/usr/$(get_libdir)/libcxxrt.a"
# On Linux/glibc it does not link without libpthread or libdl. It is
# fine on FreeBSD.
use elibc_glibc && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libpthread.a ${EPREFIX}/usr/$(get_libdir)/libdl.a"
- cat > "${D}/${EPREFIX}/usr/$(get_libdir)/libc++.a" <<-END_LDSCRIPT
-/* GNU ld script
- Include libc++.a dependencies for 'clang++ -stdlib=libc++ -static' to work
- out of the box.
- */
-${output_format}
-GROUP ( ${deps} )
-END_LDSCRIPT
+ gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.a"
fi
# TODO: Generate a libc++.a ldscript when building against libsupc++
}
+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"
+ gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.so"
+ fi
+ # TODO: Generate the linked script for other confiurations too.
+}
+
multilib_src_install() {
cd "${BUILD_DIR}/lib"
if use static-libs ; then
@@ -112,6 +124,7 @@ multilib_src_install() {
gen_static_ldscript
fi
dolib.so libc++.so*
+ gen_shared_ldscript
}
multilib_src_install_all() {