This is an automated email from the ASF dual-hosted git repository. bennoe pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 2e949d245fd711aae2ec7600d07eabdbc5a67b4e Author: Andrei Sekretenko <[email protected]> AuthorDate: Thu Apr 11 15:15:43 2019 +0200 Updated the bundled glog to 0.4.0. Review: https://reviews.apache.org/r/70387/ --- 3rdparty/CMakeLists.txt | 67 +- 3rdparty/Makefile.am | 10 +- 3rdparty/cmake/Versions.cmake | 14 +- 3rdparty/glog-0.3.3.patch | 1801 ---------------------------- 3rdparty/glog-0.3.3.tar.gz | Bin 509676 -> 0 bytes 3rdparty/glog-0.4.0.patch | 282 +++++ 3rdparty/glog-0.4.0.tar.gz | Bin 0 -> 200955 bytes 3rdparty/glog-da816ea70.patch | 726 ----------- 3rdparty/versions.am | 2 +- LICENSE | 2 +- cmake/CompilationConfigure.cmake | 1 - src/python/native_common/ext_modules.py.in | 2 +- support/mesos-tidy/entrypoint.sh | 2 +- 13 files changed, 330 insertions(+), 2579 deletions(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 53396fb..0a33ed9 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -58,10 +58,6 @@ if (WIN32) set(ZLIB_URL ${3RDPARTY_DEPENDENCIES}/zlib-${ZLIB_VERSION}.tar.gz) set(SASL2_URL ${3RDPARTY_DEPENDENCIES}/cyrus-sasl-${SASL2_VERSION}.tar.gz) set(WCLAYER_URL ${3RDPARTY_DEPENDENCIES}/wclayer.exe) - - # NOTE: The Windows version of Glog is patched and only available in the - # 3rdparty repo, not the local repo. - set(GLOG_URL ${3RDPARTY_DEPENDENCIES}/glog-${GLOG_VERSION}.tar.gz) endif () if (NOT WIN32) @@ -366,9 +362,9 @@ add_dependencies(glog ${GLOG_TARGET}) # On Windows, patch it to enable stack tracing. PATCH_CMD(GLOG_PATCH_CMD glog-${GLOG_VERSION}.patch) -if (WIN32) - set(GLOG_INSTALL_CMD ${CMAKE_NOOP}) +set(GLOG_LIBRARY_NAME libglog) +if (WIN32) # NOTE: Windows-specific workaround for a glog issue documented here[1]. # Basically, Windows.h and glog/logging.h both define ERROR. Since we don't # need the Windows ERROR, we can use this flag to avoid defining it at all. @@ -385,39 +381,44 @@ if (WIN32) set_target_properties( glog PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${GLOG_ROOT}/src/windows # TODO(andschwa): Remove this when glog is updated. IMPORTED_LINK_INTERFACE_LIBRARIES DbgHelp INTERFACE_COMPILE_DEFINITIONS "${GLOG_COMPILE_DEFINITIONS}") - if (CMAKE_GENERATOR MATCHES "Visual Studio") - set_target_properties( - glog PROPERTIES - IMPORTED_LOCATION_DEBUG ${GLOG_ROOT}-build/Debug/glog${LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${GLOG_ROOT}-build/Release/glog${LIBRARY_SUFFIX} - IMPORTED_IMPLIB_DEBUG ${GLOG_ROOT}-build/Debug/glog${CMAKE_IMPORT_LIBRARY_SUFFIX} - IMPORTED_IMPLIB_RELEASE ${GLOG_ROOT}-build/Release/glog${CMAKE_IMPORT_LIBRARY_SUFFIX}) - else () - set_target_properties( - glog PROPERTIES - IMPORTED_LOCATION ${GLOG_ROOT}-build/glog${LIBRARY_SUFFIX} - IMPORTED_IMPLIB ${GLOG_ROOT}-build/glog${CMAKE_IMPORT_LIBRARY_SUFFIX}) - endif () -else () - # TODO(andschwa): Build with CMake instead when glog is updated. - set(GLOG_CONFIG_CMD ${GLOG_ROOT}/src/../configure --with-pic GTEST_CONFIG=no --prefix=${GLOG_ROOT}-build) - if (FREEBSD) - list(APPEND GLOG_CONFIG_CMD LDFLAGS=-lexecinfo) - endif () - set(GLOG_BUILD_CMD ${MAKE_PROGRAM}) - set(GLOG_INSTALL_CMD ${MAKE_PROGRAM} install) +endif () + +set(GLOG_INSTALL_DIR ${GLOG_ROOT}-install) +if (CMAKE_GENERATOR MATCHES "Visual Studio") + set_target_properties( + glog PROPERTIES + IMPORTED_LOCATION_DEBUG ${GLOG_INSTALL_DIR}/lib/glogd${LIBRARY_SUFFIX} + IMPORTED_IMPLIB_DEBUG ${GLOG_INSTALL_DIR}/lib/glogd${CMAKE_IMPORT_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${GLOG_INSTALL_DIR}/lib/glog${LIBRARY_SUFFIX} + IMPORTED_IMPLIB_RELEASE ${GLOG_INSTALL_DIR}/lib/glog${CMAKE_IMPORT_LIBRARY_SUFFIX} + ) +else () set_target_properties( glog PROPERTIES - IMPORTED_LOCATION ${GLOG_ROOT}-build/lib/libglog${LIBRARY_SUFFIX} - INTERFACE_INCLUDE_DIRECTORIES ${GLOG_ROOT}-build/include) + IMPORTED_LOCATION ${GLOG_INSTALL_DIR}/lib/libglog${LIBRARY_SUFFIX} + IMPORTED_IMPLIB ${GLOG_INSTALL_DIR}/lib/libglog${CMAKE_IMPORT_LIBRARY_SUFFIX} + ) endif () +set_target_properties( + glog PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${GLOG_INSTALL_DIR}/include +) + +set( + GLOG_CMAKE_ARGS + ${CMAKE_CXX_FORWARD_ARGS} + -DBUILD_TESTING=OFF + -DCMAKE_INSTALL_BINDIR=${GLOG_INSTALL_DIR}/bin + -DCMAKE_INSTALL_INCLUDEDIR=${GLOG_INSTALL_DIR}/include + -DCMAKE_INSTALL_LIBDIR=${GLOG_INSTALL_DIR}/lib +) + MAKE_INCLUDE_DIR(glog) GET_BYPRODUCTS(glog) @@ -426,10 +427,8 @@ ExternalProject_Add( PREFIX ${GLOG_CMAKE_ROOT} BUILD_BYPRODUCTS ${GLOG_BYPRODUCTS} PATCH_COMMAND ${GLOG_PATCH_CMD} - CMAKE_ARGS ${CMAKE_CXX_FORWARD_ARGS};-DBUILD_TESTING=OFF - CONFIGURE_COMMAND ${GLOG_CONFIG_CMD} - BUILD_COMMAND ${GLOG_BUILD_CMD} - INSTALL_COMMAND ${GLOG_INSTALL_CMD} + CMAKE_ARGS ${GLOG_CMAKE_ARGS} + INSTALL_DIR ${GLOG_INSTALL_DIR} URL ${GLOG_URL} URL_HASH ${GLOG_HASH}) diff --git a/3rdparty/Makefile.am b/3rdparty/Makefile.am index 99815da..0de005d 100644 --- a/3rdparty/Makefile.am +++ b/3rdparty/Makefile.am @@ -135,7 +135,6 @@ EXTRA_DIST += \ $(PROTOBUF).patch \ bzip2-1.0.6.patch \ cyrus-sasl-2.1.27rc3.patch \ - glog-da816ea70.patch \ xz-5.2.3.patch CLEAN_EXTRACTED = \ @@ -265,8 +264,15 @@ $(LIB_GLOG): $(GLOG)-build-stamp # when building with clang). # We explicitly build only libglog.la as it is the artifact we depend # on. This e.g., avoids building glog-internal tests. +# +# NOTE: +# On some platforms patch fails to remove test-driver (it is a broken symlink), +# that's why we need to remove it here. +# Also, autogen.sh might be CREATED by the patch and might need its mode fixed. $(GLOG)-build-stamp: $(GLOG)-stamp - cd $(GLOG) && ./configure GTEST_CONFIG=no $(CONFIGURE_ARGS) && \ + cd $(GLOG) &&\ + ./autogen.sh && \ + ./configure GTEST_CONFIG=no $(CONFIGURE_ARGS) && \ $(MAKE) $(AM_MAKEFLAGS) $(GLOG_LDFLAGS) libglog.la touch $@ diff --git a/3rdparty/cmake/Versions.cmake b/3rdparty/cmake/Versions.cmake index b42d52c..0788e61 100644 --- a/3rdparty/cmake/Versions.cmake +++ b/3rdparty/cmake/Versions.cmake @@ -47,19 +47,11 @@ set(ZLIB_VERSION "1.2.8") set(ZLIB_HASH "SHA256=36658CB768A54C1D4DEC43C3116C27ED893E88B02ECFCB44F2166F9C0B7F2A0D") set(ZOOKEEPER_VERSION "3.4.8") set(ZOOKEEPER_HASH "SHA256=F10A0B51F45C4F64C1FE69EF713ABF9EB9571BC7385A82DA892E83BB6C965E90") +set(GLOG_VERSION "0.4.0") +set(GLOG_HASH "SHA256=F28359AEBA12F30D73D9E4711EF356DC842886968112162BC73002645139C39C") # Platform-dependent versions. -if (NOT WIN32) - set(GLOG_VERSION "0.3.3") - set(GLOG_HASH "SHA256=FBF90C2285BA0561DB7A40F8A4EEFB9AA963E7D399BD450363E959929FE849D0") -else () - # TODO(andschwa): (MESOS-3394) Update Windows to use glog v0.3.6 when it is - # released, as it contains our patches. For now, we simply point Windows - # builds at a commit hash in the glog history that has all the functionality - # we want. - set(GLOG_VERSION "da816ea70") - set(GLOG_HASH "SHA256=15338EDBE643F3F9A769FBCA34C3AFDF48D8779D800E7F0878A9649A53339F96") - +if (WIN32) set(SASL2_VERSION "2.1.27rc3") set(SASL2_HASH "SHA256=A50F29042AD313A3B8F1EDD1DB6F41BC8D610C00B223EA305D903BA6E6E63B2A") endif () diff --git a/3rdparty/glog-0.3.3.patch b/3rdparty/glog-0.3.3.patch deleted file mode 100644 index c33fea2..0000000 --- a/3rdparty/glog-0.3.3.patch +++ /dev/null @@ -1,1801 +0,0 @@ -diff --git a/config.guess b/config.guess -old mode 100755 -new mode 100644 -index 278f9e9..69ed3e5 ---- a/config.guess -+++ b/config.guess -@@ -1,14 +1,12 @@ - #! /bin/sh - # Attempt to guess a canonical system name. --# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, --# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, --# Inc. -+# Copyright 1992-2017 Free Software Foundation, Inc. - --timestamp='2007-07-22' -+timestamp='2017-03-05' - - # This file is free software; you can redistribute it and/or modify it - # under the terms of the GNU General Public License as published by --# the Free Software Foundation; either version 2 of the License, or -+# the Free Software Foundation; either version 3 of the License, or - # (at your option) any later version. - # - # This program is distributed in the hope that it will be useful, but -@@ -17,26 +15,22 @@ timestamp='2007-07-22' - # General Public License for more details. - # - # You should have received a copy of the GNU General Public License --# along with this program; if not, write to the Free Software --# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA --# 02110-1301, USA. -+# along with this program; if not, see <http://www.gnu.org/licenses/>. - # - # As a special exception to the GNU General Public License, if you - # distribute this file as part of a program that contains a - # configuration script generated by Autoconf, you may include it under --# the same distribution terms that you use for the rest of that program. -- -- --# Originally written by Per Bothner <[email protected]>. --# Please send patches to <[email protected]>. Submit a context --# diff and a properly formatted ChangeLog entry. -+# the same distribution terms that you use for the rest of that -+# program. This Exception is an additional permission under section 7 -+# of the GNU General Public License, version 3 ("GPLv3"). - # --# This script attempts to guess a canonical system name similar to --# config.sub. If it succeeds, it prints the system name on stdout, and --# exits with 0. Otherwise, it exits with 1. -+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. - # --# The plan is that this can be called by configure scripts if you --# don't specify an explicit build system type. -+# You can get the latest version of this script from: -+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess -+# -+# Please send patches to <[email protected]>. -+ - - me=`echo "$0" | sed -e 's,.*/,,'` - -@@ -56,8 +50,7 @@ version="\ - GNU config.guess ($timestamp) - - Originally written by Per Bothner. --Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 --Free Software Foundation, Inc. -+Copyright 1992-2017 Free Software Foundation, Inc. - - This is free software; see the source for copying conditions. There is NO - warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." -@@ -139,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown - UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown - UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -+case "${UNAME_SYSTEM}" in -+Linux|GNU|GNU/*) -+ # If the system lacks a compiler, then just pick glibc. -+ # We could probably try harder. -+ LIBC=gnu -+ -+ eval $set_cc_for_build -+ cat <<-EOF > $dummy.c -+ #include <features.h> -+ #if defined(__UCLIBC__) -+ LIBC=uclibc -+ #elif defined(__dietlibc__) -+ LIBC=dietlibc -+ #else -+ LIBC=gnu -+ #endif -+ EOF -+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` -+ ;; -+esac -+ - # Note: order is significant - the case branches are not exclusive. - - case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or -- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, -+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward -@@ -154,23 +168,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" -- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ -- /usr/sbin/$sysctl 2>/dev/null || echo unknown)` -+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ -+ /sbin/$sysctl 2>/dev/null || \ -+ /usr/sbin/$sysctl 2>/dev/null || \ -+ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; -+ earmv*) -+ arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` -+ endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` -+ machine=${arch}${endian}-unknown -+ ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched -- # to ELF recently, or will in the future. -+ # to ELF recently (or will in the future) and ABI. - case "${UNAME_MACHINE_ARCH}" in -+ earm*) -+ os=netbsdelf -+ ;; - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ -- | grep __ELF__ >/dev/null -+ | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? -@@ -180,7 +204,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - fi - ;; - *) -- os=netbsd -+ os=netbsd -+ ;; -+ esac -+ # Determine ABI tags. -+ case "${UNAME_MACHINE_ARCH}" in -+ earm*) -+ expr='s/^earmv[0-9]/-eabi/;s/eb$//' -+ abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` - ;; - esac - # The OS release -@@ -193,18 +224,26 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - release='-gnu' - ;; - *) -- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` -+ release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. -- echo "${machine}-${os}${release}" -+ echo "${machine}-${os}${release}${abi}" -+ exit ;; -+ *:Bitrig:*:*) -+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` -+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; -+ *:LibertyBSD:*:*) -+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` -+ echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} -+ exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; -@@ -217,13 +256,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; -+ *:Sortix:*:*) -+ echo ${UNAME_MACHINE}-unknown-sortix -+ exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) -- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` -+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on -@@ -233,43 +275,46 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") -- UNAME_MACHINE="alpha" ;; -+ UNAME_MACHINE=alpha ;; - "EV4.5 (21064)") -- UNAME_MACHINE="alpha" ;; -+ UNAME_MACHINE=alpha ;; - "LCA4 (21066/21068)") -- UNAME_MACHINE="alpha" ;; -+ UNAME_MACHINE=alpha ;; - "EV5 (21164)") -- UNAME_MACHINE="alphaev5" ;; -+ UNAME_MACHINE=alphaev5 ;; - "EV5.6 (21164A)") -- UNAME_MACHINE="alphaev56" ;; -+ UNAME_MACHINE=alphaev56 ;; - "EV5.6 (21164PC)") -- UNAME_MACHINE="alphapca56" ;; -+ UNAME_MACHINE=alphapca56 ;; - "EV5.7 (21164PC)") -- UNAME_MACHINE="alphapca57" ;; -+ UNAME_MACHINE=alphapca57 ;; - "EV6 (21264)") -- UNAME_MACHINE="alphaev6" ;; -+ UNAME_MACHINE=alphaev6 ;; - "EV6.7 (21264A)") -- UNAME_MACHINE="alphaev67" ;; -+ UNAME_MACHINE=alphaev67 ;; - "EV6.8CB (21264C)") -- UNAME_MACHINE="alphaev68" ;; -+ UNAME_MACHINE=alphaev68 ;; - "EV6.8AL (21264B)") -- UNAME_MACHINE="alphaev68" ;; -+ UNAME_MACHINE=alphaev68 ;; - "EV6.8CX (21264D)") -- UNAME_MACHINE="alphaev68" ;; -+ UNAME_MACHINE=alphaev68 ;; - "EV6.9A (21264/EV69A)") -- UNAME_MACHINE="alphaev69" ;; -+ UNAME_MACHINE=alphaev69 ;; - "EV7 (21364)") -- UNAME_MACHINE="alphaev7" ;; -+ UNAME_MACHINE=alphaev7 ;; - "EV7.9 (21364A)") -- UNAME_MACHINE="alphaev79" ;; -+ UNAME_MACHINE=alphaev79 ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. -- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` -- exit ;; -+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` -+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code. -+ exitcode=$? -+ trap '' 0 -+ exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead -@@ -295,12 +340,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) -- echo powerpc-ibm-os400 -+ echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; -- arm:riscos:*:*|arm:RISCOS:*:*) -+ arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) -@@ -324,14 +369,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; -+ s390x:SunOS:*:*) -+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -+ exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; -+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) -+ echo i386-pc-auroraux${UNAME_RELEASE} -+ exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) -- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` -+ eval $set_cc_for_build -+ SUN_ARCH=i386 -+ # If there is a compiler, see if it is configured for 64-bit objects. -+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. -+ # This test works for both compilers. -+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then -+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ -+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ -+ grep IS_64BIT_ARCH >/dev/null -+ then -+ SUN_ARCH=x86_64 -+ fi -+ fi -+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize -@@ -353,7 +417,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` -- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 -+ test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} -@@ -375,23 +439,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) -- echo m68k-atari-mint${UNAME_RELEASE} -+ echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} -- exit ;; -+ exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) -- echo m68k-atari-mint${UNAME_RELEASE} -+ echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) -- echo m68k-milan-mint${UNAME_RELEASE} -- exit ;; -+ echo m68k-milan-mint${UNAME_RELEASE} -+ exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) -- echo m68k-hades-mint${UNAME_RELEASE} -- exit ;; -+ echo m68k-hades-mint${UNAME_RELEASE} -+ exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) -- echo m68k-unknown-mint${UNAME_RELEASE} -- exit ;; -+ echo m68k-unknown-mint${UNAME_RELEASE} -+ exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; -@@ -461,8 +525,8 @@ EOF - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) -- # DG/UX returns AViiON for all architectures -- UNAME_PROCESSOR=`/usr/bin/uname -p` -+ # DG/UX returns AViiON for all architectures -+ UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ -@@ -475,7 +539,7 @@ EOF - else - echo i586-dg-dgux${UNAME_RELEASE} - fi -- exit ;; -+ exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; -@@ -532,15 +596,16 @@ EOF - echo rs6000-ibm-aix3.2 - fi - exit ;; -- *:AIX:*:[45]) -+ *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi -- if [ -x /usr/bin/oslevel ] ; then -- IBM_REV=`/usr/bin/oslevel` -+ if [ -x /usr/bin/lslpp ] ; then -+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | -+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi -@@ -575,58 +640,58 @@ EOF - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` -- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` -- case "${sc_cpu_version}" in -- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 -- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 -- 532) # CPU_PA_RISC2_0 -- case "${sc_kernel_bits}" in -- 32) HP_ARCH="hppa2.0n" ;; -- 64) HP_ARCH="hppa2.0w" ;; -- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 -- esac ;; -- esac -+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` -+ case "${sc_cpu_version}" in -+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 -+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 -+ 532) # CPU_PA_RISC2_0 -+ case "${sc_kernel_bits}" in -+ 32) HP_ARCH=hppa2.0n ;; -+ 64) HP_ARCH=hppa2.0w ;; -+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 -+ esac ;; -+ esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build -- sed 's/^ //' << EOF >$dummy.c -+ sed 's/^ //' << EOF >$dummy.c - -- #define _HPUX_SOURCE -- #include <stdlib.h> -- #include <unistd.h> -+ #define _HPUX_SOURCE -+ #include <stdlib.h> -+ #include <unistd.h> - -- int main () -- { -- #if defined(_SC_KERNEL_BITS) -- long bits = sysconf(_SC_KERNEL_BITS); -- #endif -- long cpu = sysconf (_SC_CPU_VERSION); -+ int main () -+ { -+ #if defined(_SC_KERNEL_BITS) -+ long bits = sysconf(_SC_KERNEL_BITS); -+ #endif -+ long cpu = sysconf (_SC_CPU_VERSION); - -- switch (cpu) -- { -- case CPU_PA_RISC1_0: puts ("hppa1.0"); break; -- case CPU_PA_RISC1_1: puts ("hppa1.1"); break; -- case CPU_PA_RISC2_0: -- #if defined(_SC_KERNEL_BITS) -- switch (bits) -- { -- case 64: puts ("hppa2.0w"); break; -- case 32: puts ("hppa2.0n"); break; -- default: puts ("hppa2.0"); break; -- } break; -- #else /* !defined(_SC_KERNEL_BITS) */ -- puts ("hppa2.0"); break; -- #endif -- default: puts ("hppa1.0"); break; -- } -- exit (0); -- } -+ switch (cpu) -+ { -+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break; -+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break; -+ case CPU_PA_RISC2_0: -+ #if defined(_SC_KERNEL_BITS) -+ switch (bits) -+ { -+ case 64: puts ("hppa2.0w"); break; -+ case 32: puts ("hppa2.0n"); break; -+ default: puts ("hppa2.0"); break; -+ } break; -+ #else /* !defined(_SC_KERNEL_BITS) */ -+ puts ("hppa2.0"); break; -+ #endif -+ default: puts ("hppa1.0"); break; -+ } -+ exit (0); -+ } - EOF -- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` -+ (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac -- if [ ${HP_ARCH} = "hppa2.0w" ] -+ if [ ${HP_ARCH} = hppa2.0w ] - then - eval $set_cc_for_build - -@@ -639,12 +704,12 @@ EOF - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - -- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | -- grep __LP64__ >/dev/null -+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | -+ grep -q __LP64__ - then -- HP_ARCH="hppa2.0w" -+ HP_ARCH=hppa2.0w - else -- HP_ARCH="hppa64" -+ HP_ARCH=hppa64 - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} -@@ -711,22 +776,22 @@ EOF - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd -- exit ;; -+ exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi -- exit ;; -+ exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd -- exit ;; -+ exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd -- exit ;; -+ exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd -- exit ;; -+ exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; -@@ -749,15 +814,15 @@ EOF - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) -- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` -- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` -- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` -- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" -- exit ;; -+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` -+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` -+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` -+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" -+ exit ;; - 5000:UNIX_System_V:4.*:*) -- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` -- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` -- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" -+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` -+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` -+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} -@@ -769,40 +834,52 @@ EOF - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) -- case ${UNAME_MACHINE} in -- pc98) -- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; -+ UNAME_PROCESSOR=`/usr/bin/uname -p` -+ case ${UNAME_PROCESSOR} in - amd64) -- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; -- *) -- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; -+ UNAME_PROCESSOR=x86_64 ;; -+ i386) -+ UNAME_PROCESSOR=i586 ;; - esac -+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; -+ *:MINGW64*:*) -+ echo ${UNAME_MACHINE}-pc-mingw64 -+ exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; -+ *:MSYS*:*) -+ echo ${UNAME_MACHINE}-pc-msys -+ exit ;; - i*:windows32*:*) -- # uname -m includes "-pc" on this system. -- echo ${UNAME_MACHINE}-mingw32 -+ # uname -m includes "-pc" on this system. -+ echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; -- *:Interix*:[3456]*) -- case ${UNAME_MACHINE} in -+ *:Interix*:*) -+ case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; -- EM64T | authenticamd) -+ authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; -+ IA64) -+ echo ia64-unknown-interix${UNAME_RELEASE} -+ exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; -+ 8664:Windows_NT:*) -+ echo x86_64-pc-mks -+ exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we -@@ -823,93 +900,21 @@ EOF - exit ;; - *:GNU:*:*) - # the GNU system -- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` -+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland -- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu -+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; -- arm*:Linux:*:*) -- echo ${UNAME_MACHINE}-unknown-linux-gnu -+ aarch64:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; -- avr32*:Linux:*:*) -- echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit ;; -- cris:Linux:*:*) -- echo cris-axis-linux-gnu -- exit ;; -- crisv32:Linux:*:*) -- echo crisv32-axis-linux-gnu -- exit ;; -- frv:Linux:*:*) -- echo frv-unknown-linux-gnu -- exit ;; -- ia64:Linux:*:*) -- echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit ;; -- m32r*:Linux:*:*) -- echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit ;; -- m68*:Linux:*:*) -- echo ${UNAME_MACHINE}-unknown-linux-gnu -- exit ;; -- mips:Linux:*:*) -- eval $set_cc_for_build -- sed 's/^ //' << EOF >$dummy.c -- #undef CPU -- #undef mips -- #undef mipsel -- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) -- CPU=mipsel -- #else -- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) -- CPU=mips -- #else -- CPU= -- #endif -- #endif --EOF -- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' -- /^CPU/{ -- s: ::g -- p -- }'`" -- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } -- ;; -- mips64:Linux:*:*) -- eval $set_cc_for_build -- sed 's/^ //' << EOF >$dummy.c -- #undef CPU -- #undef mips64 -- #undef mips64el -- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) -- CPU=mips64el -- #else -- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) -- CPU=mips64 -- #else -- CPU= -- #endif -- #endif --EOF -- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' -- /^CPU/{ -- s: ::g -- p -- }'`" -- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } -- ;; -- or32:Linux:*:*) -- echo or32-unknown-linux-gnu -- exit ;; -- ppc:Linux:*:*) -- echo powerpc-unknown-linux-gnu -- exit ;; -- ppc64:Linux:*:*) -- echo powerpc64-unknown-linux-gnu -+ aarch64_be:Linux:*:*) -+ UNAME_MACHINE=aarch64_be -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in -@@ -920,106 +925,144 @@ EOF - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; -- esac -- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null -- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi -- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} -+ esac -+ objdump --private-headers /bin/sh | grep -q ld.so.1 -+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ arc:Linux:*:* | arceb:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ arm*:Linux:*:*) -+ eval $set_cc_for_build -+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ -+ | grep -q __ARM_EABI__ -+ then -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ else -+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ -+ | grep -q __ARM_PCS_VFP -+ then -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi -+ else -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf -+ fi -+ fi -+ exit ;; -+ avr32*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ cris:Linux:*:*) -+ echo ${UNAME_MACHINE}-axis-linux-${LIBC} -+ exit ;; -+ crisv32:Linux:*:*) -+ echo ${UNAME_MACHINE}-axis-linux-${LIBC} -+ exit ;; -+ e2k:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ frv:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ hexagon:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ i*86:Linux:*:*) -+ echo ${UNAME_MACHINE}-pc-linux-${LIBC} -+ exit ;; -+ ia64:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ k1om:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ m32r*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ m68*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ mips:Linux:*:* | mips64:Linux:*:*) -+ eval $set_cc_for_build -+ sed 's/^ //' << EOF >$dummy.c -+ #undef CPU -+ #undef ${UNAME_MACHINE} -+ #undef ${UNAME_MACHINE}el -+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) -+ CPU=${UNAME_MACHINE}el -+ #else -+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) -+ CPU=${UNAME_MACHINE} -+ #else -+ CPU= -+ #endif -+ #endif -+EOF -+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` -+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } -+ ;; -+ mips64el:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ openrisc*:Linux:*:*) -+ echo or1k-unknown-linux-${LIBC} -+ exit ;; -+ or32:Linux:*:* | or1k*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ padre:Linux:*:*) -+ echo sparc-unknown-linux-${LIBC} -+ exit ;; -+ parisc64:Linux:*:* | hppa64:Linux:*:*) -+ echo hppa64-unknown-linux-${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in -- PA7*) echo hppa1.1-unknown-linux-gnu ;; -- PA8*) echo hppa2.0-unknown-linux-gnu ;; -- *) echo hppa-unknown-linux-gnu ;; -+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; -+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; -+ *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; -- parisc64:Linux:*:* | hppa64:Linux:*:*) -- echo hppa64-unknown-linux-gnu -+ ppc64:Linux:*:*) -+ echo powerpc64-unknown-linux-${LIBC} -+ exit ;; -+ ppc:Linux:*:*) -+ echo powerpc-unknown-linux-${LIBC} -+ exit ;; -+ ppc64le:Linux:*:*) -+ echo powerpc64le-unknown-linux-${LIBC} -+ exit ;; -+ ppcle:Linux:*:*) -+ echo powerpcle-unknown-linux-${LIBC} -+ exit ;; -+ riscv32:Linux:*:* | riscv64:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) -- echo ${UNAME_MACHINE}-ibm-linux -+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; - sh64*:Linux:*:*) -- echo ${UNAME_MACHINE}-unknown-linux-gnu -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sh*:Linux:*:*) -- echo ${UNAME_MACHINE}-unknown-linux-gnu -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) -- echo ${UNAME_MACHINE}-unknown-linux-gnu -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; -+ tile*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - vax:Linux:*:*) -- echo ${UNAME_MACHINE}-dec-linux-gnu -+ echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; - x86_64:Linux:*:*) -- echo x86_64-unknown-linux-gnu -+ echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; -- xtensa:Linux:*:*) -- echo xtensa-unknown-linux-gnu -+ xtensa*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; -- i*86:Linux:*:*) -- # The BFD linker knows what the default object file format is, so -- # first see if it will tell us. cd to the root directory to prevent -- # problems with other programs or directories called `ld' in the path. -- # Set LC_ALL=C to ensure ld outputs messages in English. -- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ -- | sed -ne '/supported targets:/!d -- s/[ ][ ]*/ /g -- s/.*supported targets: *// -- s/ .*// -- p'` -- case "$ld_supported_targets" in -- elf32-i386) -- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" -- ;; -- a.out-i386-linux) -- echo "${UNAME_MACHINE}-pc-linux-gnuaout" -- exit ;; -- coff-i386) -- echo "${UNAME_MACHINE}-pc-linux-gnucoff" -- exit ;; -- "") -- # Either a pre-BFD a.out linker (linux-gnuoldld) or -- # one that does not give us useful --help. -- echo "${UNAME_MACHINE}-pc-linux-gnuoldld" -- exit ;; -- esac -- # Determine whether the default compiler is a.out or elf -- eval $set_cc_for_build -- sed 's/^ //' << EOF >$dummy.c -- #include <features.h> -- #ifdef __ELF__ -- # ifdef __GLIBC__ -- # if __GLIBC__ >= 2 -- LIBC=gnu -- # else -- LIBC=gnulibc1 -- # endif -- # else -- LIBC=gnulibc1 -- # endif -- #else -- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) -- LIBC=gnu -- #else -- LIBC=gnuaout -- #endif -- #endif -- #ifdef __dietlibc__ -- LIBC=dietlibc -- #endif --EOF -- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' -- /^LIBC/{ -- s: ::g -- p -- }'`" -- test x"${LIBC}" != x && { -- echo "${UNAME_MACHINE}-pc-linux-${LIBC}" -- exit -- } -- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } -- ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both -@@ -1027,11 +1070,11 @@ EOF - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) -- # Unixware is an offshoot of SVR4, but it has its own version -- # number series starting with 2... -- # I am not positive that other SVR4 systems won't match this, -+ # Unixware is an offshoot of SVR4, but it has its own version -+ # number series starting with 2... -+ # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. -- # Use sysv4.2uw... so that sysv4* matches it. -+ # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) -@@ -1048,7 +1091,7 @@ EOF - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; -- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) -+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) -@@ -1063,7 +1106,7 @@ EOF - fi - exit ;; - i*86:*:5:[678]*) -- # UnixWare 7.x, OpenUNIX and OpenServer 6. -+ # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; -@@ -1091,10 +1134,13 @@ EOF - exit ;; - pc:*:*:*) - # Left here for compatibility: -- # uname -m prints for DJGPP always 'pc', but it prints nothing about -- # the processor, so we play safe by assuming i386. -- echo i386-pc-msdosdjgpp -- exit ;; -+ # uname -m prints for DJGPP always 'pc', but it prints nothing about -+ # the processor, so we play safe by assuming i586. -+ # Note: whatever this is, it MUST be the same as what config.sub -+ # prints for the "djgpp" host, or else GDB configure will decide that -+ # this is a cross-build. -+ echo i586-pc-msdosdjgpp -+ exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; -@@ -1129,8 +1175,18 @@ EOF - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) -- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ -- && { echo i486-ncr-sysv4; exit; } ;; -+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ -+ && { echo i486-ncr-sysv4; exit; } ;; -+ NCR*:*:4.2:* | MPRAS*:*:4.2:*) -+ OS_REL='.3' -+ test -r /etc/.relid \ -+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` -+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ -+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } -+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ -+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } -+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ -+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; -@@ -1143,7 +1199,7 @@ EOF - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; -- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) -+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) -@@ -1163,10 +1219,10 @@ EOF - echo ns32k-sni-sysv - fi - exit ;; -- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort -- # says <[email protected]> -- echo i586-unisys-sysv4 -- exit ;; -+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort -+ # says <[email protected]> -+ echo i586-unisys-sysv4 -+ exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <[email protected]>. - # How about differentiating between stratus architectures? -djm -@@ -1192,11 +1248,11 @@ EOF - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then -- echo mips-nec-sysv${UNAME_RELEASE} -+ echo mips-nec-sysv${UNAME_RELEASE} - else -- echo mips-unknown-sysv${UNAME_RELEASE} -+ echo mips-unknown-sysv${UNAME_RELEASE} - fi -- exit ;; -+ exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; -@@ -1206,6 +1262,12 @@ EOF - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; -+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. -+ echo i586-pc-haiku -+ exit ;; -+ x86_64:Haiku:*:*) -+ echo x86_64-unknown-haiku -+ exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; -@@ -1224,6 +1286,9 @@ EOF - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; -+ SX-ACE:SUPER-UX:*:*) -+ echo sxace-nec-superux${UNAME_RELEASE} -+ exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; -@@ -1232,14 +1297,36 @@ EOF - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown -- case $UNAME_PROCESSOR in -- unknown) UNAME_PROCESSOR=powerpc ;; -- esac -+ eval $set_cc_for_build -+ if test "$UNAME_PROCESSOR" = unknown ; then -+ UNAME_PROCESSOR=powerpc -+ fi -+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then -+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then -+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ -+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ -+ grep IS_64BIT_ARCH >/dev/null -+ then -+ case $UNAME_PROCESSOR in -+ i386) UNAME_PROCESSOR=x86_64 ;; -+ powerpc) UNAME_PROCESSOR=powerpc64 ;; -+ esac -+ fi -+ fi -+ elif test "$UNAME_PROCESSOR" = i386 ; then -+ # Avoid executing cc on OS X 10.9, as it ships with a stub -+ # that puts up a graphical alert prompting to install -+ # developer tools. Any system running Mac OS X 10.7 or -+ # later (Darwin 11 and later) is required to have a 64-bit -+ # processor. This is not true of the ARM version of Darwin -+ # that Apple uses in portable devices. -+ UNAME_PROCESSOR=x86_64 -+ fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` -- if test "$UNAME_PROCESSOR" = "x86"; then -+ if test "$UNAME_PROCESSOR" = x86; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi -@@ -1248,12 +1335,18 @@ EOF - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; -- NSE-?:NONSTOP_KERNEL:*:*) -+ NEO-?:NONSTOP_KERNEL:*:*) -+ echo neo-tandem-nsk${UNAME_RELEASE} -+ exit ;; -+ NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; -+ NSX-?:NONSTOP_KERNEL:*:*) -+ echo nsx-tandem-nsk${UNAME_RELEASE} -+ exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; -@@ -1267,7 +1360,7 @@ EOF - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. -- if test "$cputype" = "386"; then -+ if test "$cputype" = 386; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" -@@ -1293,13 +1386,13 @@ EOF - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) -- echo mips-sei-seiux${UNAME_RELEASE} -+ echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) -- UNAME_MACHINE=`(uname -p) 2>/dev/null` -+ UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; -@@ -1309,179 +1402,36 @@ EOF - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) -- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' -+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; -+ i*86:AROS:*:*) -+ echo ${UNAME_MACHINE}-pc-aros -+ exit ;; -+ x86_64:VMkernel:*:*) -+ echo ${UNAME_MACHINE}-unknown-esx -+ exit ;; -+ amd64:Isilon\ OneFS:*:*) -+ echo x86_64-unknown-onefs -+ exit ;; - esac - --#echo '(No uname command or uname output not recognized.)' 1>&2 --#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 -- --eval $set_cc_for_build --cat >$dummy.c <<EOF --#ifdef _SEQUENT_ --# include <sys/types.h> --# include <sys/utsname.h> --#endif --main () --{ --#if defined (sony) --#if defined (MIPSEB) -- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, -- I don't know.... */ -- printf ("mips-sony-bsd\n"); exit (0); --#else --#include <sys/param.h> -- printf ("m68k-sony-newsos%s\n", --#ifdef NEWSOS4 -- "4" --#else -- "" --#endif -- ); exit (0); --#endif --#endif -- --#if defined (__arm) && defined (__acorn) && defined (__unix) -- printf ("arm-acorn-riscix\n"); exit (0); --#endif -- --#if defined (hp300) && !defined (hpux) -- printf ("m68k-hp-bsd\n"); exit (0); --#endif -- --#if defined (NeXT) --#if !defined (__ARCHITECTURE__) --#define __ARCHITECTURE__ "m68k" --#endif -- int version; -- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; -- if (version < 4) -- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); -- else -- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); -- exit (0); --#endif -- --#if defined (MULTIMAX) || defined (n16) --#if defined (UMAXV) -- printf ("ns32k-encore-sysv\n"); exit (0); --#else --#if defined (CMU) -- printf ("ns32k-encore-mach\n"); exit (0); --#else -- printf ("ns32k-encore-bsd\n"); exit (0); --#endif --#endif --#endif -- --#if defined (__386BSD__) -- printf ("i386-pc-bsd\n"); exit (0); --#endif -- --#if defined (sequent) --#if defined (i386) -- printf ("i386-sequent-dynix\n"); exit (0); --#endif --#if defined (ns32000) -- printf ("ns32k-sequent-dynix\n"); exit (0); --#endif --#endif -- --#if defined (_SEQUENT_) -- struct utsname un; -- -- uname(&un); -- -- if (strncmp(un.version, "V2", 2) == 0) { -- printf ("i386-sequent-ptx2\n"); exit (0); -- } -- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ -- printf ("i386-sequent-ptx1\n"); exit (0); -- } -- printf ("i386-sequent-ptx\n"); exit (0); -- --#endif -- --#if defined (vax) --# if !defined (ultrix) --# include <sys/param.h> --# if defined (BSD) --# if BSD == 43 -- printf ("vax-dec-bsd4.3\n"); exit (0); --# else --# if BSD == 199006 -- printf ("vax-dec-bsd4.3reno\n"); exit (0); --# else -- printf ("vax-dec-bsd\n"); exit (0); --# endif --# endif --# else -- printf ("vax-dec-bsd\n"); exit (0); --# endif --# else -- printf ("vax-dec-ultrix\n"); exit (0); --# endif --#endif -- --#if defined (alliant) && defined (i860) -- printf ("i860-alliant-bsd\n"); exit (0); --#endif -- -- exit (1); --} --EOF -- --$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && -- { echo "$SYSTEM_NAME"; exit; } -- --# Apollos put the system type in the environment. -- --test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } -- --# Convex versions that predate uname can use getsysinfo(1) -- --if [ -x /usr/convex/getsysinfo ] --then -- case `getsysinfo -f cpu_type` in -- c1*) -- echo c1-convex-bsd -- exit ;; -- c2*) -- if getsysinfo -f scalar_acc -- then echo c32-convex-bsd -- else echo c2-convex-bsd -- fi -- exit ;; -- c34*) -- echo c34-convex-bsd -- exit ;; -- c38*) -- echo c38-convex-bsd -- exit ;; -- c4*) -- echo c4-convex-bsd -- exit ;; -- esac --fi -- - cat >&2 <<EOF - $0: unable to guess system type - --This script, last modified $timestamp, has failed to recognize --the operating system you are using. It is advised that you --download the most up to date version of the config scripts from -+This script (version $timestamp), has failed to recognize the -+operating system you are using. If your script is old, overwrite -+config.guess and config.sub with the latest versions from: - -- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess -+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess - and -- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub -+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub - --If the version you run ($0) is already up to date, please --send the following data and any information you think might be --pertinent to <[email protected]> in order to provide the needed --information to handle your system. -+If $0 has already been updated, send the following data and any -+information you think might be pertinent to [email protected] to -+provide the necessary information to handle your system. - - config.guess timestamp = $timestamp - -diff --git a/configure.ac b/configure.ac -index 8b458fa..78e3355 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -113,27 +113,9 @@ if test x"$acx_pthread_ok" = x"yes"; then - AC_CHECK_LIB(pthread, pthread_self) - fi - --# Check if there is google-gflags library installed. --SAVE_CFLAGS="$CFLAGS" --SAVE_LIBS="$LIBS" --AC_ARG_WITH(gflags, AS_HELP_STRING[--with-gflags=GFLAGS_DIR], -- GFLAGS_CFLAGS="-I${with_gflags}/include" -- GFLAGS_LIBS="-L${with_gflags}/lib -lgflags" -- CFLAGS="$CFLAGS $GFLAGS_CFLAGS" -- LIBS="$LIBS $GFLAGS_LIBS" --) --AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1, ac_cv_have_libgflags=0) --if test x"$ac_cv_have_libgflags" = x"1"; then -- AC_DEFINE(HAVE_LIB_GFLAGS, 1, [define if you have google gflags library]) -- if test x"$GFLAGS_LIBS" = x""; then -- GFLAGS_LIBS="-lgflags" -- fi --else -- GFLAGS_CFLAGS= -- GFLAGS_LIBS= --fi --CFLAGS="$SAVE_CFLAGS" --LIBS="$SAVE_LIBS" -+GFLAGS_CFLAGS= -+GFLAGS_LIBS= -+ac_cv_have_libgflags=0 - - # TODO(hamaji): Use official m4 macros provided by testing libraries - # once the m4 macro of Google Mocking becomes ready. -diff --git a/src/demangle.cc b/src/demangle.cc -index 0daf308..4b7c160 100644 ---- a/src/demangle.cc -+++ b/src/demangle.cc -@@ -167,7 +167,7 @@ static size_t StrLen(const char *str) { - // Returns true if "str" has at least "n" characters remaining. - static bool AtLeastNumCharsRemaining(const char *str, int n) { - for (int i = 0; i < n; ++i) { -- if (str == '\0') { -+ if (str[i] == '\0') { - return false; - } - } -@@ -223,7 +223,7 @@ static bool ParseTwoCharToken(State *state, const char *two_char_token) { - // Returns true and advances "mangled_cur" if we find any character in - // "char_class" at "mangled_cur" position. - static bool ParseCharClass(State *state, const char *char_class) { -- if (state->mangled_cur == '\0') { -+ if (state->mangled_cur[0] == '\0') { - return false; - } - const char *p = char_class; -diff --git a/src/glog/stl_logging.h.in b/src/glog/stl_logging.h.in -index 30836de..3e90573 100644 ---- a/src/glog/stl_logging.h.in -+++ b/src/glog/stl_logging.h.in -@@ -50,10 +50,13 @@ - #include <utility> - #include <vector> - --#ifdef __GNUC__ -+#if defined (__GNUC__) && !defined(_LIBCPP_VERSION) - # include <ext/hash_set> - # include <ext/hash_map> - # include <ext/slist> -+#elif defined(_LIBCPP_VERSION) -+# include <unordered_map> -+# include <unordered_set> - #endif - - // Forward declare these two, and define them after all the container streams -@@ -80,7 +83,7 @@ inline std::ostream& operator<<(std::ostream& out, \ - OUTPUT_TWO_ARG_CONTAINER(std::vector) - OUTPUT_TWO_ARG_CONTAINER(std::deque) - OUTPUT_TWO_ARG_CONTAINER(std::list) --#ifdef __GNUC__ -+#if defined (__GNUC__) && !defined(_LIBCPP_VERSION) - OUTPUT_TWO_ARG_CONTAINER(__gnu_cxx::slist) - #endif - -@@ -109,9 +112,12 @@ inline std::ostream& operator<<(std::ostream& out, \ - - OUTPUT_FOUR_ARG_CONTAINER(std::map) - OUTPUT_FOUR_ARG_CONTAINER(std::multimap) --#ifdef __GNUC__ -+#if defined (__GNUC__) && !defined(_LIBCPP_VERSION) - OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_set) - OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_multiset) -+#elif defined(_LIBCPP_VERSION) -+OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set) -+OUTPUT_FOUR_ARG_CONTAINER(std::unordered_multiset) - #endif - - #undef OUTPUT_FOUR_ARG_CONTAINER -@@ -124,9 +130,12 @@ inline std::ostream& operator<<(std::ostream& out, \ - return out; \ - } - --#ifdef __GNUC__ -+#if defined (__GNUC__) && !defined(_LIBCPP_VERSION) - OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_map) - OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_multimap) -+#elif defined(_LIBCPP_VERSION) -+OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map) -+OUTPUT_FIVE_ARG_CONTAINER(std::unordered_multimap) - #endif - - #undef OUTPUT_FIVE_ARG_CONTAINER -diff --git a/src/stacktrace_powerpc-inl.h b/src/stacktrace_powerpc-inl.h -index 1090dde..03b9108 100644 ---- a/src/stacktrace_powerpc-inl.h -+++ b/src/stacktrace_powerpc-inl.h -@@ -111,7 +111,7 @@ int GetStackTrace(void** result, int max_depth, int skip_count) { - result[n++] = *(sp+2); - #elif defined(_CALL_SYSV) - result[n++] = *(sp+1); --#elif defined(__APPLE__) || (defined(__linux) && defined(__PPC64__)) -+#elif defined(__APPLE__) || ((defined(__linux) || defined(__linux__)) && defined(__PPC64__)) - // This check is in case the compiler doesn't define _CALL_AIX/etc. - result[n++] = *(sp+2); - #elif defined(__linux) -diff --git a/src/stl_logging_unittest.cc b/src/stl_logging_unittest.cc -index 5dcbc44..ee344ca 100644 ---- a/src/stl_logging_unittest.cc -+++ b/src/stl_logging_unittest.cc -@@ -39,7 +39,7 @@ - #include <string> - #include <vector> - --#ifdef __GNUC__ -+#if defined (__GNUC__) && !defined(_LIBCPP_VERSION) - # include <ext/hash_map> - # include <ext/hash_set> - #endif -@@ -48,7 +48,7 @@ - #include "googletest.h" - - using namespace std; --#ifdef __GNUC__ -+#if defined (__GNUC__) && !defined(_LIBCPP_VERSION) - using namespace __gnu_cxx; - #endif - -@@ -83,7 +83,7 @@ void TestSTLLogging() { - CHECK_EQ(m, copied_m); // This must compile. - } - --#ifdef __GNUC__ -+#if defined (__GNUC__) && !defined(_LIBCPP_VERSION) - { - // Test a hashed simple associative container. - hash_set<int> hs; -@@ -98,7 +98,7 @@ void TestSTLLogging() { - } - #endif - --#ifdef __GNUC__ -+#if defined (__GNUC__) && !defined(_LIBCPP_VERSION) - { - // Test a hashed pair associative container. - hash_map<int, string> hm; -@@ -145,7 +145,7 @@ void TestSTLLogging() { - CHECK_EQ(m, copied_m); // This must compile. - } - --#ifdef __GNUC__ -+#if defined (__GNUC__) && !defined(_LIBCPP_VERSION) - { - // Test a hashed simple associative container. - // Use a user defined hash function. -diff --git a/src/symbolize.cc b/src/symbolize.cc -index b69eefd..18bbccf 100644 ---- a/src/symbolize.cc -+++ b/src/symbolize.cc -@@ -232,7 +232,7 @@ bool GetSectionHeaderByName(int fd, const char *name, size_t name_len, - } - char header_name[kMaxSectionNameLen]; - if (sizeof(header_name) < name_len) { -- RAW_LOG(WARNING, "Section name '%s' is too long (%"PRIuS"); " -+ RAW_LOG(WARNING, "Section name '%s' is too long (%" PRIuS "); " - "section will not be found (even if present).", name, name_len); - // No point in even trying. - return false; -diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in -index cdd47b8..19168b1 100644 ---- a/src/glog/logging.h.in -+++ b/src/glog/logging.h.in -@@ -1364,6 +1364,16 @@ class GOOGLE_GLOG_DLL_DECL LogSink { - // Sink's logging logic (message_len is such as to exclude '\n' at the end). - // This method can't use LOG() or CHECK() as logging system mutex(s) are held - // during this call. -+ virtual void send(LogSeverity severity, const char* full_filename, -+ const char* base_filename, int line, -+ const struct ::tm* tm_time, -+ const char* message, size_t message_len, int32 usecs) { -+ send(severity, full_filename, base_filename, line, -+ tm_time, message, message_len); -+ } -+ // This send() signature is obsolete. -+ // New implementations should define this in terms of -+ // the above send() method. - virtual void send(LogSeverity severity, const char* full_filename, - const char* base_filename, int line, - const struct ::tm* tm_time, -@@ -1388,7 +1398,15 @@ class GOOGLE_GLOG_DLL_DECL LogSink { - // Can be useful to implement send(). - static std::string ToString(LogSeverity severity, const char* file, int line, - const struct ::tm* tm_time, -- const char* message, size_t message_len); -+ const char* message, size_t message_len, -+ int32 usecs); -+ -+ // Obsolete -+ static std::string ToString(LogSeverity severity, const char* file, int line, -+ const struct ::tm* tm_time, -+ const char* message, size_t message_len) { -+ return ToString(severity, file, line, tm_time, message, message_len, 0); -+ } - }; - - // Add or remove a LogSink as a consumer of logging data. Thread-safe. -diff --git a/src/logging.cc b/src/logging.cc -index ec334a9..9d07d3c 100644 ---- a/src/logging.cc -+++ b/src/logging.cc -@@ -304,6 +304,7 @@ struct LogMessage::LogMessageData { - }; - time_t timestamp_; // Time of creation of LogMessage - struct ::tm tm_time_; // Time of creation of LogMessage -+ int32 usecs_; // Time of creation of LogMessage - microseconds part - size_t num_prefix_chars_; // # of chars of prefix in this message - size_t num_chars_to_log_; // # of chars of msg to send to log - size_t num_chars_to_syslog_; // # of chars of msg to send to syslog -@@ -471,7 +472,8 @@ class LogDestination { - int line, - const struct ::tm* tm_time, - const char* message, -- size_t message_len); -+ size_t message_len, -+ int32 usecs); - - // Wait for all registered sinks via WaitTillSent - // including the optional one in "data". -@@ -738,12 +740,13 @@ inline void LogDestination::LogToSinks(LogSeverity severity, - int line, - const struct ::tm* tm_time, - const char* message, -- size_t message_len) { -+ size_t message_len, -+ int32 usecs) { - ReaderMutexLock l(&sink_mutex_); - if (sinks_) { - for (int i = sinks_->size() - 1; i >= 0; i--) { - (*sinks_)[i]->send(severity, full_filename, base_filename, -- line, tm_time, message, message_len); -+ line, tm_time, message, message_len, usecs); - } - } - } -@@ -1193,8 +1196,8 @@ void LogMessage::Init(const char* file, - WallTime now = WallTime_Now(); - data_->timestamp_ = static_cast<time_t>(now); - localtime_r(&data_->timestamp_, &data_->tm_time_); -- int usecs = static_cast<int>((now - data_->timestamp_) * 1000000); -- RawLog__SetLastTime(data_->tm_time_, usecs); -+ data_->usecs_ = static_cast<int32>((now - data_->timestamp_) * 1000000); -+ RawLog__SetLastTime(data_->tm_time_, data_->usecs_); - - data_->num_chars_to_log_ = 0; - data_->num_chars_to_syslog_ = 0; -@@ -1214,7 +1217,7 @@ void LogMessage::Init(const char* file, - << setw(2) << data_->tm_time_.tm_hour << ':' - << setw(2) << data_->tm_time_.tm_min << ':' - << setw(2) << data_->tm_time_.tm_sec << "." -- << setw(6) << usecs -+ << setw(6) << data_->usecs_ - << ' ' - << setfill(' ') << setw(5) - << static_cast<unsigned int>(GetTID()) << setfill('0') -@@ -1351,7 +1354,8 @@ void LogMessage::SendToLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) { - data_->line_, &data_->tm_time_, - data_->message_text_ + data_->num_prefix_chars_, - (data_->num_chars_to_log_ - -- data_->num_prefix_chars_ - 1)); -+ data_->num_prefix_chars_ - 1), -+ data_->usecs_); - } else { - - // log this message to all log files of severity <= severity_ -@@ -1368,7 +1372,8 @@ void LogMessage::SendToLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) { - data_->line_, &data_->tm_time_, - data_->message_text_ + data_->num_prefix_chars_, - (data_->num_chars_to_log_ -- - data_->num_prefix_chars_ - 1)); -+ - data_->num_prefix_chars_ - 1), -+ data_->usecs_); - // NOTE: -1 removes trailing \n - } - -@@ -1467,7 +1472,8 @@ void LogMessage::SendToSink() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) { - data_->line_, &data_->tm_time_, - data_->message_text_ + data_->num_prefix_chars_, - (data_->num_chars_to_log_ - -- data_->num_prefix_chars_ - 1)); -+ data_->num_prefix_chars_ - 1), -+ data_->usecs_); - } - } - -@@ -1595,16 +1601,10 @@ void LogSink::WaitTillSent() { - - string LogSink::ToString(LogSeverity severity, const char* file, int line, - const struct ::tm* tm_time, -- const char* message, size_t message_len) { -+ const char* message, size_t message_len, int32 usecs) { - ostringstream stream(string(message, message_len)); - stream.fill('0'); - -- // FIXME(jrvb): Updating this to use the correct value for usecs -- // requires changing the signature for both this method and -- // LogSink::send(). This change needs to be done in a separate CL -- // so subclasses of LogSink can be updated at the same time. -- int usecs = 0; -- - stream << LogSeverityNames[severity][0] - << setw(2) << 1+tm_time->tm_mon - << setw(2) << tm_time->tm_mday -diff --git a/src/logging_unittest.cc b/src/logging_unittest.cc -index d7e95cf..aff8408 100644 ---- a/src/logging_unittest.cc -+++ b/src/logging_unittest.cc -@@ -479,9 +479,16 @@ class TestLogSinkImpl : public LogSink { - virtual void send(LogSeverity severity, const char* /* full_filename */, - const char* base_filename, int line, - const struct tm* tm_time, -- const char* message, size_t message_len) { -+ const char* message, size_t message_len, int usecs) { - errors.push_back( -- ToString(severity, base_filename, line, tm_time, message, message_len)); -+ ToString(severity, base_filename, line, tm_time, message, message_len, usecs)); -+ } -+ virtual void send(LogSeverity severity, const char* full_filename, -+ const char* base_filename, int line, -+ const struct tm* tm_time, -+ const char* message, size_t message_len) { -+ send(severity, full_filename, base_filename, line, -+ tm_time, message, message_len, 0); - } - }; - -@@ -999,15 +1006,23 @@ class TestWaitingLogSink : public LogSink { - virtual void send(LogSeverity severity, const char* /* full_filename */, - const char* base_filename, int line, - const struct tm* tm_time, -- const char* message, size_t message_len) { -+ const char* message, size_t message_len, int usecs) { - // Push it to Writer thread if we are the original logging thread. - // Note: Something like ThreadLocalLogSink is a better choice - // to do thread-specific LogSink logic for real. - if (pthread_equal(tid_, pthread_self())) { - writer_.Buffer(ToString(severity, base_filename, line, -- tm_time, message, message_len)); -+ tm_time, message, message_len, usecs)); - } - } -+ -+ virtual void send(LogSeverity severity, const char* full_filename, -+ const char* base_filename, int line, -+ const struct tm* tm_time, -+ const char* message, size_t message_len) { -+ send(severity, full_filename, base_filename, line, tm_time, message, message_len); -+ } -+ - virtual void WaitTillSent() { - // Wait for Writer thread if we are the original logging thread. - if (pthread_equal(tid_, pthread_self())) writer_.Wait(); -diff --git a/src/windows/glog/logging.h b/src/windows/glog/logging.h -index 1d91b12..acdd0c2 100755 ---- a/src/windows/glog/logging.h -+++ b/src/windows/glog/logging.h -@@ -1368,6 +1368,16 @@ class GOOGLE_GLOG_DLL_DECL LogSink { - // Sink's logging logic (message_len is such as to exclude '\n' at the end). - // This method can't use LOG() or CHECK() as logging system mutex(s) are held - // during this call. -+ virtual void send(LogSeverity severity, const char* full_filename, -+ const char* base_filename, int line, -+ const struct ::tm* tm_time, -+ const char* message, size_t message_len, int32 usecs) { -+ send(severity, full_filename, base_filename, line, -+ tm_time, message, message_len); -+ } -+ // This send() signature is obsolete. -+ // New implementations should define this in terms of -+ // the above send() method. - virtual void send(LogSeverity severity, const char* full_filename, - const char* base_filename, int line, - const struct ::tm* tm_time, -@@ -1392,7 +1402,15 @@ class GOOGLE_GLOG_DLL_DECL LogSink { - // Can be useful to implement send(). - static std::string ToString(LogSeverity severity, const char* file, int line, - const struct ::tm* tm_time, -- const char* message, size_t message_len); -+ const char* message, size_t message_len, -+ int32 usecs); -+ -+ // Obsolete -+ static std::string ToString(LogSeverity severity, const char* file, int line, -+ const struct ::tm* tm_time, -+ const char* message, size_t message_len) { -+ return ToString(severity, file, line, tm_time, message, message_len, 0); -+ } - }; - - // Add or remove a LogSink as a consumer of logging data. Thread-safe. diff --git a/3rdparty/glog-0.3.3.tar.gz b/3rdparty/glog-0.3.3.tar.gz deleted file mode 100644 index 92fa52d..0000000 Binary files a/3rdparty/glog-0.3.3.tar.gz and /dev/null differ diff --git a/3rdparty/glog-0.4.0.patch b/3rdparty/glog-0.4.0.patch new file mode 100644 index 0000000..7e8e5a6 --- /dev/null +++ b/3rdparty/glog-0.4.0.patch @@ -0,0 +1,282 @@ +diff --git a/configure.ac b/configure.ac +index 69711b7..9b77c07 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -127,27 +127,9 @@ if test x"$acx_pthread_ok" = x"yes"; then + AC_CHECK_LIB(pthread, pthread_self) + fi + +-# Check if there is google-gflags library installed. +-SAVE_CFLAGS="$CFLAGS" +-SAVE_LIBS="$LIBS" +-AC_ARG_WITH(gflags, AS_HELP_STRING[--with-gflags=GFLAGS_DIR], +- GFLAGS_CFLAGS="-I${with_gflags}/include" +- GFLAGS_LIBS="-L${with_gflags}/lib -lgflags" +- CFLAGS="$CFLAGS $GFLAGS_CFLAGS" +- LIBS="$LIBS $GFLAGS_LIBS" +-) +-AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1, ac_cv_have_libgflags=0) +-if test x"$ac_cv_have_libgflags" = x"1"; then +- AC_DEFINE(HAVE_LIB_GFLAGS, 1, [define if you have google gflags library]) +- if test x"$GFLAGS_LIBS" = x""; then +- GFLAGS_LIBS="-lgflags" +- fi +-else +- GFLAGS_CFLAGS= +- GFLAGS_LIBS= +-fi +-CFLAGS="$SAVE_CFLAGS" +-LIBS="$SAVE_LIBS" ++GFLAGS_CFLAGS= ++GFLAGS_LIBS= ++ac_cv_have_libgflags=0 + + # TODO(hamaji): Use official m4 macros provided by testing libraries + # once the m4 macro of Google Mocking becomes ready. +diff --git a/src/glog/stl_logging.h.in b/src/glog/stl_logging.h.in +index 600945d..bd935d5 100644 +--- a/src/glog/stl_logging.h.in ++++ b/src/glog/stl_logging.h.in +@@ -59,6 +59,13 @@ + #include <utility> + #include <vector> + ++#if defined (__GNUC__) && !defined(_LIBCPP_VERSION) ++# define GLOG_STL_LOGGING_FOR_EXT_HASH ++# define GLOG_STL_LOGGING_FOR_EXT_SLIST ++#elif defined(_LIBCPP_VERSION) ++# define GLOG_STL_LOGGING_FOR_UNORDERED ++#endif ++ + #ifdef GLOG_STL_LOGGING_FOR_UNORDERED + # include <unordered_map> + # include <unordered_set> +diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in +index 9968b96..ee0dc82 100644 +--- a/src/glog/logging.h.in ++++ b/src/glog/logging.h.in +@@ -1423,6 +1423,16 @@ class GOOGLE_GLOG_DLL_DECL LogSink { + // Sink's logging logic (message_len is such as to exclude '\n' at the end). + // This method can't use LOG() or CHECK() as logging system mutex(s) are held + // during this call. ++ virtual void send(LogSeverity severity, const char* full_filename, ++ const char* base_filename, int line, ++ const struct ::tm* tm_time, ++ const char* message, size_t message_len, int32 usecs) { ++ send(severity, full_filename, base_filename, line, ++ tm_time, message, message_len); ++ } ++ // This send() signature is obsolete. ++ // New implementations should define this in terms of ++ // the above send() method. + virtual void send(LogSeverity severity, const char* full_filename, + const char* base_filename, int line, + const struct ::tm* tm_time, +@@ -1447,7 +1457,15 @@ class GOOGLE_GLOG_DLL_DECL LogSink { + // Can be useful to implement send(). + static std::string ToString(LogSeverity severity, const char* file, int line, + const struct ::tm* tm_time, +- const char* message, size_t message_len); ++ const char* message, size_t message_len, ++ int32 usecs); ++ ++ // Obsolete ++ static std::string ToString(LogSeverity severity, const char* file, int line, ++ const struct ::tm* tm_time, ++ const char* message, size_t message_len) { ++ return ToString(severity, file, line, tm_time, message, message_len, 0); ++ } + }; + + // Add or remove a LogSink as a consumer of logging data. Thread-safe. +diff --git a/src/logging.cc b/src/logging.cc +index 0c86cf6..2da00eb 100644 +--- a/src/logging.cc ++++ b/src/logging.cc +@@ -349,6 +349,7 @@ struct LogMessage::LogMessageData { + }; + time_t timestamp_; // Time of creation of LogMessage + struct ::tm tm_time_; // Time of creation of LogMessage ++ int32 usecs_; // Time of creation of LogMessage - microseconds part + size_t num_prefix_chars_; // # of chars of prefix in this message + size_t num_chars_to_log_; // # of chars of msg to send to log + size_t num_chars_to_syslog_; // # of chars of msg to send to syslog +@@ -515,7 +516,8 @@ class LogDestination { + int line, + const struct ::tm* tm_time, + const char* message, +- size_t message_len); ++ size_t message_len, ++ int32 usecs); + + // Wait for all registered sinks via WaitTillSent + // including the optional one in "data". +@@ -782,12 +784,13 @@ inline void LogDestination::LogToSinks(LogSeverity severity, + int line, + const struct ::tm* tm_time, + const char* message, +- size_t message_len) { ++ size_t message_len, ++ int32 usecs) { + ReaderMutexLock l(&sink_mutex_); + if (sinks_) { + for (int i = sinks_->size() - 1; i >= 0; i--) { + (*sinks_)[i]->send(severity, full_filename, base_filename, +- line, tm_time, message, message_len); ++ line, tm_time, message, message_len, usecs); + } + } + } +@@ -1265,7 +1268,7 @@ void LogMessage::Init(const char* file, + WallTime now = WallTime_Now(); + data_->timestamp_ = static_cast<time_t>(now); + localtime_r(&data_->timestamp_, &data_->tm_time_); +- int usecs = static_cast<int>((now - data_->timestamp_) * 1000000); ++ data_->usecs_ = static_cast<int32>((now - data_->timestamp_) * 1000000); + + data_->num_chars_to_log_ = 0; + data_->num_chars_to_syslog_ = 0; +@@ -1285,7 +1288,7 @@ void LogMessage::Init(const char* file, + << setw(2) << data_->tm_time_.tm_hour << ':' + << setw(2) << data_->tm_time_.tm_min << ':' + << setw(2) << data_->tm_time_.tm_sec << "." +- << setw(6) << usecs ++ << setw(6) << data_->usecs_ + << ' ' + << setfill(' ') << setw(5) + << static_cast<unsigned int>(GetTID()) << setfill('0') +@@ -1432,7 +1435,8 @@ void LogMessage::SendToLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) { + data_->line_, &data_->tm_time_, + data_->message_text_ + data_->num_prefix_chars_, + (data_->num_chars_to_log_ - +- data_->num_prefix_chars_ - 1)); ++ data_->num_prefix_chars_ - 1), ++ data_->usecs_); + } else { + + // log this message to all log files of severity <= severity_ +@@ -1449,7 +1453,8 @@ void LogMessage::SendToLog() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) { + data_->line_, &data_->tm_time_, + data_->message_text_ + data_->num_prefix_chars_, + (data_->num_chars_to_log_ +- - data_->num_prefix_chars_ - 1)); ++ - data_->num_prefix_chars_ - 1), ++ data_->usecs_); + // NOTE: -1 removes trailing \n + } + +@@ -1545,7 +1550,8 @@ void LogMessage::SendToSink() EXCLUSIVE_LOCKS_REQUIRED(log_mutex) { + data_->line_, &data_->tm_time_, + data_->message_text_ + data_->num_prefix_chars_, + (data_->num_chars_to_log_ - +- data_->num_prefix_chars_ - 1)); ++ data_->num_prefix_chars_ - 1), ++ data_->usecs_); + } + } + +@@ -1672,16 +1678,10 @@ void LogSink::WaitTillSent() { + + string LogSink::ToString(LogSeverity severity, const char* file, int line, + const struct ::tm* tm_time, +- const char* message, size_t message_len) { ++ const char* message, size_t message_len, int32 usecs) { + ostringstream stream(string(message, message_len)); + stream.fill('0'); + +- // FIXME(jrvb): Updating this to use the correct value for usecs +- // requires changing the signature for both this method and +- // LogSink::send(). This change needs to be done in a separate CL +- // so subclasses of LogSink can be updated at the same time. +- int usecs = 0; +- + stream << LogSeverityNames[severity][0] + << setw(2) << 1+tm_time->tm_mon + << setw(2) << tm_time->tm_mday +diff --git a/src/logging_unittest.cc b/src/logging_unittest.cc +index 762c752..7f9de36 100644 +--- a/src/logging_unittest.cc ++++ b/src/logging_unittest.cc +@@ -487,9 +487,16 @@ class TestLogSinkImpl : public LogSink { + virtual void send(LogSeverity severity, const char* /* full_filename */, + const char* base_filename, int line, + const struct tm* tm_time, +- const char* message, size_t message_len) { ++ const char* message, size_t message_len, int usecs) { + errors.push_back( +- ToString(severity, base_filename, line, tm_time, message, message_len)); ++ ToString(severity, base_filename, line, tm_time, message, message_len, usecs)); ++ } ++ virtual void send(LogSeverity severity, const char* full_filename, ++ const char* base_filename, int line, ++ const struct tm* tm_time, ++ const char* message, size_t message_len) { ++ send(severity, full_filename, base_filename, line, ++ tm_time, message, message_len, 0); + } + }; + +@@ -1010,15 +1017,23 @@ class TestWaitingLogSink : public LogSink { + virtual void send(LogSeverity severity, const char* /* full_filename */, + const char* base_filename, int line, + const struct tm* tm_time, +- const char* message, size_t message_len) { ++ const char* message, size_t message_len, int usecs) { + // Push it to Writer thread if we are the original logging thread. + // Note: Something like ThreadLocalLogSink is a better choice + // to do thread-specific LogSink logic for real. + if (pthread_equal(tid_, pthread_self())) { + writer_.Buffer(ToString(severity, base_filename, line, +- tm_time, message, message_len)); ++ tm_time, message, message_len, usecs)); + } + } ++ ++ virtual void send(LogSeverity severity, const char* full_filename, ++ const char* base_filename, int line, ++ const struct tm* tm_time, ++ const char* message, size_t message_len) { ++ send(severity, full_filename, base_filename, line, tm_time, message, message_len); ++ } ++ + virtual void WaitTillSent() { + // Wait for Writer thread if we are the original logging thread. + if (pthread_equal(tid_, pthread_self())) writer_.Wait(); +diff --git a/src/windows/glog/logging.h b/src/windows/glog/logging.h +index 3681fa3..d8193ae 100755 +--- a/src/windows/glog/logging.h ++++ b/src/windows/glog/logging.h +@@ -1427,6 +1427,16 @@ class GOOGLE_GLOG_DLL_DECL LogSink { + // Sink's logging logic (message_len is such as to exclude '\n' at the end). + // This method can't use LOG() or CHECK() as logging system mutex(s) are held + // during this call. ++ virtual void send(LogSeverity severity, const char* full_filename, ++ const char* base_filename, int line, ++ const struct ::tm* tm_time, ++ const char* message, size_t message_len, int32 usecs) { ++ send(severity, full_filename, base_filename, line, ++ tm_time, message, message_len); ++ } ++ // This send() signature is obsolete. ++ // New implementations should define this in terms of ++ // the above send() method. + virtual void send(LogSeverity severity, const char* full_filename, + const char* base_filename, int line, + const struct ::tm* tm_time, +@@ -1451,7 +1461,15 @@ class GOOGLE_GLOG_DLL_DECL LogSink { + // Can be useful to implement send(). + static std::string ToString(LogSeverity severity, const char* file, int line, + const struct ::tm* tm_time, +- const char* message, size_t message_len); ++ const char* message, size_t message_len, ++ int32 usecs); ++ ++ // Obsolete ++ static std::string ToString(LogSeverity severity, const char* file, int line, ++ const struct ::tm* tm_time, ++ const char* message, size_t message_len) { ++ return ToString(severity, file, line, tm_time, message, message_len, 0); ++ } + }; + + // Add or remove a LogSink as a consumer of logging data. Thread-safe. diff --git a/3rdparty/glog-0.4.0.tar.gz b/3rdparty/glog-0.4.0.tar.gz new file mode 100644 index 0000000..ccf002c Binary files /dev/null and b/3rdparty/glog-0.4.0.tar.gz differ diff --git a/3rdparty/glog-da816ea70.patch b/3rdparty/glog-da816ea70.patch deleted file mode 100644 index 2f0fae3..0000000 --- a/3rdparty/glog-da816ea70.patch +++ /dev/null @@ -1,726 +0,0 @@ -diff --git c/CMakeLists.txt w/CMakeLists.txt -index 7ede6e7ad..1b05456e4 100644 ---- c/CMakeLists.txt -+++ w/CMakeLists.txt -@@ -364,9 +364,9 @@ set (GLOG_SRCS - src/vlog_is_on.cc - ) - --if (HAVE_PTHREAD) -+if (HAVE_PTHREAD OR WIN32) - list (APPEND GLOG_SRCS src/signalhandler.cc) --endif (HAVE_PTHREAD) -+endif (HAVE_PTHREAD OR WIN32) - - if (WIN32) - list (APPEND GLOG_SRCS -@@ -455,6 +455,12 @@ if (HAVE_EXECINFO_H) - set (HAVE_STACKTRACE 1) - endif (HAVE_EXECINFO_H) - -+if (WIN32) -+ set (HAVE_STACKTRACE 1) -+ set (HAVE_SYMBOLIZE 1) -+ target_link_libraries (glog PUBLIC Dbghelp.lib) -+endif (WIN32) -+ - if (UNIX OR (APPLE AND HAVE_DLADDR)) - set (HAVE_SYMBOLIZE 1) - endif (UNIX OR (APPLE AND HAVE_DLADDR)) -@@ -527,13 +533,13 @@ if (BUILD_TESTING) - - target_link_libraries (utilities_unittest PRIVATE glog) - -- if (HAVE_STACKTRACE AND HAVE_SYMBOLIZE) -+ if (HAVE_STACKTRACE AND HAVE_SYMBOLIZE AND NOT WIN32) - add_executable (signalhandler_unittest - src/signalhandler_unittest.cc - ) - - target_link_libraries (signalhandler_unittest PRIVATE glog) -- endif (HAVE_STACKTRACE AND HAVE_SYMBOLIZE) -+ endif (HAVE_STACKTRACE AND HAVE_SYMBOLIZE AND NOT WIN32) - - add_test (NAME demangle COMMAND demangle_unittest) - add_test (NAME logging COMMAND logging_unittest) -diff --git c/src/demangle.cc w/src/demangle.cc -index e858181a6..cf897457a 100644 ---- c/src/demangle.cc -+++ w/src/demangle.cc -@@ -35,10 +35,16 @@ - // Note that we only have partial C++0x support yet. - - #include <stdio.h> // for NULL -+#include "utilities.h" - #include "demangle.h" - -+#if defined(OS_WINDOWS) -+#include <Dbghelp.h> -+#endif -+ - _START_GOOGLE_NAMESPACE_ - -+#if !defined(OS_WINDOWS) - typedef struct { - const char *abbrev; - const char *real_name; -@@ -1293,12 +1299,32 @@ static bool ParseTopLevelMangledName(State *state) { - } - return false; - } -+#endif - - // The demangler entry point. - bool Demangle(const char *mangled, char *out, int out_size) { -+#if defined(OS_WINDOWS) -+ // When built with incremental linking, the Windows debugger -+ // library provides a more complicated `Symbol->Name` with the -+ // Incremental Linking Table offset, which looks like -+ // `@ILT+1105(?func@Foo@@SAXH@Z)`. However, the demangler expects -+ // only the mangled symbol, `?func@Foo@@SAXH@Z`. Fortunately, the -+ // mangled symbol is guaranteed not to have parentheses, -+ // so we search for `(` and extract up to `)`. -+ std::string symbol(mangled); -+ size_t mark = symbol.find('('); -+ if (mark != std::string::npos) { -+ // Extract the string `(?...)` -+ std::string temp = symbol.substr(mark); -+ // Remove the surrounding parentheses -+ symbol = temp.substr(1, temp.size() - 2); -+ } // Else the symbol wasn't inside a set of parentheses -+ return UnDecorateSymbolName(symbol.c_str(), out, out_size, UNDNAME_COMPLETE); -+#else - State state; - InitState(&state, mangled, out, out_size); - return ParseTopLevelMangledName(&state) && !state.overflowed; -+#endif - } - - _END_GOOGLE_NAMESPACE_ -diff --git c/src/demangle_unittest.cc w/src/demangle_unittest.cc -index 32f322101..be483411f 100644 ---- c/src/demangle_unittest.cc -+++ w/src/demangle_unittest.cc -@@ -62,18 +62,37 @@ static const char *DemangleIt(const char * const mangled) { - } - } - -+#if defined(OS_WINDOWS) -+ -+TEST(Demangle, Windows) { -+ EXPECT_STREQ( -+ "public: static void __cdecl Foo::func(int)", -+ DemangleIt("?func@Foo@@SAXH@Z")); -+ EXPECT_STREQ( -+ "public: static void __cdecl Foo::func(int)", -+ DemangleIt("@ILT+1105(?func@Foo@@SAXH@Z)")); -+ EXPECT_STREQ( -+ "int __cdecl foobarArray(int * const)", -+ DemangleIt("?foobarArray@@YAHQAH@Z")); -+} -+ -+#else -+ - // Test corner cases of bounary conditions. - TEST(Demangle, CornerCases) { -- char tmp[10]; -- EXPECT_TRUE(Demangle("_Z6foobarv", tmp, sizeof(tmp))); -- // sizeof("foobar()") == 9 -- EXPECT_STREQ("foobar()", tmp); -- EXPECT_TRUE(Demangle("_Z6foobarv", tmp, 9)); -- EXPECT_STREQ("foobar()", tmp); -- EXPECT_FALSE(Demangle("_Z6foobarv", tmp, 8)); // Not enough. -- EXPECT_FALSE(Demangle("_Z6foobarv", tmp, 1)); -- EXPECT_FALSE(Demangle("_Z6foobarv", tmp, 0)); -- EXPECT_FALSE(Demangle("_Z6foobarv", NULL, 0)); // Should not cause SEGV. -+ const size_t size = 10; -+ char tmp[size] = { 0 }; -+ const char *demangled = "foobar()"; -+ const char *mangled = "_Z6foobarv"; -+ EXPECT_TRUE(Demangle(mangled, tmp, sizeof(tmp))); -+ // sizeof("foobar()") == size - 1 -+ EXPECT_STREQ(demangled, tmp); -+ EXPECT_TRUE(Demangle(mangled, tmp, size - 1)); -+ EXPECT_STREQ(demangled, tmp); -+ EXPECT_FALSE(Demangle(mangled, tmp, size - 2)); // Not enough. -+ EXPECT_FALSE(Demangle(mangled, tmp, 1)); -+ EXPECT_FALSE(Demangle(mangled, tmp, 0)); -+ EXPECT_FALSE(Demangle(mangled, NULL, 0)); // Should not cause SEGV. - } - - // Test handling of functions suffixed with .clone.N, which is used by GCC -@@ -123,6 +142,8 @@ TEST(Demangle, FromFile) { - } - } - -+#endif -+ - int main(int argc, char **argv) { - #ifdef HAVE_LIB_GFLAGS - ParseCommandLineFlags(&argc, &argv, true); -diff --git c/src/logging.cc w/src/logging.cc -index 0b5e6ee97..aa8a95eda 100644 ---- c/src/logging.cc -+++ w/src/logging.cc -@@ -92,6 +92,15 @@ using std::fdopen; - #define fdopen _fdopen - #endif - -+#if defined(OS_WINDOWS) -+_START_GOOGLE_NAMESPACE_ -+namespace glog_internal_namespace_ { -+ void DumpTimeInfo(); -+ void DumpStackInfo(int); -+} -+_END_GOOGLE_NAMESPACE_ -+#endif -+ - // There is no thread annotation support. - #define EXCLUSIVE_LOCKS_REQUIRED(mu) - -@@ -1466,8 +1475,17 @@ void LogMessage::RecordCrashReason( - static void logging_fail() ATTRIBUTE_NORETURN; - - static void logging_fail() { -+#if defined(OS_WINDOWS) -+ // On Windows,the stack trace info needs to be dumped here instead -+ // of in the `SIGABRT` signal handler to avoid thread switching. -+ // The signal handler runs on the thread on which it was installed, -+ // making the stack trace irrelevant. -+ glog_internal_namespace_::DumpTimeInfo(); -+ glog_internal_namespace_::DumpStackInfo(5); -+ FlushLogFilesUnsafe(0); -+#endif - #if defined(_DEBUG) && defined(_MSC_VER) -- // When debugging on windows, avoid the obnoxious dialog and make -+ // When debugging on Windows, avoid the obnoxious dialog and make - // it possible to continue past a LOG(FATAL) in the debugger - __debugbreak(); - #else -diff --git c/src/signalhandler.cc w/src/signalhandler.cc -index a7aef8b99..a28b8b7c6 100644 ---- c/src/signalhandler.cc -+++ w/src/signalhandler.cc -@@ -48,38 +48,11 @@ - - _START_GOOGLE_NAMESPACE_ - --// TOOD(hamaji): Use signal instead of sigaction? --#ifdef HAVE_SIGACTION -- --namespace { -- --// We'll install the failure signal handler for these signals. We could --// use strsignal() to get signal names, but we don't use it to avoid --// introducing yet another #ifdef complication. --// --// The list should be synced with the comment in signalhandler.h. --const struct { -- int number; -- const char *name; --} kFailureSignals[] = { -- { SIGSEGV, "SIGSEGV" }, -- { SIGILL, "SIGILL" }, -- { SIGFPE, "SIGFPE" }, -- { SIGABRT, "SIGABRT" }, -- { SIGBUS, "SIGBUS" }, -- { SIGTERM, "SIGTERM" }, --}; -+namespace glog_internal_namespace_ { - --// Returns the program counter from signal context, NULL if unknown. --void* GetPC(void* ucontext_in_void) { --#if (defined(HAVE_UCONTEXT_H) || defined(HAVE_SYS_UCONTEXT_H)) && defined(PC_FROM_UCONTEXT) -- if (ucontext_in_void != NULL) { -- ucontext_t *context = reinterpret_cast<ucontext_t *>(ucontext_in_void); -- return (void*)context->PC_FROM_UCONTEXT; -- } -+#ifdef HAVE_SIGACTION -+ void DumpSignalInfo(int signal_number, siginfo_t *siginfo); - #endif -- return NULL; --} - - // The class is used for formatting error messages. We don't use printf() - // as it's not async signal safe. -@@ -168,6 +141,76 @@ void DumpTimeInfo() { - g_failure_writer(buf, formatter.num_bytes_written()); - } - -+// Dumps information about the stack frame to STDERR. -+void DumpStackFrameInfo(const char* prefix, void* pc) { -+ // Get the symbol name. -+ const char *symbol = "(unknown)"; -+ char symbolized[1024] = {}; // Big enough for a sane symbol. -+ // Symbolizes the previous address of pc because pc may be in the -+ // next function. -+ if (Symbolize(reinterpret_cast<char *>(pc) - 1, -+ symbolized, sizeof(symbolized))) { -+ symbol = symbolized; -+ } -+ -+ char buf[1024]; // Big enough for stack frame info. -+ MinimalFormatter formatter(buf, sizeof(buf)); -+ -+ formatter.AppendString(prefix); -+ formatter.AppendString("@ "); -+ const int width = 2 * sizeof(void*) + 2; // + 2 for "0x". -+ formatter.AppendHexWithPadding(reinterpret_cast<uintptr_t>(pc), width); -+ formatter.AppendString(" "); -+ formatter.AppendString(symbol); -+ formatter.AppendString("\n"); -+ g_failure_writer(buf, formatter.num_bytes_written()); -+} -+ -+// Argument is the number of frames to skip, excluding this function. -+void DumpStackInfo(int frames) { -+#ifdef HAVE_STACKTRACE -+ // Get the stack traces. -+ void *stack[32]; -+ // +1 to exclude this function. -+ const int depth = GetStackTrace(stack, ARRAYSIZE(stack), frames + 1); -+ // Dump the stack traces. -+ for (int i = 0; i < depth; ++i) { -+ DumpStackFrameInfo(" ", stack[i]); -+ } -+#endif -+} -+ -+// TOOD(hamaji): Use signal instead of sigaction? -+#ifdef HAVE_SIGACTION -+ -+// We'll install the failure signal handler for these signals. We could -+// use strsignal() to get signal names, but we don't use it to avoid -+// introducing yet another #ifdef complication. -+// -+// The list should be synced with the comment in signalhandler.h. -+const struct { -+ int number; -+ const char *name; -+} kFailureSignals[] = { -+ { SIGSEGV, "SIGSEGV" }, -+ { SIGILL, "SIGILL" }, -+ { SIGFPE, "SIGFPE" }, -+ { SIGABRT, "SIGABRT" }, -+ { SIGBUS, "SIGBUS" }, -+ { SIGTERM, "SIGTERM" }, -+}; -+ -+// Returns the program counter from signal context, NULL if unknown. -+void* GetPC(void* ucontext_in_void) { -+#if (defined(HAVE_UCONTEXT_H) || defined(HAVE_SYS_UCONTEXT_H)) && defined(PC_FROM_UCONTEXT) -+ if (ucontext_in_void != NULL) { -+ ucontext_t *context = reinterpret_cast<ucontext_t *>(ucontext_in_void); -+ return (void*)context->PC_FROM_UCONTEXT; -+ } -+#endif -+ return NULL; -+} -+ - // Dumps information about the signal to STDERR. - void DumpSignalInfo(int signal_number, siginfo_t *siginfo) { - // Get the signal name. -@@ -213,31 +256,6 @@ void DumpSignalInfo(int signal_number, siginfo_t *siginfo) { - g_failure_writer(buf, formatter.num_bytes_written()); - } - --// Dumps information about the stack frame to STDERR. --void DumpStackFrameInfo(const char* prefix, void* pc) { -- // Get the symbol name. -- const char *symbol = "(unknown)"; -- char symbolized[1024]; // Big enough for a sane symbol. -- // Symbolizes the previous address of pc because pc may be in the -- // next function. -- if (Symbolize(reinterpret_cast<char *>(pc) - 1, -- symbolized, sizeof(symbolized))) { -- symbol = symbolized; -- } -- -- char buf[1024]; // Big enough for stack frame info. -- MinimalFormatter formatter(buf, sizeof(buf)); -- -- formatter.AppendString(prefix); -- formatter.AppendString("@ "); -- const int width = 2 * sizeof(void*) + 2; // + 2 for "0x". -- formatter.AppendHexWithPadding(reinterpret_cast<uintptr_t>(pc), width); -- formatter.AppendString(" "); -- formatter.AppendString(symbol); -- formatter.AppendString("\n"); -- g_failure_writer(buf, formatter.num_bytes_written()); --} -- - // Invoke the default signal handler. - void InvokeDefaultSignalHandler(int signal_number) { - struct sigaction sig_action; -@@ -302,18 +320,14 @@ void FailureSignalHandler(int signal_number, - void *pc = GetPC(ucontext); - DumpStackFrameInfo("PC: ", pc); - --#ifdef HAVE_STACKTRACE -- // Get the stack traces. -- void *stack[32]; -- // +1 to exclude this function. -- const int depth = GetStackTrace(stack, ARRAYSIZE(stack), 1); -+ // Now dumb the signal info. -+#ifdef HAVE_SIGACTION - DumpSignalInfo(signal_number, signal_info); -- // Dump the stack traces. -- for (int i = 0; i < depth; ++i) { -- DumpStackFrameInfo(" ", stack[i]); -- } - #endif - -+ // Now dump the stack trace. -+ DumpStackInfo(0); -+ - // *** TRANSITION *** - // - // BEFORE this point, all code must be async-termination-safe! -@@ -330,12 +344,15 @@ void FailureSignalHandler(int signal_number, - // Kill ourself by the default signal handler. - InvokeDefaultSignalHandler(signal_number); - } -- --} // namespace -- -+#elif defined(OS_WINDOWS) -+void FailureSignalHandler(int signal) { -+ if (signal != SIGABRT) { -+ return; -+ } -+ exit(1); -+} - #endif // HAVE_SIGACTION - --namespace glog_internal_namespace_ { - - bool IsFailureSignalHandlerInstalled() { - #ifdef HAVE_SIGACTION -@@ -345,6 +362,9 @@ bool IsFailureSignalHandlerInstalled() { - sigaction(SIGABRT, NULL, &sig_action); - if (sig_action.sa_sigaction == &FailureSignalHandler) - return true; -+#elif defined(OS_WINDOWS) -+ // TODO: check if we installed it -+ return true; - #endif // HAVE_SIGACTION - return false; - } -@@ -363,11 +383,15 @@ void InstallFailureSignalHandler() { - for (size_t i = 0; i < ARRAYSIZE(kFailureSignals); ++i) { - CHECK_ERR(sigaction(kFailureSignals[i].number, &sig_action, NULL)); - } -+#elif defined(OS_WINDOWS) -+ typedef void (*SignalHandlerPointer)(int); -+ SignalHandlerPointer previousHandler; -+ previousHandler = signal(SIGABRT, &FailureSignalHandler); - #endif // HAVE_SIGACTION - } - - void InstallFailureWriter(void (*writer)(const char* data, int size)) { --#ifdef HAVE_SIGACTION -+#if defined(HAVE_SIGACTION) || defined(OS_WINDOWS) - g_failure_writer = writer; - #endif // HAVE_SIGACTION - } -diff --git c/src/stacktrace_unittest.cc w/src/stacktrace_unittest.cc -index c1b3b36ff..ed95f8945 100644 ---- c/src/stacktrace_unittest.cc -+++ w/src/stacktrace_unittest.cc -@@ -90,6 +90,32 @@ AddressRange expected_range[BACKTRACE_STEPS]; - (prange)->end = ra; \ - } \ - } while (0) -+#elif defined(OS_WINDOWS) -+// Compiler Intrinsic _ReturnAddress documentation: -+// https://msdn.microsoft.com/en-us/library/64ez38eh(v=vs.140).aspx -+// This is equivalent to __builtin_return_address. -+#include <intrin.h> -+#pragma intrinsic(_ReturnAddress) -+#define INIT_ADDRESS_RANGE(fn, start_label, end_label, prange) \ -+ do { \ -+ (prange)->start = &fn; \ -+ (prange)->end = _ReturnAddress(); \ -+ CHECK_LT((prange)->start, (prange)->end); \ -+ } while (0) -+#define DECLARE_ADDRESS_LABEL(a_label) do { } while (0) -+// MSVC may do the same thing as GCC (as noted above). -+// Adjust function range from _ReturnAddress. -+#define ADJUST_ADDRESS_RANGE_FROM_RA(prange) \ -+ do { \ -+ void *ra = _ReturnAddress(); \ -+ CHECK_LT((prange)->start, ra); \ -+ if (ra > (prange)->end) { \ -+ printf("Adjusting range from %p..%p to %p..%p\n", \ -+ (prange)->start, (prange)->end, \ -+ (prange)->start, ra); \ -+ (prange)->end = ra; \ -+ } \ -+ } while (0) - #else - // Assume the Check* functions below are not longer than 256 bytes. - #define INIT_ADDRESS_RANGE(fn, start_label, end_label, prange) \ -diff --git c/src/stacktrace_windows-inl.h w/src/stacktrace_windows-inl.h -new file mode 100644 -index 000000000..dc23d109d ---- /dev/null -+++ w/src/stacktrace_windows-inl.h -@@ -0,0 +1,49 @@ -+// Copyright (c) 2000 - 2007, Google Inc. -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions are -+// met: -+// -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above -+// copyright notice, this list of conditions and the following disclaimer -+// in the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of Google Inc. nor the names of its -+// contributors may be used to endorse or promote products derived from -+// this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+// Author: Andrew Schwartzmeyer -+// -+// Windows implementation - just use CaptureStackBackTrace -+ -+#include "port.h" -+#include "stacktrace.h" -+#include "Dbghelp.h" -+ -+_START_GOOGLE_NAMESPACE_ -+ -+int GetStackTrace(void** result, int max_depth, int skip_count) { -+ if (max_depth > 64) { -+ max_depth = 64; -+ } -+ skip_count++; // we want to skip the current frame as well -+ // This API is thread-safe (moreover it walks only the current thread). -+ return CaptureStackBackTrace(skip_count, max_depth, result, NULL); -+} -+ -+_END_GOOGLE_NAMESPACE_ -diff --git c/src/symbolize.cc w/src/symbolize.cc -index f83c30973..0f10a86af 100644 ---- c/src/symbolize.cc -+++ w/src/symbolize.cc -@@ -837,6 +837,57 @@ static ATTRIBUTE_NOINLINE bool SymbolizeAndDemangle(void *pc, char *out, - - _END_GOOGLE_NAMESPACE_ - -+#elif defined(OS_WINDOWS) -+ -+#include "Dbghelp.h" -+ -+_START_GOOGLE_NAMESPACE_ -+ -+class SymInitializer { -+public: -+ HANDLE process = NULL; -+ bool ready = false; -+ SymInitializer() { -+ // Initialize the symbol handler. -+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms680344(v=vs.85).aspx -+ process = GetCurrentProcess(); -+ // Defer symbol loading. -+ // We do not request undecorated symbols with SYMOPT_UNDNAME -+ // because the mangling library calls UnDecorateSymbolName. -+ SymSetOptions(SYMOPT_DEFERRED_LOADS); -+ if (SymInitialize(process, NULL, true)) { -+ ready = true; -+ } -+ } -+ ~SymInitializer() { -+ SymCleanup(process); -+ } -+}; -+ -+__declspec(noinline) static bool SymbolizeAndDemangle(void *pc, char *out, -+ int out_size) { -+ const SymInitializer symInitializer; -+ if (!symInitializer.ready) { -+ return false; -+ } -+ // Resolve symbol information from address. -+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms680578(v=vs.85).aspx -+ char buf[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)]; -+ SYMBOL_INFO *symbol = reinterpret_cast<SYMBOL_INFO*>(buf); -+ symbol->SizeOfStruct = sizeof(SYMBOL_INFO); -+ symbol->MaxNameLen = MAX_SYM_NAME; -+ bool ret = SymFromAddr(symInitializer.process, reinterpret_cast<DWORD64>(pc), 0, symbol); -+ if (ret && static_cast<int>(symbol->NameLen) < out_size) { -+ strncpy(out, symbol->Name, symbol->NameLen + 1); -+ // Symbolization succeeded. Now we try to demangle the symbol. -+ DemangleInplace(out, out_size); -+ return true; -+ } -+ return false; -+} -+ -+_END_GOOGLE_NAMESPACE_ -+ - #else - # error BUG: HAVE_SYMBOLIZE was wrongly set - #endif -diff --git c/src/symbolize_unittest.cc w/src/symbolize_unittest.cc -index 05cb8a11c..348a71b43 100644 ---- c/src/symbolize_unittest.cc -+++ w/src/symbolize_unittest.cc -@@ -49,10 +49,22 @@ using namespace GFLAGS_NAMESPACE; - using namespace std; - using namespace GOOGLE_NAMESPACE; - --#if defined(HAVE_STACKTRACE) && defined(__ELF__) -+#if defined(HAVE_STACKTRACE) - - #define always_inline - -+// A wrapper function for Symbolize() to make the unit test simple. -+static const char *TrySymbolize(void *pc) { -+ static char symbol[4096]; -+ if (Symbolize(pc, symbol, sizeof(symbol))) { -+ return symbol; -+ } else { -+ return NULL; -+ } -+} -+ -+# if defined(__ELF__) -+ - // This unit tests make sense only with GCC. - // Uses lots of GCC specific features. - #if defined(__GNUC__) && !defined(__OPENCC__) -@@ -70,16 +82,6 @@ using namespace GOOGLE_NAMESPACE; - # endif // defined(__i386__) || defined(__x86_64__) - #endif - --// A wrapper function for Symbolize() to make the unit test simple. --static const char *TrySymbolize(void *pc) { -- static char symbol[4096]; -- if (Symbolize(pc, symbol, sizeof(symbol))) { -- return symbol; -- } else { -- return NULL; -- } --} -- - // Make them C linkage to avoid mangled names. - extern "C" { - void nonstatic_func() { -@@ -340,11 +342,42 @@ void ATTRIBUTE_NOINLINE TestWithReturnAddress() { - #endif - } - -+# elif defined(OS_WINDOWS) -+ -+#include <intrin.h> -+#pragma intrinsic(_ReturnAddress) -+ -+struct Foo { -+ static void func(int x); -+}; -+ -+__declspec(noinline) void Foo::func(int x) { -+ volatile int a = x; -+ ++a; -+} -+ -+TEST(Symbolize, SymbolizeWithDemangling) { -+ Foo::func(100); -+ const char* ret = TrySymbolize((void *)(&Foo::func)); -+ EXPECT_STREQ("public: static void __cdecl Foo::func(int)", ret); -+} -+ -+__declspec(noinline) void TestWithReturnAddress() { -+ void *return_address = _ReturnAddress(); -+ const char *symbol = TrySymbolize(return_address); -+ CHECK(symbol != NULL); -+ CHECK_STREQ(symbol, "main"); -+ cout << "Test case TestWithReturnAddress passed." << endl; -+} -+# endif // __ELF__ -+#endif // HAVE_STACKTRACE -+ - int main(int argc, char **argv) { - FLAGS_logtostderr = true; - InitGoogleLogging(argv[0]); - InitGoogleTest(&argc, argv); --#ifdef HAVE_SYMBOLIZE -+#if defined(HAVE_SYMBOLIZE) -+# if defined(__ELF__) - // We don't want to get affected by the callback interface, that may be - // used to install some callback function at InitGoogle() time. - InstallSymbolizeCallback(NULL); -@@ -353,18 +386,15 @@ int main(int argc, char **argv) { - TestWithPCInsideNonInlineFunction(); - TestWithReturnAddress(); - return RUN_ALL_TESTS(); --#else -- return 0; --#endif --} -- --#else --int main() { --#ifdef HAVE_SYMBOLIZE -+# elif defined(OS_WINDOWS) -+ TestWithReturnAddress(); -+ return RUN_ALL_TESTS(); -+# else - printf("PASS (no symbolize_unittest support)\n"); -+ return 0; -+# endif // __ELF__ - #else - printf("PASS (no symbolize support)\n"); --#endif - return 0; -+#endif - } --#endif // HAVE_STACKTRACE -diff --git c/src/utilities.h w/src/utilities.h -index 5f79968ef..10f98b24a 100644 ---- c/src/utilities.h -+++ w/src/utilities.h -@@ -97,6 +97,8 @@ - // malloc() from the unwinder. This is a problem because we're - // trying to use the unwinder to instrument malloc(). - // -+// 4) The Windows API CaptureStackTrace. -+// - // Note: if you add a new implementation here, make sure it works - // correctly when GetStackTrace() is called with max_depth == 0. - // Some code may do that. -@@ -110,6 +112,8 @@ - # define STACKTRACE_H "stacktrace_x86_64-inl.h" - # elif (defined(__ppc__) || defined(__PPC__)) && __GNUC__ >= 2 - # define STACKTRACE_H "stacktrace_powerpc-inl.h" -+# elif defined(OS_WINDOWS) -+# define STACKTRACE_H "stacktrace_windows-inl.h" - # endif - #endif - -@@ -127,6 +131,9 @@ - #elif defined(OS_MACOSX) && defined(HAVE_DLADDR) - // Use dladdr to symbolize. - # define HAVE_SYMBOLIZE -+#elif defined(OS_WINDOWS) -+// Use Dbghelp.dll to symbolize -+# define HAVE_SYMBOLIZE - #endif - - #ifndef ARRAYSIZE diff --git a/3rdparty/versions.am b/3rdparty/versions.am index 54daf00..6f6195d 100644 --- a/3rdparty/versions.am +++ b/3rdparty/versions.am @@ -24,7 +24,7 @@ CONCURRENTQUEUE_VERSION = 7b69a8f CSI_V0_VERSION = 0.2.0 CSI_V1_VERSION = 1.1.0 ELFIO_VERSION = 3.2 -GLOG_VERSION = 0.3.3 +GLOG_VERSION = 0.4.0 GOOGLETEST_VERSION = 1.8.0 GPERFTOOLS_VERSION = 2.5 GRPC_VERSION = 1.10.0 diff --git a/LICENSE b/LICENSE index 8632389..1d9958d 100644 --- a/LICENSE +++ b/LICENSE @@ -323,7 +323,7 @@ Agreement. ====================================================================== -For glog-0.3.3 (3rdparty/glog-0.3.3.tar.gz): +For glog-0.4.0 (3rdparty/glog-0.4.0.tar.gz): ====================================================================== Copyright (c) 2008, Google Inc. diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake index d9c1e40..c8da089 100644 --- a/cmake/CompilationConfigure.cmake +++ b/cmake/CompilationConfigure.cmake @@ -239,7 +239,6 @@ if (WIN32 AND REBUNDLED) " * curl\n" " * apr\n" " * zlib\n" - " * glog\n" "do not come rebundled in the Mesos repository. They will be downloaded from " "the Internet, even though the `REBUNDLED` flag was set.") endif () diff --git a/src/python/native_common/ext_modules.py.in b/src/python/native_common/ext_modules.py.in index eee56a9..ae05a8c 100644 --- a/src/python/native_common/ext_modules.py.in +++ b/src/python/native_common/ext_modules.py.in @@ -41,7 +41,7 @@ def _create_module(module_name): # libraries when building the final result, we need to explicitly # include them here (or more precisely, down where we actually include # libev.a and libprofiler.a). - glog = os.path.join('3rdparty', 'glog-0.3.3') + glog = os.path.join('3rdparty', 'glog-0.4.0') gperftools = os.path.join('3rdparty', 'gperftools-2.5') protobuf = os.path.join('3rdparty', 'protobuf-3.5.0') diff --git a/support/mesos-tidy/entrypoint.sh b/support/mesos-tidy/entrypoint.sh index 0d584b8..a840867 100755 --- a/support/mesos-tidy/entrypoint.sh +++ b/support/mesos-tidy/entrypoint.sh @@ -37,7 +37,7 @@ cmake -DCMAKE_BUILD_TYPE=Release \ # TODO(mpark): Use an external dependencies target once MESOS-6924 is resolved. cmake --build 3rdparty --target boost-1.65.0 -- -j $(nproc) cmake --build 3rdparty --target elfio-3.2 -- -j $(nproc) -cmake --build 3rdparty --target glog-0.3.3 -- -j $(nproc) +cmake --build 3rdparty --target glog-0.4.0 -- -j $(nproc) cmake --build 3rdparty --target googletest-1.8.0 -- -j $(nproc) cmake --build 3rdparty --target grpc-1.10.0 -- -j $(nproc) cmake --build 3rdparty --target http_parser-2.6.2 -- -j $(nproc)
