You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2020/12/03 22:06:29 UTC

[kudu] 03/03: [thirdparty] Upgrade glog to 0.4.0

This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 2943aa701ee092158c2084c614a91f92513ef7c4
Author: Grant Henke <gr...@apache.org>
AuthorDate: Fri May 15 14:03:18 2020 -0500

    [thirdparty] Upgrade glog to 0.4.0
    
    We are currently on glog 0.3.5 which is from 2017. We also have 4 patches
    on top of that version in thirdparty.
    
    This patch upgrades us to glog 0.4.0 which was released in 2019 and
    removes 3/4 patches that are now included in the release.
    
    I needed to adjust the remaining patch to apply and fix some usage of
    the CHECK macros to wrap in parenthesis to prevent macro expansion
    issues as well.
    
    I also adjusted the build scripts to use cmake instead of autoconf so
    that I could disable building the tests.
    
    Change-Id: I7101e985280157a08ecba3f1e236f9aaa23811cf
    Reviewed-on: http://gerrit.cloudera.org:8080/16817
    Tested-by: Grant Henke <gr...@apache.org>
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
    Reviewed-by: Andrew Wong <aw...@cloudera.com>
---
 src/kudu/fs/dir_util-test.cc                       |   8 +-
 src/kudu/util/logging.h                            |  13 +-
 src/kudu/util/rw_mutex-test.cc                     |  24 +--
 thirdparty/build-definitions.sh                    |  19 +-
 thirdparty/download-thirdparty.sh                  |   5 +-
 thirdparty/patches/glog-fix-symbolization.patch    | 212 ---------------------
 .../glog-issue-198-fix-unused-warnings.patch       |  47 -----
 .../patches/glog-issue-54-dont-build-tests.patch   | 147 --------------
 .../glog-support-stacktrace-for-aarch64.patch      |  21 +-
 thirdparty/vars.sh                                 |   2 +-
 10 files changed, 43 insertions(+), 455 deletions(-)

diff --git a/src/kudu/fs/dir_util-test.cc b/src/kudu/fs/dir_util-test.cc
index d669188..07bcb09 100644
--- a/src/kudu/fs/dir_util-test.cc
+++ b/src/kudu/fs/dir_util-test.cc
@@ -82,15 +82,15 @@ TEST_F(KuduTest, Locking) {
 
   // Note: we must use a death test here because file locking is only
   // disallowed across processes, and death tests spawn child processes.
-  ASSERT_DEATH({
+  ASSERT_DEATH(({
     DirInstanceMetadataFile second(env_, "", kType, kFileName);
     CHECK_OK(second.LoadFromDisk());
     CHECK_EQ(kUuid, second.uuid());
     CHECK_OK(second.Lock());
-  }, "Could not lock");
+  }), "Could not lock");
 
   ASSERT_OK(first.Unlock());
-  ASSERT_DEATH({
+  ASSERT_DEATH(({
     DirInstanceMetadataFile second(env_, "", kType, kFileName);
     CHECK_OK(second.LoadFromDisk());
     CHECK_EQ(kUuid, second.uuid());
@@ -100,7 +100,7 @@ TEST_F(KuduTest, Locking) {
     } else {
       LOG(FATAL) << "Could not lock: " << s.ToString();
     }
-  }, "Lock successfully acquired");
+  }), "Lock successfully acquired");
 }
 
 } // namespace fs
diff --git a/src/kudu/util/logging.h b/src/kudu/util/logging.h
index f8b03b5..71dd304 100644
--- a/src/kudu/util/logging.h
+++ b/src/kudu/util/logging.h
@@ -226,9 +226,6 @@ enum PRIVATE_ThrottleMsg {THROTTLE_MSG};
 
 // The direct user-facing macros.
 #define KLOG_EVERY_N(severity, n) \
-  GOOGLE_GLOG_COMPILE_ASSERT(google::GLOG_ ## severity < \
-                             google::NUM_SEVERITIES, \
-                             INVALID_REQUESTED_LOG_SEVERITY); \
   KUDU_SOME_KIND_OF_LOG_EVERY_N(severity, (n), google::LogMessage::SendToLog)
 
 #define KSYSLOG_EVERY_N(severity, n) \
@@ -246,23 +243,23 @@ enum PRIVATE_ThrottleMsg {THROTTLE_MSG};
 // We also disable the un-annotated glog macros for anyone who includes this header.
 #undef LOG_EVERY_N
 #define LOG_EVERY_N(severity, n) \
-  GOOGLE_GLOG_COMPILE_ASSERT(false, "LOG_EVERY_N is deprecated. Please use KLOG_EVERY_N.")
+  static_assert(false, "LOG_EVERY_N is deprecated. Please use KLOG_EVERY_N.")
 
 #undef SYSLOG_EVERY_N
 #define SYSLOG_EVERY_N(severity, n) \
-  GOOGLE_GLOG_COMPILE_ASSERT(false, "SYSLOG_EVERY_N is deprecated. Please use KSYSLOG_EVERY_N.")
+  static_assert(false, "SYSLOG_EVERY_N is deprecated. Please use KSYSLOG_EVERY_N.")
 
 #undef PLOG_EVERY_N
 #define PLOG_EVERY_N(severity, n) \
-  GOOGLE_GLOG_COMPILE_ASSERT(false, "PLOG_EVERY_N is deprecated. Please use KPLOG_EVERY_N.")
+  static_assert(false, "PLOG_EVERY_N is deprecated. Please use KPLOG_EVERY_N.")
 
 #undef LOG_FIRST_N
 #define LOG_FIRST_N(severity, n) \
-  GOOGLE_GLOG_COMPILE_ASSERT(false, "LOG_FIRST_N is deprecated. Please use KLOG_FIRST_N.")
+  static_assert(false, "LOG_FIRST_N is deprecated. Please use KLOG_FIRST_N.")
 
 #undef LOG_IF_EVERY_N
 #define LOG_IF_EVERY_N(severity, condition, n) \
-  GOOGLE_GLOG_COMPILE_ASSERT(false, "LOG_IF_EVERY_N is deprecated. Please use KLOG_IF_EVERY_N.")
+  static_assert(false, "LOG_IF_EVERY_N is deprecated. Please use KLOG_IF_EVERY_N.")
 
 namespace kudu {
 
diff --git a/src/kudu/util/rw_mutex-test.cc b/src/kudu/util/rw_mutex-test.cc
index c2cb394..ea6f4d6 100644
--- a/src/kudu/util/rw_mutex-test.cc
+++ b/src/kudu/util/rw_mutex-test.cc
@@ -117,40 +117,40 @@ TEST_P(RWMutexTest, TestLockChecking) {
     lock_.ReadLock();
   }, "already holding lock for reading");
 
-  EXPECT_DEATH({
+  EXPECT_DEATH(({
     CHECK(lock_.TryReadLock());
     CHECK(lock_.TryReadLock());
-  }, "already holding lock for reading");
+  }), "already holding lock for reading");
 
   EXPECT_DEATH({
     lock_.ReadLock();
     lock_.WriteLock();
   }, "already holding lock for reading");
 
-  EXPECT_DEATH({
+  EXPECT_DEATH(({
     CHECK(lock_.TryReadLock());
     CHECK(lock_.TryWriteLock());
-  }, "already holding lock for reading");
+  }), "already holding lock for reading");
 
   EXPECT_DEATH({
     lock_.WriteLock();
     lock_.ReadLock();
   }, "already holding lock for writing");
 
-  EXPECT_DEATH({
+  EXPECT_DEATH(({
     CHECK(lock_.TryWriteLock());
     CHECK(lock_.TryReadLock());
-  }, "already holding lock for writing");
+  }), "already holding lock for writing");
 
   EXPECT_DEATH({
     lock_.WriteLock();
     lock_.WriteLock();
   }, "already holding lock for writing");
 
-  EXPECT_DEATH({
+  EXPECT_DEATH(({
     CHECK(lock_.TryWriteLock());
     CHECK(lock_.TryWriteLock());
-  }, "already holding lock for writing");
+  }), "already holding lock for writing");
 
   EXPECT_DEATH({
     lock_.ReadUnlock();
@@ -165,20 +165,20 @@ TEST_P(RWMutexTest, TestLockChecking) {
     lock_.WriteUnlock();
   }, "already holding lock for reading");
 
-  EXPECT_DEATH({
+  EXPECT_DEATH(({
     CHECK(lock_.TryReadLock());
     lock_.WriteUnlock();
-  }, "already holding lock for reading");
+  }), "already holding lock for reading");
 
   EXPECT_DEATH({
     lock_.WriteLock();
     lock_.ReadUnlock();
   }, "already holding lock for writing");
 
-  EXPECT_DEATH({
+  EXPECT_DEATH(({
     CHECK(lock_.TryWriteLock());
     lock_.ReadUnlock();
-  }, "already holding lock for writing");
+  }), "already holding lock for writing");
 }
 #endif
 
diff --git a/thirdparty/build-definitions.sh b/thirdparty/build-definitions.sh
index 70e7af3..485ad9e 100644
--- a/thirdparty/build-definitions.sh
+++ b/thirdparty/build-definitions.sh
@@ -428,7 +428,7 @@ build_glog() {
   GLOG_BDIR=$TP_BUILD_DIR/$GLOG_NAME$MODE_SUFFIX
   mkdir -p $GLOG_BDIR
   pushd $GLOG_BDIR
-
+  rm -Rf CMakeCache.txt CMakeFiles/
   # glog depends on libunwind and gflags.
   #
   # Specifying -Wl,-rpath has different default behavior on GNU binutils ld vs.
@@ -441,15 +441,18 @@ build_glog() {
   #
   # This comment applies both here and the locations elsewhere in this script
   # where we add something to -Wl,-rpath.
-  CXXFLAGS="$EXTRA_CXXFLAGS -I$PREFIX/include" \
+  CFLAGS="$EXTRA_CFLAGS -fPIC" \
+    CXXFLAGS="$EXTRA_CXXFLAGS -I$PREFIX/include -fPIC" \
     LDFLAGS="$EXTRA_LDFLAGS -L$PREFIX/lib -Wl,-rpath,$PREFIX/lib" \
     LIBS="$EXTRA_LIBS" \
-    $GLOG_SOURCE/configure \
-    --with-pic \
-    --prefix=$PREFIX \
-    --with-gflags=$PREFIX
-  fixup_libtool
-  make -j$PARALLEL $EXTRA_MAKEFLAGS install
+    cmake \
+    -DCMAKE_BUILD_TYPE=release \
+    -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX \
+    -DBUILD_TESTING=OFF \
+    -DWITH_GFLAGS=ON \
+    $EXTRA_CMAKE_FLAGS \
+    $GLOG_SOURCE
+  ${NINJA:-make} -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh
index 63f746f..f594af1 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -170,14 +170,11 @@ fetch_and_patch() {
 mkdir -p $TP_SOURCE_DIR
 cd $TP_SOURCE_DIR
 
-GLOG_PATCHLEVEL=4
+GLOG_PATCHLEVEL=1
 fetch_and_patch \
  glog-${GLOG_VERSION}.tar.gz \
  $GLOG_SOURCE \
  $GLOG_PATCHLEVEL \
- "patch -p0 < $TP_DIR/patches/glog-issue-198-fix-unused-warnings.patch" \
- "patch -p0 < $TP_DIR/patches/glog-issue-54-dont-build-tests.patch" \
- "patch -p1 < $TP_DIR/patches/glog-fix-symbolization.patch" \
  "patch -p1 < $TP_DIR/patches/glog-support-stacktrace-for-aarch64.patch" \
  "autoreconf -fvi"
 
diff --git a/thirdparty/patches/glog-fix-symbolization.patch b/thirdparty/patches/glog-fix-symbolization.patch
deleted file mode 100644
index 1f11de9..0000000
--- a/thirdparty/patches/glog-fix-symbolization.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-commit c4d37a7
-Author: Peter Collingbourne <pc...@google.com>
-Date:   Thu Nov 2 16:53:21 2017 -0700
-
-    Compute base addresses from program headers while reading /proc/self/maps.
-    
-    We previously had logic to compute the base address from program
-    headers as part of symbolization. The problem is that we need a correct
-    base address earlier in order to adjust a PC into the image's address
-    space, as these addresses can appear in unsymbolized output.
-    
-    There was previously an assumption that only the mapping that
-    was lowest in the address space did not need to be adjusted. This
-    assumption is not guaranteed (for example, the kernel may choose to
-    map an ET_DYN lowest) and in fact turned out to be wrong in binaries
-    linked with lld because the first mapping is read-only.
-    
-    The solution is to move the program header reading logic into the
-    code that reads /proc/self/maps.
-    
-    There is a change in semantics for clients that install a callback
-    using the InstallSymbolizeOpenObjectFileCallback function. Any such
-    clients will need to return a correct base address from the callback
-    by reading program headers using code similar to that in the function
-    OpenObjectFileContainingPcAndGetStartAddress.
-
-    (Modified by Adar to remove changes to Makefile.am)
-
-diff --git a/src/symbolize.cc b/src/symbolize.cc
-index 953f1db..98a754f 100644
---- a/src/symbolize.cc
-+++ b/src/symbolize.cc
-@@ -56,6 +56,8 @@
- 
- #if defined(HAVE_SYMBOLIZE)
- 
-+#include <string.h>
-+
- #include <limits>
- 
- #include "symbolize.h"
-@@ -325,41 +327,17 @@ FindSymbol(uint64_t pc, const int fd, char *out, int out_size,
- // both regular and dynamic symbol tables if necessary.  On success,
- // write the symbol name to "out" and return true.  Otherwise, return
- // false.
--static bool GetSymbolFromObjectFile(const int fd, uint64_t pc,
--                                    char *out, int out_size,
--                                    uint64_t map_base_address) {
-+static bool GetSymbolFromObjectFile(const int fd,
-+                                    uint64_t pc,
-+                                    char* out,
-+                                    int out_size,
-+                                    uint64_t base_address) {
-   // Read the ELF header.
-   ElfW(Ehdr) elf_header;
-   if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) {
-     return false;
-   }
- 
--  uint64_t symbol_offset = 0;
--  if (elf_header.e_type == ET_DYN) {  // DSO needs offset adjustment.
--    ElfW(Phdr) phdr;
--    // We need to find the PT_LOAD segment corresponding to the read-execute
--    // file mapping in order to correctly perform the offset adjustment.
--    for (unsigned i = 0; i != elf_header.e_phnum; ++i) {
--      if (!ReadFromOffsetExact(fd, &phdr, sizeof(phdr),
--                               elf_header.e_phoff + i * sizeof(phdr)))
--        return false;
--      if (phdr.p_type == PT_LOAD &&
--          (phdr.p_flags & (PF_R | PF_X)) == (PF_R | PF_X)) {
--        // Find the mapped address corresponding to virtual address zero. We do
--        // this by first adding p_offset. This gives us the mapped address of
--        // the start of the segment, or in other words the mapped address
--        // corresponding to the virtual address of the segment. (Note that this
--        // is distinct from the start address, as p_offset is not guaranteed to
--        // be page aligned.) We then subtract p_vaddr, which takes us to virtual
--        // address zero.
--        symbol_offset = map_base_address + phdr.p_offset - phdr.p_vaddr;
--        break;
--      }
--    }
--    if (symbol_offset == 0)
--      return false;
--  }
--
-   ElfW(Shdr) symtab, strtab;
- 
-   // Consult a regular symbol table first.
-@@ -369,8 +347,7 @@ static bool GetSymbolFromObjectFile(const int fd, uint64_t pc,
-                              symtab.sh_link * sizeof(symtab))) {
-       return false;
-     }
--    if (FindSymbol(pc, fd, out, out_size, symbol_offset,
--                   &strtab, &symtab)) {
-+    if (FindSymbol(pc, fd, out, out_size, base_address, &strtab, &symtab)) {
-       return true;  // Found the symbol in a regular symbol table.
-     }
-   }
-@@ -382,8 +359,7 @@ static bool GetSymbolFromObjectFile(const int fd, uint64_t pc,
-                              symtab.sh_link * sizeof(symtab))) {
-       return false;
-     }
--    if (FindSymbol(pc, fd, out, out_size, symbol_offset,
--                   &strtab, &symtab)) {
-+    if (FindSymbol(pc, fd, out, out_size, base_address, &strtab, &symtab)) {
-       return true;  // Found the symbol in a dynamic symbol table.
-     }
-   }
-@@ -532,7 +508,6 @@ OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc,
-                                              int out_file_name_size) {
-   int object_fd;
- 
--  // Open /proc/self/maps.
-   int maps_fd;
-   NO_INTR(maps_fd = open("/proc/self/maps", O_RDONLY));
-   FileDescriptor wrapped_maps_fd(maps_fd);
-@@ -540,6 +515,13 @@ OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc,
-     return -1;
-   }
- 
-+  int mem_fd;
-+  NO_INTR(mem_fd = open("/proc/self/mem", O_RDONLY));
-+  FileDescriptor wrapped_mem_fd(mem_fd);
-+  if (wrapped_mem_fd.get() < 0) {
-+    return -1;
-+  }
-+
-   // Iterate over maps and look for the map containing the pc.  Then
-   // look into the symbol tables inside.
-   char buf[1024];  // Big enough for line of sane /proc/self/maps
-@@ -575,11 +557,6 @@ OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc,
-     }
-     ++cursor;  // Skip ' '.
- 
--    // Check start and end addresses.
--    if (!(start_address <= pc && pc < end_address)) {
--      continue;  // We skip this map.  PC isn't in this map.
--    }
--
-     // Read flags.  Skip flags until we encounter a space or eol.
-     const char * const flags_start = cursor;
-     while (cursor < eol && *cursor != ' ') {
-@@ -590,6 +567,49 @@ OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc,
-       return -1;  // Malformed line.
-     }
- 
-+    // Determine the base address by reading ELF headers in process memory.
-+    ElfW(Ehdr) ehdr;
-+    // Skip non-readable maps.
-+    if (flags_start[0] == 'r' &&
-+        ReadFromOffsetExact(mem_fd, &ehdr, sizeof(ElfW(Ehdr)), start_address) &&
-+        memcmp(ehdr.e_ident, ELFMAG, SELFMAG) == 0) {
-+      switch (ehdr.e_type) {
-+        case ET_EXEC:
-+          base_address = 0;
-+          break;
-+        case ET_DYN:
-+          // Find the segment containing file offset 0. This will correspond
-+          // to the ELF header that we just read. Normally this will have
-+          // virtual address 0, but this is not guaranteed. We must subtract
-+          // the virtual address from the address where the ELF header was
-+          // mapped to get the base address.
-+          //
-+          // If we fail to find a segment for file offset 0, use the address
-+          // of the ELF header as the base address.
-+          base_address = start_address;
-+          for (unsigned i = 0; i != ehdr.e_phnum; ++i) {
-+            ElfW(Phdr) phdr;
-+            if (ReadFromOffsetExact(
-+                    mem_fd, &phdr, sizeof(phdr),
-+                    start_address + ehdr.e_phoff + i * sizeof(phdr)) &&
-+                phdr.p_type == PT_LOAD && phdr.p_offset == 0) {
-+              base_address = start_address - phdr.p_vaddr;
-+              break;
-+            }
-+          }
-+          break;
-+        default:
-+          // ET_REL or ET_CORE. These aren't directly executable, so they don't
-+          // affect the base address.
-+          break;
-+      }
-+    }
-+
-+    // Check start and end addresses.
-+    if (!(start_address <= pc && pc < end_address)) {
-+      continue;  // We skip this map.  PC isn't in this map.
-+    }
-+
-    // Check flags.  We are only interested in "r*x" maps.
-     if (flags_start[0] != 'r' || flags_start[2] != 'x') {
-       continue;  // We skip this map.
-@@ -604,19 +624,6 @@ OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc,
-     }
-     ++cursor;  // Skip ' '.
- 
--    // Don't subtract 'start_address' from the first entry:
--    // * If a binary is compiled w/o -pie, then the first entry in
--    //   process maps is likely the binary itself (all dynamic libs
--    //   are mapped higher in address space). For such a binary,
--    //   instruction offset in binary coincides with the actual
--    //   instruction address in virtual memory (as code section
--    //   is mapped to a fixed memory range).
--    // * If a binary is compiled with -pie, all the modules are
--    //   mapped high at address space (in particular, higher than
--    //   shadow memory of the tool), so the module can't be the
--    //   first entry.
--    base_address = ((num_maps == 1) ? 0U : start_address) - file_offset;
--
-     // Skip to file name.  "cursor" now points to dev.  We need to
-     // skip at least two spaces for dev and inode.
-     int num_spaces = 0;
diff --git a/thirdparty/patches/glog-issue-198-fix-unused-warnings.patch b/thirdparty/patches/glog-issue-198-fix-unused-warnings.patch
deleted file mode 100644
index caa8c61..0000000
--- a/thirdparty/patches/glog-issue-198-fix-unused-warnings.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Index: configure.ac
-===================================================================
---- configure.ac	(revision 142)
-+++ configure.ac	(working copy)
-@@ -80,15 +80,17 @@
-                         [Define if you have the 'pwrite' function]))
- 
- AX_C___ATTRIBUTE__
--# We only care about these two attributes.
-+# We only care about these attributes.
- if test x"$ac_cv___attribute__" = x"yes"; then
-   ac_cv___attribute___noreturn="__attribute__ ((noreturn))"
-   ac_cv___attribute___noinline="__attribute__ ((noinline))"
-   ac_cv___attribute___printf_4_5="__attribute__((__format__ (__printf__, 4, 5)))"
-+  ac_cv___attribute___unused="__attribute__ ((unused))"
- else
-   ac_cv___attribute___noreturn=
-   ac_cv___attribute___noinline=
-   ac_cv___attribute___printf_4_5=
-+  ac_cv___attribute___unused=
- fi
- 
- AX_C___BUILTIN_EXPECT
-@@ -214,6 +216,7 @@
- AC_SUBST(ac_cv___attribute___noreturn)
- AC_SUBST(ac_cv___attribute___noinline)
- AC_SUBST(ac_cv___attribute___printf_4_5)
-+AC_SUBST(ac_cv___attribute___unused)
- AC_SUBST(ac_cv_have___builtin_expect)
- AC_SUBST(ac_cv_have_stdint_h)
- AC_SUBST(ac_cv_have_systypes_h)
-Index: src/glog/logging.h.in
-===================================================================
---- src/glog/logging.h.in	(revision 142)
-+++ src/glog/logging.h.in	(working copy)
-@@ -908,8 +908,10 @@
- struct CrashReason;
- }  // namespace glog_internal_namespace_
- 
-+#define GOOGLE_GLOG_ATTRIBUTE_UNUSED @ac_cv___attribute___unused@
-+
- #define GOOGLE_GLOG_COMPILE_ASSERT(expr, msg) \
--  typedef @ac_google_namespace@::glog_internal_namespace_::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
-+  typedef @ac_google_namespace@::glog_internal_namespace_::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] GOOGLE_GLOG_ATTRIBUTE_UNUSED
- 
- #define LOG_EVERY_N(severity, n)                                        \
-   GOOGLE_GLOG_COMPILE_ASSERT(@ac_google_namespace@::GLOG_ ## severity < \
diff --git a/thirdparty/patches/glog-issue-54-dont-build-tests.patch b/thirdparty/patches/glog-issue-54-dont-build-tests.patch
deleted file mode 100644
index 3d81fab..0000000
--- a/thirdparty/patches/glog-issue-54-dont-build-tests.patch
+++ /dev/null
@@ -1,147 +0,0 @@
---- Makefile.am.orig	2016-09-16 13:39:40.053027310 -0700
-+++ Makefile.am	2016-09-16 13:36:27.899844745 -0700
-@@ -52,132 +52,6 @@
- 
- # The libraries libglog depends on.
- COMMON_LIBS = $(PTHREAD_LIBS) $(GFLAGS_LIBS) $(UNWIND_LIBS)
--# Compile switches for our unittest.
--TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS) $(GFLAGS_CFLAGS) \
--              $(MINGW_CFLAGS) $(AM_CXXFLAGS)
--# Libraries for our unittest.
--TEST_LIBS = $(GTEST_LIBS) $(GMOCK_LIBS) $(GFLAGS_LIBS)
--
--## unittests you want to run when people type 'make check'.
--## TESTS is for binary unittests, check_SCRIPTS for script-based unittests.
--## TESTS_ENVIRONMENT sets environment variables for when you run unittest,
--## but it only seems to take effect for *binary* unittests (argh!)
--TESTS =
--TESTS_ENVIRONMENT =
--check_SCRIPTS =
--# Every time you add a unittest to check_SCRIPTS, add it here too
--noinst_SCRIPTS =
--# Binaries used for script-based unittests.
--TEST_BINARIES =
--
--TESTS += logging_unittest
--logging_unittest_SOURCES = $(gloginclude_HEADERS) \
--                           src/logging_unittest.cc \
--                           src/config_for_unittests.h \
--                           src/mock-log.h
--nodist_logging_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
--logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
--logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
--logging_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
--
--check_SCRIPTS += logging_striplog_test_sh
--noinst_SCRIPTS += src/logging_striplog_test.sh
--logging_striplog_test_sh: logging_striptest0 logging_striptest2 logging_striptest10
--	$(top_srcdir)/src/logging_striplog_test.sh
--
--check_SCRIPTS += demangle_unittest_sh
--noinst_SCRIPTS += src/demangle_unittest.sh
--demangle_unittest_sh: demangle_unittest
--	$(builddir)/demangle_unittest  # force to create lt-demangle_unittest
--	$(top_srcdir)/src/demangle_unittest.sh
--
--check_SCRIPTS += signalhandler_unittest_sh
--noinst_SCRIPTS += src/signalhandler_unittest.sh
--signalhandler_unittest_sh: signalhandler_unittest
--	$(builddir)/signalhandler_unittest  # force to create lt-signalhandler_unittest
--	$(top_srcdir)/src/signalhandler_unittest.sh
--
--TEST_BINARIES += logging_striptest0
--logging_striptest0_SOURCES = $(gloginclude_HEADERS) \
--                             src/logging_striptest_main.cc
--nodist_logging_striptest0_SOURCES = $(nodist_gloginclude_HEADERS)
--logging_striptest0_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
--logging_striptest0_LDFLAGS = $(PTHREAD_CFLAGS)
--logging_striptest0_LDADD = libglog.la $(COMMON_LIBS)
--
--TEST_BINARIES += logging_striptest2
--logging_striptest2_SOURCES = $(gloginclude_HEADERS) \
--                             src/logging_striptest2.cc
--nodist_logging_striptest2_SOURCES = $(nodist_gloginclude_HEADERS)
--logging_striptest2_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
--logging_striptest2_LDFLAGS = $(PTHREAD_CFLAGS)
--logging_striptest2_LDADD = libglog.la $(COMMON_LIBS)
--
--TEST_BINARIES += logging_striptest10
--logging_striptest10_SOURCES = $(gloginclude_HEADERS) \
--                              src/logging_striptest10.cc
--nodist_logging_striptest10_SOURCES = $(nodist_gloginclude_HEADERS)
--logging_striptest10_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
--logging_striptest10_LDFLAGS = $(PTHREAD_CFLAGS)
--logging_striptest10_LDADD = libglog.la $(COMMON_LIBS)
--
--TESTS += demangle_unittest
--demangle_unittest_SOURCES = $(gloginclude_HEADERS) \
--                            src/demangle_unittest.cc
--nodist_demangle_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
--demangle_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
--demangle_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
--demangle_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
--
--TESTS += stacktrace_unittest
--stacktrace_unittest_SOURCES = $(gloginclude_HEADERS) \
--                              src/stacktrace_unittest.cc
--nodist_stacktrace_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
--stacktrace_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
--stacktrace_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
--stacktrace_unittest_LDADD = libglog.la $(COMMON_LIBS)
--
--TESTS += symbolize_unittest
--symbolize_unittest_SOURCES = $(gloginclude_HEADERS) \
--                              src/symbolize_unittest.cc
--nodist_symbolize_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
--symbolize_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
--symbolize_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
--symbolize_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
--
--TESTS += stl_logging_unittest
--stl_logging_unittest_SOURCES = $(gloginclude_HEADERS) \
--                               src/stl_logging_unittest.cc
--nodist_stl_logging_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
--stl_logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
--stl_logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
--stl_logging_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
--
--TEST_BINARIES += signalhandler_unittest
--signalhandler_unittest_SOURCES = $(gloginclude_HEADERS) \
--                               src/signalhandler_unittest.cc
--nodist_signalhandler_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
--signalhandler_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
--signalhandler_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
--signalhandler_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
--
--TESTS += utilities_unittest
--utilities_unittest_SOURCES = $(gloginclude_HEADERS) \
--                             src/utilities_unittest.cc
--nodist_utilities_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
--utilities_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
--utilities_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
--utilities_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
--
--if HAVE_GMOCK
--TESTS += mock_log_test
--mock_log_test_SOURCES = $(gloginclude_HEADERS) \
--                        src/mock-log_test.cc
--nodist_mock_log_test_SOURCES = $(nodist_gloginclude_HEADERS)
--mock_log_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(TEST_CFLAGS)
--mock_log_test_LDFLAGS = $(PTHREAD_CFLAGS)
--mock_log_test_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
--endif
- 
- ## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
- 
-@@ -212,11 +86,6 @@
- 
- ## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
- 
--
--## This should always include $(TESTS), but may also include other
--## binaries that you compile but don't want automatically installed.
--noinst_PROGRAMS = $(TESTS) $(TEST_BINARIES)
--
- rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec
- 	@cd packages && ./rpm.sh ${PACKAGE} ${VERSION}
- 
diff --git a/thirdparty/patches/glog-support-stacktrace-for-aarch64.patch b/thirdparty/patches/glog-support-stacktrace-for-aarch64.patch
index 303d3a7..28109e9 100644
--- a/thirdparty/patches/glog-support-stacktrace-for-aarch64.patch
+++ b/thirdparty/patches/glog-support-stacktrace-for-aarch64.patch
@@ -1,6 +1,6 @@
 diff --git a/src/stacktrace_aarch64-inl.h b/src/stacktrace_aarch64-inl.h
 new file mode 100644
-index 0000000..1e3ce62
+index 00000000..bba61a0d
 --- /dev/null
 +++ b/src/stacktrace_aarch64-inl.h
 @@ -0,0 +1,105 @@
@@ -109,26 +109,23 @@ index 0000000..1e3ce62
 +}
 +
 +_END_GOOGLE_NAMESPACE_
-
-
 diff --git a/Makefile.am b/Makefile.am
-index 0c87c89..886594c 100644
+index e792332a..4939ce51 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -64,6 +64,7 @@ libglog_la_SOURCES = $(gloginclude_HEADERS) \
+@@ -200,6 +200,7 @@ libglog_la_SOURCES = $(gloginclude_HEADERS) \
                         src/stacktrace_generic-inl.h \
                         src/stacktrace_libunwind-inl.h \
                         src/stacktrace_powerpc-inl.h \
-+                      src/stacktrace_aarch64-inl.h \
++                       src/stacktrace_aarch64-inl.h \
                         src/stacktrace_x86-inl.h \
                         src/stacktrace_x86_64-inl.h \
                         src/symbolize.cc src/symbolize.h \
-
 diff --git a/src/utilities.h b/src/utilities.h
-index 5f79968..3ca051b 100644
+index c66f9146..63f6050a 100644
 --- a/src/utilities.h
 +++ b/src/utilities.h
-@@ -102,7 +102,11 @@
+@@ -106,7 +106,11 @@
  // Some code may do that.
 
  #if defined(HAVE_LIB_UNWIND)
@@ -141,10 +138,10 @@ index 5f79968..3ca051b 100644
  #elif !defined(NO_FRAME_POINTER)
  # if defined(__i386__) && __GNUC__ >= 2
  #  define STACKTRACE_H "stacktrace_x86-inl.h"
-@@ -110,6 +114,8 @@
- #  define STACKTRACE_H "stacktrace_x86_64-inl.h"
- # elif (defined(__ppc__) || defined(__PPC__)) && __GNUC__ >= 2
+@@ -116,6 +120,8 @@
  #  define STACKTRACE_H "stacktrace_powerpc-inl.h"
+ # elif defined(OS_WINDOWS)
+ #  define STACKTRACE_H "stacktrace_windows-inl.h"
 +# elif defined(__aarch64__)
 +#  define STACKTRACE_H "stacktrace_aarch64-inl.h"
  # endif
diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh
index f124f5a..73b7b28 100644
--- a/thirdparty/vars.sh
+++ b/thirdparty/vars.sh
@@ -42,7 +42,7 @@ GFLAGS_VERSION=2.2.2
 GFLAGS_NAME=gflags-$GFLAGS_VERSION
 GFLAGS_SOURCE=$TP_SOURCE_DIR/$GFLAGS_NAME
 
-GLOG_VERSION=0.3.5
+GLOG_VERSION=0.4.0
 GLOG_NAME=glog-$GLOG_VERSION
 GLOG_SOURCE=$TP_SOURCE_DIR/$GLOG_NAME