summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2012-05-31 20:48:43 +0000
committerAlexis Ballier <aballier@gentoo.org>2012-05-31 20:48:43 +0000
commit8d01fd032df7ef3014cb9c14808674756d2a49fc (patch)
treef7e9de6ff25e0d2549e748aa65f825acf810db38 /sys-libs
parentBump LeechCraft to 0.5.70 "Hessian Blade" (diff)
downloadhistorical-8d01fd032df7ef3014cb9c14808674756d2a49fc.tar.gz
historical-8d01fd032df7ef3014cb9c14808674756d2a49fc.tar.bz2
historical-8d01fd032df7ef3014cb9c14808674756d2a49fc.zip
Use our own makefiles, its so simple that we do not need to rely on cmake for this. Build it on top of libunwind instead of using libgcc_s for unwinding. Remove their libunwind bundled headers and ship a reduced one with only the added macros libcxxrt needs. Build with -nodefaultlibs to ensure we do not link to gcc libs. Add static-libs useflag. Give it a src_test.
Package-Manager: portage-2.2.0_alpha108/cvs/Linux x86_64
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/libcxxrt/ChangeLog10
-rw-r--r--sys-libs/libcxxrt/Manifest13
-rw-r--r--sys-libs/libcxxrt/files/Makefile23
-rw-r--r--sys-libs/libcxxrt/files/Makefile.test7
-rw-r--r--sys-libs/libcxxrt/files/unwind.h94
-rw-r--r--sys-libs/libcxxrt/libcxxrt-9999.ebuild39
6 files changed, 168 insertions, 18 deletions
diff --git a/sys-libs/libcxxrt/ChangeLog b/sys-libs/libcxxrt/ChangeLog
index 34cd83992446..24ed7cbb0d7d 100644
--- a/sys-libs/libcxxrt/ChangeLog
+++ b/sys-libs/libcxxrt/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-libs/libcxxrt
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxxrt/ChangeLog,v 1.1 2012/05/28 13:58:04 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxxrt/ChangeLog,v 1.2 2012/05/31 20:48:43 aballier Exp $
+
+ 31 May 2012; Alexis Ballier <aballier@gentoo.org> libcxxrt-9999.ebuild,
+ +files/Makefile, +files/Makefile.test, +files/unwind.h:
+ Use our own makefiles, its so simple that we do not need to rely on cmake for
+ this. Build it on top of libunwind instead of using libgcc_s for unwinding.
+ Remove their libunwind bundled headers and ship a reduced one with only the
+ added macros libcxxrt needs. Build with -nodefaultlibs to ensure we do not
+ link to gcc libs. Add static-libs useflag. Give it a src_test.
*libcxxrt-9999 (28 May 2012)
*libcxxrt-0.0_p20120528 (28 May 2012)
diff --git a/sys-libs/libcxxrt/Manifest b/sys-libs/libcxxrt/Manifest
index 8095d557d3fc..99f7183721b1 100644
--- a/sys-libs/libcxxrt/Manifest
+++ b/sys-libs/libcxxrt/Manifest
@@ -2,16 +2,19 @@
Hash: SHA1
AUX 0001-Link-to-libdl-where-needed-for-dladdr-exception.cc.patch 754 RMD160 c1379b84315a7b11f3f5fcdf451ab94707c475fb SHA1 7f36f69413ad6b354c46045e8e4a403e7f18a0e0 SHA256 d7c05a139f5ee92ddba03b3ec283369c092eec6d5aba51a7e9557735bdc10936
+AUX Makefile 513 RMD160 7710c5b91ca1479971c1decabf8f837534e77a97 SHA1 a0258345bce4a01928214228227ee7d6ffbd5121 SHA256 868714ac74fae3d3a4b21efff691d89d38df4b00052c8e788b4188de189ef29e
+AUX Makefile.test 172 RMD160 4213000a4982e63b92a2f0bcb84e72218f277f5c SHA1 ff68d0e8f9b16f49bf9b11cce219b26a30ded8f9 SHA256 af6cadd483849ae47f6ca6db3dfe03df8d5f8437c445f0f9a7fdcfb182fe88e1
AUX prepare_snapshot.sh 426 RMD160 b66c0160c06ab566cddb84d5e6b7bcc95e13fff8 SHA1 4abd5c206cbca34baa23fddabf26e03c76b1ceac SHA256 113d9ffc9fb7d7232d8ed72cb00121ffafbc11c2076bcd86f1f4b50d1a5e1642
+AUX unwind.h 3211 RMD160 f68aff844d30bc2b4b26d2d46ea744e1649025b0 SHA1 0112bcf6b840c4673139187b204e4ca688193023 SHA256 fb24810e46a48727b91930c7e2267c521a478c90c9dcacb8c8c0d4e2fae3b9a1
DIST libcxxrt-0.0_p20120528.tar.xz 57004 RMD160 ad0965a938d32cac87f9457f08075833e4cd059a SHA1 f7b4455bdd7f529648b2740506c0d9698f18bdd0 SHA256 a44008f946ab94a16845f26eaed54be5dabdc2ed5c3b66dd7678086a127b2263
EBUILD libcxxrt-0.0_p20120528.ebuild 1264 RMD160 54f1cfc7934365e9d9086a8475fe0d5d7a84294b SHA1 1112c29beefbd8a2e3df0b390debe22e8eeff734 SHA256 3db1b228b80ab9ed0b491a04be56e244a67635130921870812e5c66e16da016e
-EBUILD libcxxrt-9999.ebuild 1255 RMD160 b0d34624c2af40a1b6ab526558d2bee2aeb2ed9b SHA1 078de92f58236cd0f19de8285903856da7fd9a2b SHA256 f82a8f224ac81240933f6b32a5572de22d1b51450186cc0f8092c3b593faa1ac
-MISC ChangeLog 535 RMD160 b260d217231d5e5b24a3014c4e9cd1b59b84e65d SHA1 e29cd0d9893e89f667754f59b6e236ec976a33bb SHA256 6bc25ce1f7b93a15738755e4fd5d3237861c48e129468455fbfcb9d6d9b10df2
+EBUILD libcxxrt-9999.ebuild 1846 RMD160 32c9e6822b6124004ba9dd5f18aed86715e6f8d1 SHA1 251ca9e8f142660d65e3be21872b0f67f1b0c602 SHA256 7fa7e055afbc14d11bd6257329d89b56509a314b9ae022a77fc442bbd63e6922
+MISC ChangeLog 1046 RMD160 f7424bd78de31a1c7aef8dbbf7d810ce23265fe3 SHA1 e79d3ec9e4ec1e88136f731bcaa30bdcbf1977a7 SHA256 ef2e1c21448740f647eee0651cb81b78c311c3b64616d34c426b5c887bf8a820
MISC metadata.xml 261 RMD160 e78840f36015e55dd212c58537d08f7345911c84 SHA1 e386acfff07ae5e959cfe88424bee760a2f219df SHA256 79e4408c376b1533805b02d5ba420f98d4b0c5bdbb63f79fd8de60805a06cf4d
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
-iEYEARECAAYFAk/DhHIACgkQvFcC4BYPU0okHwCgpDUU9lpAJCgxuetY/wcFV6cb
-zSwAoIf9tjR8IEsprkjfmlkCGImwv9DS
-=vOW5
+iEYEARECAAYFAk/H2TAACgkQvFcC4BYPU0ogKQCfZ33WAsT0AmdXkbL85WCXZ9cQ
+udgAn1AssEtXunbG9KdHEbx5i7OwhSY+
+=gRAt
-----END PGP SIGNATURE-----
diff --git a/sys-libs/libcxxrt/files/Makefile b/sys-libs/libcxxrt/files/Makefile
new file mode 100644
index 000000000000..18b90a7cf712
--- /dev/null
+++ b/sys-libs/libcxxrt/files/Makefile
@@ -0,0 +1,23 @@
+LIB=cxxrt
+MAJ=1
+OBJS=dynamic_cast.o exception.o guard.o stdexcept.o typeinfo.o memory.o auxhelper.o libelftc_dem_gnu3.o
+SOBJS=${OBJS:.o=.So}
+
+static: lib$(LIB).a
+
+shared: lib$(LIB).so
+
+%.So: %.cc
+ $(CXX) -fPIC $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+%.So: %.c
+ $(CC) -fPIC $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+lib$(LIB).a: $(OBJS)
+ $(AR) cr $@ $^
+
+lib$(LIB).so.$(MAJ): $(SOBJS)
+ $(CXX) -fPIC -nodefaultlibs $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@ $^ $(LIBS)
+
+lib$(LIB).so: lib$(LIB).so.$(MAJ)
+ ln -s $< $@
diff --git a/sys-libs/libcxxrt/files/Makefile.test b/sys-libs/libcxxrt/files/Makefile.test
new file mode 100644
index 000000000000..55099426e7b4
--- /dev/null
+++ b/sys-libs/libcxxrt/files/Makefile.test
@@ -0,0 +1,7 @@
+OBJS=test.o test_exception.o test_guard.o test_typeinfo.o
+
+cxxrttest: $(OBJS)
+ $(CXX) -nodefaultlibs $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+check: cxxrttest
+ ./cxxrttest
diff --git a/sys-libs/libcxxrt/files/unwind.h b/sys-libs/libcxxrt/files/unwind.h
new file mode 100644
index 000000000000..04b1f1d18b8f
--- /dev/null
+++ b/sys-libs/libcxxrt/files/unwind.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2012 David Chisnall. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include_next <unwind.h>
+
+#ifndef CXXRT_UNWIND_H_INCLUDED
+#define CXXRT_UNWIND_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __arm__
+#define DECLARE_PERSONALITY_FUNCTION(name) \
+_Unwind_Reason_Code name(_Unwind_State state,\
+ struct _Unwind_Exception *exceptionObject,\
+ struct _Unwind_Context *context);
+
+#define BEGIN_PERSONALITY_FUNCTION(name) \
+_Unwind_Reason_Code name(_Unwind_State state,\
+ struct _Unwind_Exception *exceptionObject,\
+ struct _Unwind_Context *context)\
+{\
+ int version = 1;\
+ uint64_t exceptionClass = exceptionObject->exception_class;\
+ int actions;\
+ switch (state)\
+ {\
+ default: return _URC_FAILURE;\
+ case _US_VIRTUAL_UNWIND_FRAME:\
+ {\
+ actions = _UA_SEARCH_PHASE;\
+ break;\
+ }\
+ case _US_UNWIND_FRAME_STARTING:\
+ {\
+ actions = _UA_CLEANUP_PHASE;\
+ if (exceptionObject->barrier_cache.sp == _Unwind_GetGR(context, 13))\
+ {\
+ actions |= _UA_HANDLER_FRAME;\
+ }\
+ break;\
+ }\
+ case _US_UNWIND_FRAME_RESUME:\
+ {\
+ return continueUnwinding(exceptionObject, context);\
+ break;\
+ }\
+ }\
+ _Unwind_SetGR (context, 12, (unsigned long)exceptionObject);\
+
+#define CALL_PERSONALITY_FUNCTION(name) name(state,exceptionObject,context)
+#else
+#define DECLARE_PERSONALITY_FUNCTION(name) \
+_Unwind_Reason_Code name(int version,\
+ _Unwind_Action actions,\
+ uint64_t exceptionClass,\
+ struct _Unwind_Exception *exceptionObject,\
+ struct _Unwind_Context *context);
+#define BEGIN_PERSONALITY_FUNCTION(name) \
+_Unwind_Reason_Code name(int version,\
+ _Unwind_Action actions,\
+ uint64_t exceptionClass,\
+ struct _Unwind_Exception *exceptionObject,\
+ struct _Unwind_Context *context)\
+{
+
+#define CALL_PERSONALITY_FUNCTION(name) name(version, actions, exceptionClass, exceptionObject, context)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sys-libs/libcxxrt/libcxxrt-9999.ebuild b/sys-libs/libcxxrt/libcxxrt-9999.ebuild
index 3d47de5158c0..aed04fc631d1 100644
--- a/sys-libs/libcxxrt/libcxxrt-9999.ebuild
+++ b/sys-libs/libcxxrt/libcxxrt-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxxrt/libcxxrt-9999.ebuild,v 1.1 2012/05/28 13:58:04 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxxrt/libcxxrt-9999.ebuild,v 1.2 2012/05/31 20:48:43 aballier Exp $
EAPI=4
@@ -8,7 +8,7 @@ EGIT_REPO_URI="git://github.com/pathscale/libcxxrt.git"
[ "${PV%9999}" != "${PV}" ] && SCM="git-2" || SCM=""
-inherit cmake-utils ${SCM} base flag-o-matic
+inherit base flag-o-matic toolchain-funcs portability ${SCM}
DESCRIPTION="C++ Runtime from PathScale, FreeBSD and NetBSD."
HOMEPAGE="https://github.com/pathscale/libcxxrt http://www.pathscale.com/node/265"
@@ -26,29 +26,44 @@ if [ "${PV%9999}" = "${PV}" ] ; then
else
KEYWORDS=""
fi
-IUSE=""
+IUSE="static-libs"
-RDEPEND=""
+RDEPEND=">=sys-libs/libunwind-1.0.1-r1"
DEPEND="${RDEPEND}
${DEPEND}"
-PATCHES=( "${FILESDIR}/0001-Link-to-libdl-where-needed-for-dladdr-exception.cc.patch" )
-
src_prepare() {
base_src_prepare
+ cp "${FILESDIR}/Makefile" src/ || die
+ cp "${FILESDIR}/Makefile.test" test/Makefile || die
+ rm -f src/unwind* || die
+ cp -f "${FILESDIR}/unwind.h" src/ || die
+}
+
+src_compile() {
+ # Notes: we build -nodefaultlibs to avoid linking to gcc libs.
+ # libcxxrt needs: dladdr (dlopen_lib), libunwind (or libgcc_s but we build
+ # over libunwind) and the libc.
+ tc-export CC CXX AR
+ append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
+ cd "${S}/src"
+ LIBS="$(dlopen_lib) -lunwind -lc" emake shared
+ use static-libs && emake static
+}
+
+src_test() {
+ cd "${S}/test"
+ LD_LIBRARY_PATH="${S}/src:${LD_LIBRARY_PATH}" LIBS="-L${S}/src -lcxxrt -lc" emake check
}
src_install() {
# TODO: See README. Maybe hide it in a subdir and let only libcxx know about
# it. FreeBSD head installs it in /lib
- cd "${CMAKE_BUILD_DIR}"
- dolib.so lib/${PN}.so
- dolib.a lib/${PN}.a
-
- cd "${S}"
+ dolib.so src/${PN}.so*
+ use static-libs && dolib.a src/${PN}.a
insinto /usr/include/libcxxrt/
- doins src/cxxabi.h src/unwind*.h
+ doins src/cxxabi.h
dodoc AUTHORS COPYRIGHT README
}