diff mbox

Default to --enable-libstdcxx-time=auto

Message ID 20130524150357.GX1377@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek May 24, 2013, 3:03 p.m. UTC
On Fri, May 24, 2013 at 03:29:43PM +0100, Jonathan Wakely wrote:
> >> in the latter).  And there is no conversion in between the two.
> >>
> >> Perhaps I'd have to do something like:
> >>   return time_point(system_clock::now().time_since_epoch());
> >> ?  Can try that.
> >
> > Ah, but the duration can be different depending on macros.
> 
> You can convert between durations: with duration_cast:
> 
> return time_point(duration_cast<duration>(system_clock::now().time_since_epoch()));

Actually return time_point(system_clock::now().time_since_epoch());
seems to work too, there is a ctor for that:
        template<typename _Rep2, typename _Period2, typename = typename
               enable_if<treat_as_floating_point<rep>::value
                         || (ratio_divide<_Period2, period>::den == 1
                             && !treat_as_floating_point<_Rep2>::value)>::type>
          constexpr duration(const duration<_Rep2, _Period2>& __d)
          : __r(duration_cast<duration>(__d).count()) { }
I've tried a configuration where system_clock::now() used gettimeofday
and system_clock duration was in microseconds and steady_clock was
the non-steady one, but with nanoseconds resolution, and system_clock::now()
then contains
        call    gettimeofday
        movq    (%rsp), %rax
        imulq   $1000000, %rax, %rax
        addq    8(%rsp), %rax
(1000000 * tv.tv_sec + tv.tv_usec) and steady_clock::now()
        call    _ZNSt6chrono12system_clock3nowEv
        imulq   $1000, %rax, %rax
so it converts correctly.

So, adjusted patches attached, ok for trunk/4.8 if they pass
bootstrap/regtest?  Guess Rainer will need to on top of that adjust
Solaris baseline_symbols.txt files.

	Jakub
2013-05-24  Jakub Jelinek  <jakub@redhat.com>

	* src/c++11/chrono.cc: If _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL,
	include unistd.h and sys/syscall.h.  If _GLIBCXX_COMPATIBILITY_CXX0X,
	don't define system_clock::is_steady, system_clock::now() and
	steady_clock::is_steady.
	(std::chrono::system_clock::now()): If
	_GLIBCXX_USE_CLOCK_GETTIME_SYSCALL, call
	syscall (SYS_clock_gettime, ...) instead of clock_gettime (...).
	(std::chrono::system_clock::now()): Likewise.  Add weak attribute
	if _GLIBCXX_COMPATIBILITY_CXX0X and compatibility-chrono.cc will
	be non-empty.
	* src/Makefile.am (cxx11_sources): Add compatibility-chrono.cc.
	(compatibility-chrono.lo, compatibility-chrono.o): New goals.
	* src/c++11/compatibility-chrono.cc: New file.
	* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): On linux*, check for
	syscall (SYS_clock_gettime, CLOCK_MONOTONIC, &tp).
	* testsuite/util/testsuite_abi.cc (check_version): Add
	GLIBCXX_3.4.20 version and make it the latest.
	* config/abi/pre/gnu.ver (_ZNSt6chrono12steady_clock3nowEv): Export
	also @@GLIBCXX_3.4.19.  Move all symbols so far added for GCC 4.9 to
	@@GLIBCXX_3.4.20 instead.
	* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Regenerated.
	* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Regenerated.
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt:
	Regenerated.
	* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt:
	Regenerated.
	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Regenerated.
	* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt:
	Regenerated.
	* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Regenerated.
	* config/abi/post/s390-linux-gnu/baseline_symbols.txt: Regenerated.
	* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Regenerated.
	* config.h.in: Regenerated.
	* src/Makefile.in: Regenerated.
	* configure: Regenerated.
2013-05-24  Jakub Jelinek  <jakub@redhat.com>

	* src/c++11/chrono.cc: If _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL,
	include unistd.h and sys/syscall.h.  If _GLIBCXX_COMPATIBILITY_CXX0X,
	don't define system_clock::is_steady, system_clock::now() and
	steady_clock::is_steady.
	(std::chrono::system_clock::now()): If
	_GLIBCXX_USE_CLOCK_GETTIME_SYSCALL, call
	syscall (SYS_clock_gettime, ...) instead of clock_gettime (...).
	(std::chrono::system_clock::now()): Likewise.  Add weak attribute
	if _GLIBCXX_COMPATIBILITY_CXX0X and compatibility-chrono.cc will
	be non-empty.
	* src/Makefile.am (cxx11_sources): Add compatibility-chrono.cc.
	(compatibility-chrono.lo, compatibility-chrono.o): New goals.
	* src/c++11/compatibility-chrono.cc: New file.
	* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): On linux*, check for
	syscall (SYS_clock_gettime, CLOCK_MONOTONIC, &tp).
	* testsuite/util/testsuite_abi.cc (check_version): Add
	GLIBCXX_3.4.19 version and make it the latest.
	* config/abi/pre/gnu.ver (_ZNSt6chrono12steady_clock3nowEv): Export
	also @@GLIBCXX_3.4.19.
	* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Regenerated.
	* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Regenerated.
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt:
	Regenerated.
	* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt:
	Regenerated.
	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Regenerated.
	* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt:
	Regenerated.
	* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Regenerated.
	* config/abi/post/s390-linux-gnu/baseline_symbols.txt: Regenerated.
	* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Regenerated.
	* config.h.in: Regenerated.
	* src/Makefile.in: Regenerated.
	* configure: Regenerated.

--- libstdc++-v3/src/c++11/chrono.cc.jj	2013-03-16 08:07:57.000000000 +0100
+++ libstdc++-v3/src/c++11/chrono.cc	2013-05-23 15:33:07.238690149 +0200
@@ -22,7 +22,20 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
+#include <bits/c++config.h>
+
+#ifndef _GLIBCXX_USE_CLOCK_MONOTONIC
+// If !_GLIBCXX_USE_CLOCK_MONOTONIC, std::chrono::steady_clock
+// is just a typedef to std::chrono::system_clock, for ABI compatibility
+// force it not to be a typedef now and export it anyway.  Programs
+// using the headers where it is a typedef will actually just use
+// std::chrono::system_clock instead, and this remains here just as a fallback.
+#define _GLIBCXX_USE_CLOCK_MONOTONIC
+#include <chrono>
+#undef _GLIBCXX_USE_CLOCK_MONOTONIC
+#else
 #include <chrono>
+#endif
 
 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
 
@@ -32,13 +45,18 @@
      defined(_GLIBCXX_USE_GETTIMEOFDAY)
 #include <sys/time.h>
 #endif
+#ifdef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL
+#include <unistd.h>
+#include <sys/syscall.h>
+#endif
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
   namespace chrono
   {
   _GLIBCXX_BEGIN_NAMESPACE_VERSION
- 
+
+#ifndef _GLIBCXX_COMPATIBILITY_CXX0X
     constexpr bool system_clock::is_steady;
 
     system_clock::time_point
@@ -47,7 +65,11 @@ namespace std _GLIBCXX_VISIBILITY(defaul
 #ifdef _GLIBCXX_USE_CLOCK_REALTIME
       timespec tp;
       // -EINVAL, -EFAULT
+#ifdef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL
+      syscall(SYS_clock_gettime, CLOCK_REALTIME, &tp);
+#else
       clock_gettime(CLOCK_REALTIME, &tp);
+#endif
       return time_point(duration(chrono::seconds(tp.tv_sec)
 				 + chrono::nanoseconds(tp.tv_nsec)));
 #elif defined(_GLIBCXX_USE_GETTIMEOFDAY)
@@ -61,20 +83,35 @@ namespace std _GLIBCXX_VISIBILITY(defaul
       return system_clock::from_time_t(__sec);
 #endif
     }
+#endif
     
-#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
+#ifndef _GLIBCXX_COMPATIBILITY_CXX0X
     constexpr bool steady_clock::is_steady;
+#endif
 
+#if defined(_GLIBCXX_SYMVER_GNU) && defined(_GLIBCXX_SHARED) \
+    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \
+    && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) \
+    && !defined(_GLIBCXX_COMPATIBILITY_CXX0X)
+    __attribute__((__weak__))
+#endif
     steady_clock::time_point
     steady_clock::now() noexcept
     {
+#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
       timespec tp;
       // -EINVAL, -EFAULT
+#ifdef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL
+      syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &tp);
+#else
       clock_gettime(CLOCK_MONOTONIC, &tp);
+#endif
       return time_point(duration(chrono::seconds(tp.tv_sec)
 				 + chrono::nanoseconds(tp.tv_nsec)));
-    }
+#else
+      return time_point(system_clock::now().time_since_epoch());
 #endif
+    }
 
   _GLIBCXX_END_NAMESPACE_VERSION
   } // namespace chrono
--- libstdc++-v3/src/Makefile.am.jj	2013-03-22 15:05:13.000000000 +0100
+++ libstdc++-v3/src/Makefile.am	2013-05-23 15:18:13.030217244 +0200
@@ -50,7 +50,8 @@ cxx98_sources = \
 cxx11_sources = \
 	compatibility-c++0x.cc \
 	compatibility-atomic-c++0x.cc \
-	compatibility-thread-c++0x.cc
+	compatibility-thread-c++0x.cc \
+	compatibility-chrono.cc
 
 libstdc___la_SOURCES = $(cxx98_sources) $(cxx11_sources)
 
@@ -97,6 +98,11 @@ compatibility-thread-c++0x.lo: compatibi
 compatibility-thread-c++0x.o: compatibility-thread-c++0x.cc
 	$(CXXCOMPILE) -std=gnu++11 -c $<
 
+compatibility-chrono.lo: compatibility-chrono.cc
+	$(LTCXXCOMPILE) -std=gnu++11 -c $<
+compatibility-chrono.o: compatibility-chrono.cc
+	$(CXXCOMPILE) -std=gnu++11 -c $<
+
 # A note on compatibility and static libraries.
 # 
 # static lib == linked against only this version, should not need compat
--- libstdc++-v3/src/c++11/compatibility-chrono.cc.jj	2013-05-23 15:05:13.907962675 +0200
+++ libstdc++-v3/src/c++11/compatibility-chrono.cc	2013-05-23 15:33:07.238690149 +0200
@@ -0,0 +1,58 @@
+// Compatibility symbols for previous versions, C++0x bits -*- C++ -*-
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library 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 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+#define _GLIBCXX_COMPATIBILITY_CXX0X
+#include <bits/c++config.h>
+
+#if defined(_GLIBCXX_SYMVER_GNU) && defined(_GLIBCXX_SHARED) \
+    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)\
+    && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
+
+#define steady_clock steady_clockXX
+#include "chrono.cc"
+
+// The rename syntax for default exported names is
+//   asm (".symver name1,exportedname@GLIBCXX_3.4.17")
+//   asm (".symver name2,exportedname@@GLIBCXX_3.4.19")
+// In the future, GLIBCXX_ABI > 6 should remove all uses of
+// _GLIBCXX_*_SYMVER macros in this file.
+
+#define _GLIBCXX_3_4_17_SYMVER(XXname, name) \
+   extern "C" void \
+   _X##name() \
+   __attribute__ ((alias(#XXname))); \
+   asm (".symver " "_X" #name "," #name "@GLIBCXX_3.4.17");
+
+#define _GLIBCXX_3_4_19_SYMVER(XXname, name) \
+   extern "C" void \
+   _Y##name() \
+   __attribute__ ((alias(#XXname))); \
+   asm (".symver " "_Y" #name  "," #name "@@GLIBCXX_3.4.19");
+
+_GLIBCXX_3_4_17_SYMVER(_ZNSt6chrono14steady_clockXX3nowEv,
+		       _ZNSt6chrono12steady_clock3nowEv)
+_GLIBCXX_3_4_19_SYMVER(_ZNSt6chrono14steady_clockXX3nowEv,
+		       _ZNSt6chrono12steady_clock3nowEv)
+
+#endif
--- libstdc++-v3/acinclude.m4.jj	2013-04-10 08:32:08.000000000 +0200
+++ libstdc++-v3/acinclude.m4	2013-05-23 14:13:34.546224986 +0200
@@ -1274,6 +1274,31 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME]
     fi
   fi
 
+  if test x"$ac_has_clock_monotonic" != x"yes"; then
+    case ${target_os} in
+      linux*)
+	AC_MSG_CHECKING([for clock_gettime syscall])
+	AC_TRY_COMPILE(
+	  [#include <unistd.h>
+	   #include <time.h>
+	   #include <sys/syscall.h>
+	  ],
+	  [#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK)
+	    timespec tp;
+	   #endif
+	   syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &tp);
+	   syscall(SYS_clock_gettime, CLOCK_REALTIME, &tp);
+	  ], [ac_has_clock_monotonic_syscall=yes], [ac_has_clock_monotonic_syscall=no])
+	AC_MSG_RESULT($ac_has_clock_monotonic_syscall)
+	if test x"$ac_has_clock_monotonic_syscall" = x"yes"; then
+	  AC_DEFINE(_GLIBCXX_USE_CLOCK_GETTIME_SYSCALL, 1,
+	  [ Defined if clock_gettime syscall has monotonic and realtime clock support. ])
+	  ac_has_clock_monotonic=yes
+	  ac_has_clock_realtime=yes
+	fi;;
+    esac
+  fi
+
   if test x"$ac_has_clock_monotonic" = x"yes"; then
     AC_DEFINE(_GLIBCXX_USE_CLOCK_MONOTONIC, 1,
       [ Defined if clock_gettime has monotonic clock support. ])
--- libstdc++-v3/testsuite/util/testsuite_abi.cc.jj	2013-03-16 08:09:29.000000000 +0100
+++ libstdc++-v3/testsuite/util/testsuite_abi.cc	2013-05-23 15:37:48.226285549 +0200
@@ -195,6 +195,7 @@ check_version(symbol& test, bool added)
       known_versions.push_back("GLIBCXX_3.4.16");
       known_versions.push_back("GLIBCXX_3.4.17");
       known_versions.push_back("GLIBCXX_3.4.18");
+      known_versions.push_back("GLIBCXX_3.4.19");
       known_versions.push_back("GLIBCXX_LDBL_3.4");
       known_versions.push_back("GLIBCXX_LDBL_3.4.7");
       known_versions.push_back("GLIBCXX_LDBL_3.4.10");
@@ -223,7 +224,7 @@ check_version(symbol& test, bool added)
 	test.version_status = symbol::incompatible;
 
       // Check that added symbols are added in the latest pre-release version.
-      bool latestp = (test.version_name == "GLIBCXX_3.4.18"
+      bool latestp = (test.version_name == "GLIBCXX_3.4.19"
 		     || test.version_name == "CXXABI_1.3.7"
 		     || test.version_name == "CXXABI_TM_1");
       if (added && !latestp)
--- libstdc++-v3/config/abi/pre/gnu.ver.jj	2013-03-16 08:09:38.000000000 +0100
+++ libstdc++-v3/config/abi/pre/gnu.ver	2013-05-23 15:29:15.511112789 +0200
@@ -1303,9 +1303,6 @@ GLIBCXX_3.4.17 {
     _ZN11__gnu_debug25_Safe_local_iterator_base9_M_attachEPNS_19_Safe_sequence_baseEb;
     _ZN11__gnu_debug25_Safe_local_iterator_base9_M_detachEv;
 
-    # std::chrono::steady_clock::now()
-    _ZNSt6chrono12steady_clock3nowEv;
-
     # std::numeric_limits<__int128> and <unsigned __int128>
     _ZNSt14numeric_limitsInE*;
     _ZNSt14numeric_limitsIoE*;
@@ -1323,6 +1320,12 @@ GLIBCXX_3.4.17 {
     _ZNSt13__future_base19_Async_state_commonD1Ev;
     _ZNSt13__future_base19_Async_state_commonD2Ev;
 
+#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
+   # GLIBCXX_ABI compatibility only.
+    # std::chrono::steady_clock::now()
+    _ZNSt6chrono12steady_clock3nowEv;
+#endif
+
 } GLIBCXX_3.4.16;
 
 GLIBCXX_3.4.18 {
@@ -1344,6 +1347,13 @@ GLIBCXX_3.4.18 {
 
 } GLIBCXX_3.4.17;
 
+GLIBCXX_3.4.19 {
+
+    # std::chrono::steady_clock::now()
+    _ZNSt6chrono12steady_clock3nowEv;
+
+} GLIBCXX_3.4.18;
+
 # Symbols in the support library (libsupc++) have their own tag.
 CXXABI_1.3 {
 
--- libstdc++-v3/config/abi/post/i386-linux-gnu/baseline_symbols.txt.jj	2013-03-16 08:09:37.423570786 +0100
+++ libstdc++-v3/config/abi/post/i386-linux-gnu/baseline_symbols.txt	2013-05-23 15:43:37.846877915 +0200
@@ -1938,6 +1938,8 @@ FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2514,6 +2516,7 @@ OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/s390x-linux-gnu/baseline_symbols.txt.jj	2013-03-16 08:09:36.882574033 +0100
+++ libstdc++-v3/config/abi/post/s390x-linux-gnu/baseline_symbols.txt	2013-05-23 15:45:51.432944873 +0200
@@ -2128,6 +2128,8 @@ FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2748,6 +2750,7 @@ OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt.jj	2013-03-16 08:09:37.648569439 +0100
+++ libstdc++-v3/config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt	2013-05-23 15:45:08.736291429 +0200
@@ -2128,6 +2128,8 @@ FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2748,6 +2750,7 @@ OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt.jj	2013-03-16 08:09:37.489570393 +0100
+++ libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt	2013-05-23 15:45:13.783372530 +0200
@@ -2128,6 +2128,8 @@ FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2748,6 +2750,7 @@ OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/x86_64-linux-gnu/baseline_symbols.txt.jj	2013-03-16 08:09:36.000000000 +0100
+++ libstdc++-v3/config/abi/post/x86_64-linux-gnu/baseline_symbols.txt	2013-05-23 15:41:27.344826481 +0200
@@ -1938,6 +1938,8 @@ FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2514,6 +2516,7 @@ OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt.jj	2013-03-16 08:09:35.000000000 +0100
+++ libstdc++-v3/config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt	2013-05-23 15:41:36.474966903 +0200
@@ -1938,6 +1938,8 @@ FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2514,6 +2516,7 @@ OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/powerpc-linux-gnu/baseline_symbols.txt.jj	2013-03-16 08:09:36.175578273 +0100
+++ libstdc++-v3/config/abi/post/powerpc-linux-gnu/baseline_symbols.txt	2013-05-23 15:44:36.216771955 +0200
@@ -2128,6 +2128,8 @@ FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2748,6 +2750,7 @@ OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/s390-linux-gnu/baseline_symbols.txt.jj	2013-03-16 08:09:35.702581217 +0100
+++ libstdc++-v3/config/abi/post/s390-linux-gnu/baseline_symbols.txt	2013-05-23 15:45:32.397667896 +0200
@@ -2128,6 +2128,8 @@ FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2748,6 +2750,7 @@ OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/i486-linux-gnu/baseline_symbols.txt.jj	2013-03-16 08:09:38.030567148 +0100
+++ libstdc++-v3/config/abi/post/i486-linux-gnu/baseline_symbols.txt	2013-05-23 15:43:55.152138816 +0200
@@ -1938,6 +1938,8 @@ FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2514,6 +2516,7 @@ OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config.h.in.jj	2013-04-10 08:32:08.000000000 +0200
+++ libstdc++-v3/config.h.in	2013-05-23 14:10:35.000000000 +0200
@@ -813,6 +813,9 @@
 /* Defined if clock_gettime has monotonic clock support. */
 #undef _GLIBCXX_USE_CLOCK_MONOTONIC
 
+/* Defined if clock_gettime syscall has monotonic and realtime clock support. */
+#undef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL
+
 /* Defined if clock_gettime has realtime clock support. */
 #undef _GLIBCXX_USE_CLOCK_REALTIME
 
--- libstdc++-v3/src/Makefile.in.jj	2013-03-22 15:05:13.000000000 +0100
+++ libstdc++-v3/src/Makefile.in	2013-05-23 15:19:26.341768018 +0200
@@ -93,7 +93,7 @@ am__DEPENDENCIES_1 =
 am__objects_2 = compatibility.lo compatibility-debug_list.lo \
 	compatibility-debug_list-2.lo $(am__objects_1)
 am__objects_3 = compatibility-c++0x.lo compatibility-atomic-c++0x.lo \
-	compatibility-thread-c++0x.lo
+	compatibility-thread-c++0x.lo compatibility-chrono.lo
 am_libstdc___la_OBJECTS = $(am__objects_2) $(am__objects_3)
 libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
@@ -351,7 +351,8 @@ cxx98_sources = \
 cxx11_sources = \
 	compatibility-c++0x.cc \
 	compatibility-atomic-c++0x.cc \
-	compatibility-thread-c++0x.cc
+	compatibility-thread-c++0x.cc \
+	compatibility-chrono.cc
 
 libstdc___la_SOURCES = $(cxx98_sources) $(cxx11_sources)
 libstdc___la_LIBADD = \
@@ -848,6 +849,11 @@ compatibility-thread-c++0x.lo: compatibi
 compatibility-thread-c++0x.o: compatibility-thread-c++0x.cc
 	$(CXXCOMPILE) -std=gnu++11 -c $<
 
+compatibility-chrono.lo: compatibility-chrono.cc
+	$(LTCXXCOMPILE) -std=gnu++11 -c $<
+compatibility-chrono.o: compatibility-chrono.cc
+	$(CXXCOMPILE) -std=gnu++11 -c $<
+
 # Symbol versioning for shared libraries.
 @ENABLE_SYMVERS_TRUE@libstdc++-symbols.ver:  ${glibcxx_srcdir}/$(SYMVER_FILE) \
 @ENABLE_SYMVERS_TRUE@		$(port_specific_symbol_files)
--- libstdc++-v3/configure.jj	2013-04-10 08:32:08.000000000 +0200
+++ libstdc++-v3/configure	2013-05-23 14:16:06.508039167 +0200
@@ -19828,6 +19828,48 @@ $as_echo "$ac_has_nanosleep" >&6; }
     fi
   fi
 
+  if test x"$ac_has_clock_monotonic" != x"yes"; then
+    case ${target_os} in
+      linux*)
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime syscall" >&5
+$as_echo_n "checking for clock_gettime syscall... " >&6; }
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+	   #include <time.h>
+	   #include <sys/syscall.h>
+
+int
+main ()
+{
+#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK)
+	    timespec tp;
+	   #endif
+	   syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &tp);
+	   syscall(SYS_clock_gettime, CLOCK_REALTIME, &tp);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_has_clock_monotonic_syscall=yes
+else
+  ac_has_clock_monotonic_syscall=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_clock_monotonic_syscall" >&5
+$as_echo "$ac_has_clock_monotonic_syscall" >&6; }
+	if test x"$ac_has_clock_monotonic_syscall" = x"yes"; then
+
+$as_echo "#define _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL 1" >>confdefs.h
+
+	  ac_has_clock_monotonic=yes
+	  ac_has_clock_realtime=yes
+	fi;;
+    esac
+  fi
+
   if test x"$ac_has_clock_monotonic" = x"yes"; then
 
 $as_echo "#define _GLIBCXX_USE_CLOCK_MONOTONIC 1" >>confdefs.h

Comments

Rainer Orth May 24, 2013, 3:09 p.m. UTC | #1
Jakub Jelinek <jakub@redhat.com> writes:

> So, adjusted patches attached, ok for trunk/4.8 if they pass
> bootstrap/regtest?  Guess Rainer will need to on top of that adjust
> Solaris baseline_symbols.txt files.

I meant to look into that, but usually I only update the baselines for
x.y.0 releases, not micro releases.  The addition of GLIBCXX_3.4.19
might justify an exception, though.

	Rainer
Jonathan Wakely May 24, 2013, 3:22 p.m. UTC | #2
On 24 May 2013 16:03, Jakub Jelinek wrote:
>
> So, adjusted patches attached, ok for trunk/4.8 if they pass
> bootstrap/regtest?

Yes, they're OK - thanks for sorting it out.
Jakub Jelinek May 24, 2013, 8:10 p.m. UTC | #3
On Fri, May 24, 2013 at 04:22:43PM +0100, Jonathan Wakely wrote:
> On 24 May 2013 16:03, Jakub Jelinek wrote:
> >
> > So, adjusted patches attached, ok for trunk/4.8 if they pass
> > bootstrap/regtest?
> 
> Yes, they're OK - thanks for sorting it out.

Note, I've already committed the patches, but further testing using
#include <chrono>
#include <unistd.h>

int
main()
{
  using namespace std::chrono;
  steady_clock::time_point t1 = steady_clock::now();
  sleep (2);
  steady_clock::time_point t2 = steady_clock::now();
  auto d1 = t1.time_since_epoch ();
  auto d2 = t2.time_since_epoch ();
  long long l1 = d1.count ();
  long long l2 = d1.zero ().count ();
  long long l3 = d1.min ().count ();
  long long l4 = d1.max ().count ();
  long long l5 = d2.count ();
  __builtin_printf ("%lld %lld %lld %lld %lld %lld\n", l1, l2, l3, l4, l5, l5 - l1);
  system_clock::time_point t3 = system_clock::now();
  sleep (2);
  system_clock::time_point t4 = system_clock::now();
  auto d3 = t3.time_since_epoch ();
  auto d4 = t4.time_since_epoch ();
  l1 = d3.count ();
  l2 = d3.zero ().count ();
  l3 = d3.min ().count ();
  l4 = d3.max ().count ();
  l5 = d4.count ();
  __builtin_printf ("%lld %lld %lld %lld %lld %lld\n", l1, l2, l3, l4, l5, l5 - l1);
  return 0;
}

seems to point at another possible serious ABI issue.

g++ 4.7 compiled, linked and run against:
1369424708027221 0 -9223372036854775808 9223372036854775807 1369424710027308 2000087
1369424710027397 0 -9223372036854775808 9223372036854775807 1369424712027522 2000125
g++ 4.8 head (with the patch) with
-	if test x"$ac_has_clock_monotonic_syscall" = x"yes"; then
+	if test x"$ac_has_clock_monotonic_syscall" = x"yesz"; then
in configure (thus, typedef system_clock steady_clock; plus
steady_clock::now() in libstdc++):
1369424714156881 0 -9223372036854775808 9223372036854775807 1369424716157039 2000158
1369424716157108 0 -9223372036854775808 9223372036854775807 1369424718157236 2000128
g++ 4.8 head (with the patch):
1421990971125719 0 -9223372036854775808 9223372036854775807 1421992971246052 2000120333
1369424821707660285 0 -9223372036854775808 9223372036854775807 1369424823707805952 2000145667
g++ 4.8 head compiled, but run against libstdc++ built with that configure hack:
1369424720776367000 0 -9223372036854775808 9223372036854775807 1369424722776515000 2000148000
1369424722776583 0 -9223372036854775808 9223372036854775807 1369424724776704 2000121
4.7 compiled, run against 4.8 head libstdc++.so:
1369425485748333050 0 -9223372036854775808 9223372036854775807 1369425487748453585 2000120535
1369425487748521770 0 -9223372036854775808 9223372036854775807 1369425489748695701 2000173931
4.7 compiled, run against 4.8 head with configure hack libstdc++.so:
1369425496792688 0 -9223372036854775808 9223372036854775807 1369425498792910 2000222
1369425498792966 0 -9223372036854775808 9223372036854775807 1369425500793089 2000123

So, there is a minor issue that what is std::chrono::steady_clock has
changed, if you say use it as a function parameter, it will mangle
differently before/after.  Guess not that big a deal, after all, C++11
support is still experimental, right?

But the more important issue is that std::chrono::system_clock broke,
code compiled against the old headers will assume
std::chrono::system_clock::duration is microseconds resolution on Linux,
while code compiled against the new headers will assume it is in
nanoseconds resolution.  That is because of:
#ifdef _GLIBCXX_USE_CLOCK_REALTIME
      typedef chrono::nanoseconds                               duration;
#elif defined(_GLIBCXX_USE_GETTIMEOFDAY)
      typedef chrono::microseconds                              duration;
#else
      typedef chrono::seconds                                   duration;
#endif

Thus, I'm afraid we can't ABI compatibly change either of these macros,
unless we e.g. keep old std::chrono::system_clock as is and introduce
std::chrono::__whatever::system_clock or whatever, that will be typedefed
as std::chrono::system_clock.  Is it a big issue if system_clock will have
just old resolution (usec) and =auto code is reverted to only tweak
steady_clock (aka. _GLIBCXX_USE_CLOCK_MONOTONIC) (then for 4.8 the change
would be just to drop
          ac_has_clock_realtime=yes
line from if test x"$ac_has_clock_monotonic_syscall" = x"yes"; then)?

Ugh, C++ and ABI doesn't go well together...

	Jakub
Jonathan Wakely May 25, 2013, 1:32 a.m. UTC | #4
On 24 May 2013 21:10, Jakub Jelinek wrote:
>
> So, there is a minor issue that what is std::chrono::steady_clock has
> changed, if you say use it as a function parameter, it will mangle
> differently before/after.  Guess not that big a deal, after all, C++11
> support is still experimental, right?

Right.

> But the more important issue is that std::chrono::system_clock broke,
> code compiled against the old headers will assume
> std::chrono::system_clock::duration is microseconds resolution on Linux,
> while code compiled against the new headers will assume it is in
> nanoseconds resolution.  That is because of:
> #ifdef _GLIBCXX_USE_CLOCK_REALTIME
>       typedef chrono::nanoseconds                               duration;
> #elif defined(_GLIBCXX_USE_GETTIMEOFDAY)
>       typedef chrono::microseconds                              duration;
> #else
>       typedef chrono::seconds                                   duration;
> #endif
>
> Thus, I'm afraid we can't ABI compatibly change either of these macros,
> unless we e.g. keep old std::chrono::system_clock as is and introduce
> std::chrono::__whatever::system_clock or whatever, that will be typedefed
> as std::chrono::system_clock.

Or use the new ABI attribute so the "new" system_clock mangles
differently to the "old" system_clock.

I prefer to break it though - if we're going to paint ourselves into a
corner and insist on compatibility with semi-functional previous
releases we should stop calling it "experimental".  Alternatively,
while we still call it experimental, let's fix it properly and get it
right.

>  Is it a big issue if system_clock will have
> just old resolution (usec) and =auto code is reverted to only tweak
> steady_clock (aka. _GLIBCXX_USE_CLOCK_MONOTONIC) (then for 4.8 the change
> would be just to drop
>           ac_has_clock_realtime=yes
> line from if test x"$ac_has_clock_monotonic_syscall" = x"yes"; then)?

IMHO yes, that's a big issue.  I believe most users are more
interested in system_clock than in steady_clock, and we should provide
a nanosecond-resolution system_clock if the OS supports it.


> Ugh, C++ and ABI doesn't go well together...

Yeah, this stuff's hard.  But I hope we can get a stable ABI for 4.9,
even if it's incompatible with previous releases.
diff mbox

Patch

--- libstdc++-v3/src/c++11/chrono.cc.jj	2013-02-04 18:15:15.078395533 +0100
+++ libstdc++-v3/src/c++11/chrono.cc	2013-05-23 18:06:40.562825017 +0200
@@ -22,7 +22,20 @@ 
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
+#include <bits/c++config.h>
+
+#ifndef _GLIBCXX_USE_CLOCK_MONOTONIC
+// If !_GLIBCXX_USE_CLOCK_MONOTONIC, std::chrono::steady_clock
+// is just a typedef to std::chrono::system_clock, for ABI compatibility
+// force it not to be a typedef now and export it anyway.  Programs
+// using the headers where it is a typedef will actually just use
+// std::chrono::system_clock instead, and this remains here just as a fallback.
+#define _GLIBCXX_USE_CLOCK_MONOTONIC
+#include <chrono>
+#undef _GLIBCXX_USE_CLOCK_MONOTONIC
+#else
 #include <chrono>
+#endif
 
 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
 
@@ -32,13 +45,18 @@ 
      defined(_GLIBCXX_USE_GETTIMEOFDAY)
 #include <sys/time.h>
 #endif
+#ifdef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL
+#include <unistd.h>
+#include <sys/syscall.h>
+#endif
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
   namespace chrono
   {
   _GLIBCXX_BEGIN_NAMESPACE_VERSION
- 
+
+#ifndef _GLIBCXX_COMPATIBILITY_CXX0X
     constexpr bool system_clock::is_steady;
 
     system_clock::time_point
@@ -47,7 +65,11 @@  namespace std _GLIBCXX_VISIBILITY(defaul
 #ifdef _GLIBCXX_USE_CLOCK_REALTIME
       timespec tp;
       // -EINVAL, -EFAULT
+#ifdef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL
+      syscall(SYS_clock_gettime, CLOCK_REALTIME, &tp);
+#else
       clock_gettime(CLOCK_REALTIME, &tp);
+#endif
       return time_point(duration(chrono::seconds(tp.tv_sec)
 				 + chrono::nanoseconds(tp.tv_nsec)));
 #elif defined(_GLIBCXX_USE_GETTIMEOFDAY)
@@ -61,20 +83,35 @@  namespace std _GLIBCXX_VISIBILITY(defaul
       return system_clock::from_time_t(__sec);
 #endif
     }
+#endif
     
-#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
+#ifndef _GLIBCXX_COMPATIBILITY_CXX0X
     constexpr bool steady_clock::is_steady;
+#endif
 
+#if defined(_GLIBCXX_SYMVER_GNU) && defined(_GLIBCXX_SHARED) \
+    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \
+    && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) \
+    && !defined(_GLIBCXX_COMPATIBILITY_CXX0X)
+    __attribute__((__weak__))
+#endif
     steady_clock::time_point
     steady_clock::now() noexcept
     {
+#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
       timespec tp;
       // -EINVAL, -EFAULT
+#ifdef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL
+      syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &tp);
+#else
       clock_gettime(CLOCK_MONOTONIC, &tp);
+#endif
       return time_point(duration(chrono::seconds(tp.tv_sec)
 				 + chrono::nanoseconds(tp.tv_nsec)));
-    }
+#else
+      return time_point(system_clock::now().time_since_epoch());
 #endif
+    }
 
   _GLIBCXX_END_NAMESPACE_VERSION
   } // namespace chrono
--- libstdc++-v3/src/Makefile.am.jj	2013-02-14 20:11:41.491575233 +0100
+++ libstdc++-v3/src/Makefile.am	2013-05-23 18:06:40.578824061 +0200
@@ -50,7 +50,8 @@  cxx98_sources = \
 cxx11_sources = \
 	compatibility-c++0x.cc \
 	compatibility-atomic-c++0x.cc \
-	compatibility-thread-c++0x.cc
+	compatibility-thread-c++0x.cc \
+	compatibility-chrono.cc
 
 libstdc___la_SOURCES = $(cxx98_sources) $(cxx11_sources)
 
@@ -97,6 +98,11 @@  compatibility-thread-c++0x.lo: compatibi
 compatibility-thread-c++0x.o: compatibility-thread-c++0x.cc
 	$(CXXCOMPILE) -std=gnu++11 -c $<
 
+compatibility-chrono.lo: compatibility-chrono.cc
+	$(LTCXXCOMPILE) -std=gnu++11 -c $<
+compatibility-chrono.o: compatibility-chrono.cc
+	$(CXXCOMPILE) -std=gnu++11 -c $<
+
 # A note on compatibility and static libraries.
 # 
 # static lib == linked against only this version, should not need compat
--- libstdc++-v3/src/c++11/compatibility-chrono.cc.jj	2013-05-23 18:06:40.585823828 +0200
+++ libstdc++-v3/src/c++11/compatibility-chrono.cc	2013-05-23 18:06:40.585823828 +0200
@@ -0,0 +1,58 @@ 
+// Compatibility symbols for previous versions, C++0x bits -*- C++ -*-
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library 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 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+#define _GLIBCXX_COMPATIBILITY_CXX0X
+#include <bits/c++config.h>
+
+#if defined(_GLIBCXX_SYMVER_GNU) && defined(_GLIBCXX_SHARED) \
+    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)\
+    && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
+
+#define steady_clock steady_clockXX
+#include "chrono.cc"
+
+// The rename syntax for default exported names is
+//   asm (".symver name1,exportedname@GLIBCXX_3.4.17")
+//   asm (".symver name2,exportedname@@GLIBCXX_3.4.19")
+// In the future, GLIBCXX_ABI > 6 should remove all uses of
+// _GLIBCXX_*_SYMVER macros in this file.
+
+#define _GLIBCXX_3_4_17_SYMVER(XXname, name) \
+   extern "C" void \
+   _X##name() \
+   __attribute__ ((alias(#XXname))); \
+   asm (".symver " "_X" #name "," #name "@GLIBCXX_3.4.17");
+
+#define _GLIBCXX_3_4_19_SYMVER(XXname, name) \
+   extern "C" void \
+   _Y##name() \
+   __attribute__ ((alias(#XXname))); \
+   asm (".symver " "_Y" #name  "," #name "@@GLIBCXX_3.4.19");
+
+_GLIBCXX_3_4_17_SYMVER(_ZNSt6chrono14steady_clockXX3nowEv,
+		       _ZNSt6chrono12steady_clock3nowEv)
+_GLIBCXX_3_4_19_SYMVER(_ZNSt6chrono14steady_clockXX3nowEv,
+		       _ZNSt6chrono12steady_clock3nowEv)
+
+#endif
--- libstdc++-v3/acinclude.m4.jj	2013-05-23 18:06:19.841949134 +0200
+++ libstdc++-v3/acinclude.m4	2013-05-23 18:06:40.586823808 +0200
@@ -1322,6 +1322,31 @@  AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME]
     fi
   fi
 
+  if test x"$ac_has_clock_monotonic" != x"yes"; then
+    case ${target_os} in
+      linux*)
+	AC_MSG_CHECKING([for clock_gettime syscall])
+	AC_TRY_COMPILE(
+	  [#include <unistd.h>
+	   #include <time.h>
+	   #include <sys/syscall.h>
+	  ],
+	  [#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK)
+	    timespec tp;
+	   #endif
+	   syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &tp);
+	   syscall(SYS_clock_gettime, CLOCK_REALTIME, &tp);
+	  ], [ac_has_clock_monotonic_syscall=yes], [ac_has_clock_monotonic_syscall=no])
+	AC_MSG_RESULT($ac_has_clock_monotonic_syscall)
+	if test x"$ac_has_clock_monotonic_syscall" = x"yes"; then
+	  AC_DEFINE(_GLIBCXX_USE_CLOCK_GETTIME_SYSCALL, 1,
+	  [ Defined if clock_gettime syscall has monotonic and realtime clock support. ])
+	  ac_has_clock_monotonic=yes
+	  ac_has_clock_realtime=yes
+	fi;;
+    esac
+  fi
+
   if test x"$ac_has_clock_monotonic" = x"yes"; then
     AC_DEFINE(_GLIBCXX_USE_CLOCK_MONOTONIC, 1,
       [ Defined if clock_gettime has monotonic clock support. ])
--- libstdc++-v3/testsuite/util/testsuite_abi.cc.jj	2013-05-10 10:36:28.000000000 +0200
+++ libstdc++-v3/testsuite/util/testsuite_abi.cc	2013-05-23 18:12:15.933965878 +0200
@@ -199,6 +199,7 @@  check_version(symbol& test, bool added)
       known_versions.push_back("GLIBCXX_3.4.17");
       known_versions.push_back("GLIBCXX_3.4.18");
       known_versions.push_back("GLIBCXX_3.4.19");
+      known_versions.push_back("GLIBCXX_3.4.20");
       known_versions.push_back("CXXABI_1.3");
       known_versions.push_back("CXXABI_LDBL_1.3");
       known_versions.push_back("CXXABI_1.3.1");
@@ -225,7 +226,7 @@  check_version(symbol& test, bool added)
 	test.version_status = symbol::incompatible;
 
       // Check that added symbols are added in the latest pre-release version.
-      bool latestp = (test.version_name == "GLIBCXX_3.4.19"
+      bool latestp = (test.version_name == "GLIBCXX_3.4.20"
 		     || test.version_name == "CXXABI_1.3.8"
 		     || test.version_name == "CXXABI_TM_1");
       if (added && !latestp)
--- libstdc++-v3/config/abi/pre/gnu.ver.jj	2013-05-10 10:36:28.640688086 +0200
+++ libstdc++-v3/config/abi/pre/gnu.ver	2013-05-23 18:11:51.087096178 +0200
@@ -1303,9 +1303,6 @@  GLIBCXX_3.4.17 {
     _ZN11__gnu_debug25_Safe_local_iterator_base9_M_attachEPNS_19_Safe_sequence_baseEb;
     _ZN11__gnu_debug25_Safe_local_iterator_base9_M_detachEv;
 
-    # std::chrono::steady_clock::now()
-    _ZNSt6chrono12steady_clock3nowEv;
-
     # std::numeric_limits<__int128> and <unsigned __int128>
     _ZNSt14numeric_limitsInE*;
     _ZNSt14numeric_limitsIoE*;
@@ -1323,6 +1320,12 @@  GLIBCXX_3.4.17 {
     _ZNSt13__future_base19_Async_state_commonD1Ev;
     _ZNSt13__future_base19_Async_state_commonD2Ev;
 
+#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
+   # GLIBCXX_ABI compatibility only.
+    # std::chrono::steady_clock::now()
+    _ZNSt6chrono12steady_clock3nowEv;
+#endif
+
 } GLIBCXX_3.4.16;
 
 GLIBCXX_3.4.18 {
@@ -1345,6 +1345,13 @@  GLIBCXX_3.4.18 {
 } GLIBCXX_3.4.17;
 
 GLIBCXX_3.4.19 {
+
+    # std::chrono::steady_clock::now()
+    _ZNSt6chrono12steady_clock3nowEv;
+
+} GLIBCXX_3.4.18;
+
+GLIBCXX_3.4.20 {
 
     # std::get_new_handler()
     _ZSt15get_new_handlerv;
@@ -1355,7 +1360,7 @@  GLIBCXX_3.4.19 {
     # std::get_unexpected()
     _ZSt14get_unexpectedv;
 
-} GLIBCXX_3.4.18;
+} GLIBCXX_3.4.19;
 
 # Symbols in the support library (libsupc++) have their own tag.
 CXXABI_1.3 {
--- libstdc++-v3/config/abi/post/i386-linux-gnu/baseline_symbols.txt.jj	2013-03-07 16:47:15.756981144 +0100
+++ libstdc++-v3/config/abi/post/i386-linux-gnu/baseline_symbols.txt	2013-05-23 18:06:40.635823435 +0200
@@ -1938,6 +1938,8 @@  FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2514,6 +2516,7 @@  OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/s390x-linux-gnu/baseline_symbols.txt.jj	2013-03-07 16:47:15.917980229 +0100
+++ libstdc++-v3/config/abi/post/s390x-linux-gnu/baseline_symbols.txt	2013-05-23 18:06:40.662823272 +0200
@@ -2128,6 +2128,8 @@  FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2748,6 +2750,7 @@  OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt.jj	2013-03-07 16:47:15.871980491 +0100
+++ libstdc++-v3/config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt	2013-05-23 18:06:40.689823108 +0200
@@ -2128,6 +2128,8 @@  FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2748,6 +2750,7 @@  OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt.jj	2013-03-07 16:47:15.847980627 +0100
+++ libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt	2013-05-23 18:06:40.717822939 +0200
@@ -2128,6 +2128,8 @@  FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2748,6 +2750,7 @@  OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/x86_64-linux-gnu/baseline_symbols.txt.jj	2013-03-07 16:47:16.001979751 +0100
+++ libstdc++-v3/config/abi/post/x86_64-linux-gnu/baseline_symbols.txt	2013-05-23 18:06:40.739822806 +0200
@@ -1938,6 +1938,8 @@  FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2514,6 +2516,7 @@  OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt.jj	2013-03-07 16:47:15.953980024 +0100
+++ libstdc++-v3/config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt	2013-05-23 18:06:40.763822661 +0200
@@ -1938,6 +1938,8 @@  FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2514,6 +2516,7 @@  OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/powerpc-linux-gnu/baseline_symbols.txt.jj	2013-03-07 16:47:15.884980416 +0100
+++ libstdc++-v3/config/abi/post/powerpc-linux-gnu/baseline_symbols.txt	2013-05-23 18:06:40.782822546 +0200
@@ -2128,6 +2128,8 @@  FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2748,6 +2750,7 @@  OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/s390-linux-gnu/baseline_symbols.txt.jj	2013-03-07 16:47:15.892980371 +0100
+++ libstdc++-v3/config/abi/post/s390-linux-gnu/baseline_symbols.txt	2013-05-23 18:06:40.792822486 +0200
@@ -2128,6 +2128,8 @@  FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EmRKSt8valarrayImES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2748,6 +2750,7 @@  OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config/abi/post/i486-linux-gnu/baseline_symbols.txt.jj	2013-03-07 16:47:15.807980856 +0100
+++ libstdc++-v3/config/abi/post/i486-linux-gnu/baseline_symbols.txt	2013-05-23 18:06:40.806822401 +0200
@@ -1938,6 +1938,8 @@  FUNC:_ZNSt6__norm15_List_node_base7rever
 FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
 FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
 FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono12steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono12steady_clock3nowEv@GLIBCXX_3.4.17
 FUNC:_ZNSt6gslice8_IndexerC1EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6gslice8_IndexerC2EjRKSt8valarrayIjES4_@@GLIBCXX_3.4
 FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2514,6 +2516,7 @@  OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
 OBJECT:0:GLIBCXX_3.4.17
 OBJECT:0:GLIBCXX_3.4.18
+OBJECT:0:GLIBCXX_3.4.19
 OBJECT:0:GLIBCXX_3.4.2
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
--- libstdc++-v3/config.h.in.jj	2013-04-10 08:32:04.601960092 +0200
+++ libstdc++-v3/config.h.in	2013-05-23 18:06:40.828822268 +0200
@@ -813,6 +813,9 @@ 
 /* Defined if clock_gettime has monotonic clock support. */
 #undef _GLIBCXX_USE_CLOCK_MONOTONIC
 
+/* Defined if clock_gettime syscall has monotonic and realtime clock support. */
+#undef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL
+
 /* Defined if clock_gettime has realtime clock support. */
 #undef _GLIBCXX_USE_CLOCK_REALTIME
 
--- libstdc++-v3/src/Makefile.in.jj	2013-02-14 20:11:41.438575540 +0100
+++ libstdc++-v3/src/Makefile.in	2013-05-23 18:06:40.844822172 +0200
@@ -93,7 +93,7 @@  am__DEPENDENCIES_1 =
 am__objects_2 = compatibility.lo compatibility-debug_list.lo \
 	compatibility-debug_list-2.lo $(am__objects_1)
 am__objects_3 = compatibility-c++0x.lo compatibility-atomic-c++0x.lo \
-	compatibility-thread-c++0x.lo
+	compatibility-thread-c++0x.lo compatibility-chrono.lo
 am_libstdc___la_OBJECTS = $(am__objects_2) $(am__objects_3)
 libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
@@ -351,7 +351,8 @@  cxx98_sources = \
 cxx11_sources = \
 	compatibility-c++0x.cc \
 	compatibility-atomic-c++0x.cc \
-	compatibility-thread-c++0x.cc
+	compatibility-thread-c++0x.cc \
+	compatibility-chrono.cc
 
 libstdc___la_SOURCES = $(cxx98_sources) $(cxx11_sources)
 libstdc___la_LIBADD = \
@@ -848,6 +849,11 @@  compatibility-thread-c++0x.lo: compatibi
 compatibility-thread-c++0x.o: compatibility-thread-c++0x.cc
 	$(CXXCOMPILE) -std=gnu++11 -c $<
 
+compatibility-chrono.lo: compatibility-chrono.cc
+	$(LTCXXCOMPILE) -std=gnu++11 -c $<
+compatibility-chrono.o: compatibility-chrono.cc
+	$(CXXCOMPILE) -std=gnu++11 -c $<
+
 # Symbol versioning for shared libraries.
 @ENABLE_SYMVERS_TRUE@libstdc++-symbols.ver:  ${glibcxx_srcdir}/$(SYMVER_FILE) \
 @ENABLE_SYMVERS_TRUE@		$(port_specific_symbol_files)
--- libstdc++-v3/configure.jj	2013-05-23 18:06:19.685950078 +0200
+++ libstdc++-v3/configure	2013-05-23 18:06:40.862822063 +0200
@@ -19883,6 +19883,48 @@  $as_echo "$ac_has_nanosleep" >&6; }
     fi
   fi
 
+  if test x"$ac_has_clock_monotonic" != x"yes"; then
+    case ${target_os} in
+      linux*)
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime syscall" >&5
+$as_echo_n "checking for clock_gettime syscall... " >&6; }
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+	   #include <time.h>
+	   #include <sys/syscall.h>
+
+int
+main ()
+{
+#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK)
+	    timespec tp;
+	   #endif
+	   syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &tp);
+	   syscall(SYS_clock_gettime, CLOCK_REALTIME, &tp);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_has_clock_monotonic_syscall=yes
+else
+  ac_has_clock_monotonic_syscall=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_clock_monotonic_syscall" >&5
+$as_echo "$ac_has_clock_monotonic_syscall" >&6; }
+	if test x"$ac_has_clock_monotonic_syscall" = x"yes"; then
+
+$as_echo "#define _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL 1" >>confdefs.h
+
+	  ac_has_clock_monotonic=yes
+	  ac_has_clock_realtime=yes
+	fi;;
+    esac
+  fi
+
   if test x"$ac_has_clock_monotonic" = x"yes"; then
 
 $as_echo "#define _GLIBCXX_USE_CLOCK_MONOTONIC 1" >>confdefs.h