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;
+--- glog-0.4.0/src/symbolize_unittest.cc.orig 2019-03-22 03:51:46.000000000 +0100
++++ glog-0.4.0/src/symbolize_unittest.cc 2019-03-28 20:39:09.755256776 +0100
+@@ -77,9 +77,7 @@
# endif // __i386__
# else
# endif // __GNUC__ >= 4
+# define TEST_WITH_LABEL_ADDRESSES
#endif
- // A wrapper function for Symbolize() to make the unit test simple.
-@@ -289,22 +287,24 @@ TEST(Symbolize, SymbolizeWithDemanglingStackConsumption) {
+ // Make them C linkage to avoid mangled names.
+@@ -312,8 +310,9 @@
extern "C" {
inline void* always_inline inline_func() {
- register void *pc = NULL;
+ void *pc = NULL;
-#ifdef TEST_X86_32_AND_64
- __asm__ __volatile__("call 1f; 1: pop %0" : "=r"(pc));
+#ifdef TEST_WITH_LABEL_ADDRESSES
#endif
return pc;
}
-
+@@ -321,14 +320,15 @@
+ void* ATTRIBUTE_NOINLINE non_inline_func();
void* ATTRIBUTE_NOINLINE non_inline_func() {
- register void *pc = NULL;
+ void *pc = NULL;
-#ifdef TEST_X86_32_AND_64
- __asm__ __volatile__("call 1f; 1: pop %0" : "=r"(pc));
+#ifdef TEST_WITH_LABEL_ADDRESSES
return pc;
}
- void ATTRIBUTE_NOINLINE TestWithPCInsideNonInlineFunction() {
+ static 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() {
+@@ -338,7 +338,7 @@
}
- void ATTRIBUTE_NOINLINE TestWithPCInsideInlineFunction() {
+ static 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.
+++ /dev/null
-From b1639e3014996fbc7635870e013559c54e7e3b2f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?David=20Mart=C3=ADnez=20Moreno?= <ender@debian.org>
-Date: Thu, 13 Aug 2015 09:31:26 -0700
-Subject: [PATCH] Fix ABI demangling for the GCC 5.x case.
-
-When glog is compiled with gcc-5.2 in cxx11 ABI mode, it barfs about unmangled symbols. This patches it getting inspiration from binutils and demangle.cc itself, although it may be totally wrong or maybe have to use ParseAbiTag in more places. I haven't read the spec for the symbols, though.
-
-This patch makes the demangle unit test pass correctly.
----
- src/demangle.cc | 19 +++++++++++++++++++
- 1 file changed, 19 insertions(+)
-
-diff --git a/src/demangle.cc b/src/demangle.cc
-index e858181..0f0c831 100644
---- a/src/demangle.cc
-+++ b/src/demangle.cc
-@@ -439,6 +439,7 @@ static bool ParseExprPrimary(State *state);
- static bool ParseLocalName(State *state);
- static bool ParseDiscriminator(State *state);
- static bool ParseSubstitution(State *state);
-+static bool ParseAbiTag(State *state);
-
- // Implementation note: the following code is a straightforward
- // translation of the Itanium C++ ABI defined in BNF with a couple of
-@@ -567,6 +568,8 @@ static bool ParseNestedName(State *state) {
- static bool ParsePrefix(State *state) {
- bool has_something = false;
- while (true) {
-+ if (ParseAbiTag(state))
-+ continue;
- MaybeAppendSeparator(state);
- if (ParseTemplateParam(state) ||
- ParseSubstitution(state) ||
-@@ -585,6 +588,22 @@ static bool ParsePrefix(State *state) {
- return true;
- }
-
-+// <abi-tag> ::= B <source-name>
-+static bool ParseAbiTag(State *state) {
-+ State copy = *state;
-+
-+ Append(state, "[", 1);
-+ if (ParseOneCharToken(state, 'B') &&
-+ ParseSourceName(state))
-+ {
-+ Append(state, "]", 1);
-+ return true;
-+ }
-+
-+ *state = copy;
-+ return false;
-+}
-+
- // <unqualified-name> ::= <operator-name>
- // ::= <ctor-dtor-name>
- // ::= <source-name>
Summary: A C++ application logging library
Summary(pl.UTF-8): Biblioteka do logowania dla aplikacji w C++
Name: glog
-Version: 0.3.5
-Release: 3
+Version: 0.4.0
+Release: 1
License: BSD
Group: Libraries
#Source0Download: https://github.com/google/glog/releases
Source0: https://github.com/google/glog/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 5df6d78b81e51b90ac0ecd7ed932b0d4
+# Source0-md5: 0daea8785e6df922d7887755c3d100d0
Patch0: %{name}-gflags.patch
Patch1: avoid-inline-asm.patch
-Patch2: gcc5.patch
URL: https://github.com/google/glog
BuildRequires: autoconf >= 2.57
BuildRequires: automake
BuildConflicts: gmock-devel
BuildConflicts: gtest-devel
%endif
-%ifarch %{ix86} %{x8664} arm hppa ia64 mips ppc ppc64 sh
+%ifarch %{ix86} %{x8664} x32 %{arm} hppa ia64 mips ppc ppc64 sh
BuildRequires: libunwind-devel
%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%setup -q
%patch0 -p1
%patch1 -p1
-%patch2 -p1
%build
%if %{with tests}
%files
%defattr(644,root,root,755)
-%doc AUTHORS COPYING ChangeLog README
+%doc AUTHORS COPYING ChangeLog README.md
%attr(755,root,root) %{_libdir}/libglog.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libglog.so.0