diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-09-10 22:04:15 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-09-10 22:04:15 +0000 |
commit | 032e178122848d7358d361b02a069084dafd5527 (patch) | |
tree | 18cbbdb33dc8177e58cfd58075184c4100929c1f /dev-cpp | |
parent | static-libs is for building static libraries (diff) | |
download | gentoo-2-032e178122848d7358d361b02a069084dafd5527.tar.gz gentoo-2-032e178122848d7358d361b02a069084dafd5527.tar.bz2 gentoo-2-032e178122848d7358d361b02a069084dafd5527.zip |
Make unittest a bit more portable.
(Portage version: 2.2.0_alpha120/cvs/Linux x86_64)
Diffstat (limited to 'dev-cpp')
-rw-r--r-- | dev-cpp/glog/ChangeLog | 6 | ||||
-rw-r--r-- | dev-cpp/glog/files/glog-0.3.2-avoid-inline-asm.patch | 56 | ||||
-rw-r--r-- | dev-cpp/glog/glog-0.3.2.ebuild | 6 |
3 files changed, 66 insertions, 2 deletions
diff --git a/dev-cpp/glog/ChangeLog b/dev-cpp/glog/ChangeLog index 76ae40657fe1..1a256bb7d750 100644 --- a/dev-cpp/glog/ChangeLog +++ b/dev-cpp/glog/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-cpp/glog # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-cpp/glog/ChangeLog,v 1.5 2012/07/23 21:04:46 maekke Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-cpp/glog/ChangeLog,v 1.6 2012/09/10 22:04:15 vapier Exp $ + + 10 Sep 2012; Mike Frysinger <vapier@gentoo.org> + +files/glog-0.3.2-avoid-inline-asm.patch, glog-0.3.2.ebuild: + Make unittest a bit more portable. 23 Jul 2012; Markus Meier <maekke@gentoo.org> glog-0.3.2.ebuild: add ~arm, bug #426430 diff --git a/dev-cpp/glog/files/glog-0.3.2-avoid-inline-asm.patch b/dev-cpp/glog/files/glog-0.3.2-avoid-inline-asm.patch new file mode 100644 index 000000000000..b6fa9cdb7374 --- /dev/null +++ b/dev-cpp/glog/files/glog-0.3.2-avoid-inline-asm.patch @@ -0,0 +1,56 @@ +http://code.google.com/p/google-glog/issues/detail?id=130 + +make the code work with all gcc targets + +--- a/src/symbolize_unittest.cc ++++ b/src/symbolize_unittest.cc +@@ -60,9 +60,7 @@ using namespace GOOGLE_NAMESPACE; + # endif // __i386__ + # else + # endif // __GNUC__ >= 4 +-# if defined(__i386__) || defined(__x86_64__) +-# define TEST_X86_32_AND_64 1 +-# endif // defined(__i386__) || defined(__x86_64__) ++# define TEST_WITH_LABEL_ADDRESSES + #endif + + // A wrapper function for Symbolize() to make the unit test simple. +@@ -289,22 +287,24 @@ TEST(Symbolize, SymbolizeWithDemanglingStackConsumption) { + extern "C" { + inline void* always_inline inline_func() { + register void *pc = NULL; +-#ifdef TEST_X86_32_AND_64 +- __asm__ __volatile__("call 1f; 1: pop %0" : "=r"(pc)); ++#ifdef TEST_WITH_LABEL_ADDRESSES ++ pc = &&curr_pc; ++ curr_pc: + #endif + return pc; + } + + void* ATTRIBUTE_NOINLINE non_inline_func() { + register void *pc = NULL; +-#ifdef TEST_X86_32_AND_64 +- __asm__ __volatile__("call 1f; 1: pop %0" : "=r"(pc)); ++#ifdef TEST_WITH_LABEL_ADDRESSES ++ pc = &&curr_pc; ++ curr_pc: + #endif + return pc; + } + + void ATTRIBUTE_NOINLINE TestWithPCInsideNonInlineFunction() { +-#if defined(TEST_X86_32_AND_64) && defined(HAVE_ATTRIBUTE_NOINLINE) ++#if defined(TEST_WITH_LABEL_ADDRESSES) && defined(HAVE_ATTRIBUTE_NOINLINE) + void *pc = non_inline_func(); + const char *symbol = TrySymbolize(pc); + CHECK(symbol != NULL); +@@ -314,7 +314,7 @@ void ATTRIBUTE_NOINLINE TestWithPCInsideNonInlineFunction() { + } + + void ATTRIBUTE_NOINLINE TestWithPCInsideInlineFunction() { +-#if defined(TEST_X86_32_AND_64) && defined(HAVE_ALWAYS_INLINE) ++#if defined(TEST_WITH_LABEL_ADDRESSES) && defined(HAVE_ALWAYS_INLINE) + void *pc = inline_func(); // Must be inlined. + const char *symbol = TrySymbolize(pc); + CHECK(symbol != NULL); diff --git a/dev-cpp/glog/glog-0.3.2.ebuild b/dev-cpp/glog/glog-0.3.2.ebuild index 08618e583a3e..60dbf959c548 100644 --- a/dev-cpp/glog/glog-0.3.2.ebuild +++ b/dev-cpp/glog/glog-0.3.2.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/dev-cpp/glog/glog-0.3.2.ebuild,v 1.2 2012/07/23 21:04:46 maekke Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-cpp/glog/glog-0.3.2.ebuild,v 1.3 2012/09/10 22:04:15 vapier Exp $ EAPI="4" inherit eutils @@ -22,6 +22,10 @@ DEPEND="${RDEPEND} dev-cpp/gtest )" +src_prepare() { + epatch "${FILESDIR}"/${P}-avoid-inline-asm.patch +} + src_configure() { export ac_cv_lib_gflags_main=$(usex gflags) export ac_cv_lib_unwind_backtrace=$(usex unwind) |