diff options
author | Ben Cheng <bccheng@google.com> | 2013-08-05 15:18:29 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2013-08-05 16:03:48 -0700 |
commit | 32fce3edda831e36ee484406c39dffbe0230f257 (patch) | |
tree | 733b1b5398304b260a4ee3d5d9b17da5038c5486 /gcc-4.8/libstdc++-v3/acinclude.m4 | |
parent | e85b9ca2afe8edbb9fa99c6ce2cc4e52dce18c21 (diff) | |
download | toolchain_gcc-32fce3edda831e36ee484406c39dffbe0230f257.tar.gz toolchain_gcc-32fce3edda831e36ee484406c39dffbe0230f257.tar.bz2 toolchain_gcc-32fce3edda831e36ee484406c39dffbe0230f257.zip |
[4.8] Merge GCC 4.8.1
Change-Id: Ic8a60b7563f5172440fd40788605163a0cca6e30
Diffstat (limited to 'gcc-4.8/libstdc++-v3/acinclude.m4')
-rw-r--r-- | gcc-4.8/libstdc++-v3/acinclude.m4 | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gcc-4.8/libstdc++-v3/acinclude.m4 b/gcc-4.8/libstdc++-v3/acinclude.m4 index 0871a6a28..af0b23bde 100644 --- a/gcc-4.8/libstdc++-v3/acinclude.m4 +++ b/gcc-4.8/libstdc++-v3/acinclude.m4 @@ -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. ]) @@ -3660,6 +3685,36 @@ AC_DEFUN([GLIBCXX_ENABLE_WERROR], [ ]) +dnl +dnl Check to see if sys/sdt.h exists and that it is suitable for use. +dnl Some versions of sdt.h were not compatible with C++11. +dnl +AC_DEFUN([GLIBCXX_CHECK_SDT_H], [ + AC_MSG_RESULT([for suitable sys/sdt.h]) + # Note that this test has to be run with the C language. + # Otherwise, sdt.h will try to include some headers from + # libstdc++ itself. + AC_LANG_SAVE + AC_LANG_C + AC_CACHE_VAL(glibcxx_cv_sys_sdt_h, [ + # Because we have to run the test in C, we use grep rather + # than the compiler to check for the bug. The bug is that + # were strings without trailing whitespace, causing g++ + # to look for operator"". The pattern searches for the fixed + # output. + AC_EGREP_CPP([ \",\" ], [ + #include <sys/sdt.h> + int f() { STAP_PROBE(hi, bob); } + ], [glibcxx_cv_sys_sdt_h=yes], [glibcxx_cv_sys_sdt_h=no]) + ]) + AC_LANG_RESTORE + if test $glibcxx_cv_sys_sdt_h = yes; then + AC_DEFINE(HAVE_SYS_SDT_H, 1, + [Define to 1 if you have a suitable <sys/sdt.h> header file]) + fi + AC_MSG_RESULT($glibcxx_cv_sys_sdt_h) +]) + # Macros from the top-level gcc directory. m4_include([../config/gc++filt.m4]) m4_include([../config/tls.m4]) |