]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR libstdc++/54847 (--enable-libstdcxx-time=yes doesn't find the functio...
authorJack Howarth <howarth@bromo.med.uc.edu>
Tue, 16 Apr 2013 17:03:33 +0000 (17:03 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Tue, 16 Apr 2013 17:03:33 +0000 (17:03 +0000)
2013-04-15  Jack Howarth  <howarth@bromo.med.uc.edu>

Backport from mainline

2012-10-10  Jack Howarth  <howarth@bromo.med.uc.edu>
    Jonathan Wakely  <jwakely.gcc@gmail.com>

PR libstdc++/54847
* config/os/bsd/darwin/os_defines.h: Define _GLIBCXX_USE_NANOSLEEP
and _GLIBCXX_USE_SCHED_YIELD.
* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Add comment.

From-SVN: r198003

libstdc++-v3/ChangeLog
libstdc++-v3/acinclude.m4
libstdc++-v3/config/os/bsd/darwin/os_defines.h

index f1d01bd0282b006704f74a9c5e10dcb2ced3ad3e..ca0360049e557dfbf530a068f10d135dca492bf9 100644 (file)
@@ -1,3 +1,15 @@
+2013-04-15  Jack Howarth  <howarth@bromo.med.uc.edu>
+
+       Backport from mainline
+
+       2012-10-10  Jack Howarth  <howarth@bromo.med.uc.edu>
+                   Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       PR libstdc++/54847
+       * config/os/bsd/darwin/os_defines.h: Define _GLIBCXX_USE_NANOSLEEP
+       and _GLIBCXX_USE_SCHED_YIELD.
+       * acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Add comment.
+
 2013-04-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * testsuite/30_threads/condition_variable/members/53841.cc: Add
index 319e32784ff64bdad86cd8fc764bfcad7815a324..87d3b8a06c283bf23c948578cd05033a1a5e0501 100644 (file)
@@ -1132,6 +1132,11 @@ dnl --enable-libstdcxx-time=no
 dnl --disable-libstdcxx-time
 dnl        disables the checks completely
 dnl
+dnl N.B. Darwin provides nanosleep but doesn't support the whole POSIX
+dnl Timers option, so doesn't define _POSIX_TIMERS. Because the test
+dnl below fails Darwin unconditionally defines _GLIBCXX_USE_NANOSLEEP in
+dnl os_defines.h and also defines _GLIBCXX_USE_SCHED_YIELD.
+dnl
 AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
 
   AC_MSG_CHECKING([for clock_gettime, nanosleep and sched_yield])
index 421478d82d46e25a46b48ea9a781d7affbab1a7b..be4aa149e21675bb2a4a210679c4d1400dafd099 100644 (file)
@@ -42,4 +42,9 @@
 // Static initializer macro is buggy in darwin, see libstdc++/51906
 #define _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC
 
+// Configure checks for nanosleep fail on Darwin, but nanosleep and
+// sched_yield are always available, so use them.
+#define _GLIBCXX_USE_NANOSLEEP 1
+#define _GLIBCXX_USE_SCHED_YIELD 1
+
 #endif