public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "howarth at nitro dot med.uc.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/54847] --enable-libstdcxx-time=yes non-functional on darwin
Date: Mon, 08 Oct 2012 13:47:00 -0000	[thread overview]
Message-ID: <bug-54847-4-TUgWstSgg1@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-54847-4@http.gcc.gnu.org/bugzilla/>


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54847

--- Comment #27 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-10-08 13:47:32 UTC ---
The unistd.h header on darwin12 defines...

#define _POSIX_TIMERS                   (-1)            /* [TMR] */

>From the documentation on --enable-libstdcxx-time...

dnl Check for clock_gettime, nanosleep and sched_yield, used in the
dnl implementation of 20.11.7 [time.clock], and 30.3.2 [thread.thread.this]
dnl in the C++11 standard.
dnl
dnl --enable-libstdcxx-time
dnl --enable-libstdcxx-time=yes
dnl        checks for the availability of monotonic and realtime clocks,
dnl        nanosleep and sched_yield in libc and libposix4 and, if needed,
dnl        links in the latter.
dnl --enable-libstdcxx-time=rt
dnl        also searches (and, if needed, links) librt.  Note that this is
dnl        not always desirable because, in glibc, for example, in turn it
dnl        triggers the linking of libpthread too, which activates locking,
dnl        a large overhead for single-thread programs.
dnl --enable-libstdcxx-time=no
dnl --disable-libstdcxx-time
dnl        disables the checks completely

it seems that --enable-libstdcxx-time defaults to 'no' which would seem to
imply that it is effectively --disable-libstdcxx-time. The
--enable-libstdcxx-time=yes check is too strict for darwin because it doesn't
handle the case of _POSIX_TIMER defined to -1 for testing pre-POSIX 2008
nanosleep(). What would you consider to be an acceptable change to the test
at...

      AC_MSG_CHECKING([for nanosleep])
      AC_TRY_LINK(
        [#include <unistd.h>
         #include <time.h>
        ],
        [#if _POSIX_TIMERS > 0
          timespec tp;
         #endif
          nanosleep(&tp, 0);
        ], [ac_has_nanosleep=yes], [ac_has_nanosleep=no])

      AC_MSG_RESULT($ac_has_nanosleep)

in libstdc++-v3/acinclude.m4 to solve this limitation? Again I would note that
short-circuiting this test for  _POSIX_TIMERS > 0 introduces no regressions in
the libstdc++-v3 test suite so the darwin nanosleep() appears to be sufficient.
Or is the libstdc++-v3 testsuite currently incapable of properly testing this
feature?


  parent reply	other threads:[~2012-10-08 13:47 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-07 16:11 [Bug libstdc++/54847] New: " howarth at nitro dot med.uc.edu
2012-10-07 17:31 ` [Bug libstdc++/54847] " paolo.carlini at oracle dot com
2012-10-07 17:40 ` jeremyhu at macports dot org
2012-10-07 18:02 ` paolo.carlini at oracle dot com
2012-10-07 18:35 ` jeremyhu at macports dot org
2012-10-07 18:51 ` howarth at nitro dot med.uc.edu
2012-10-07 18:54 ` howarth at nitro dot med.uc.edu
2012-10-07 19:04 ` jeremyhu at macports dot org
2012-10-07 19:22 ` howarth at nitro dot med.uc.edu
2012-10-07 19:38 ` jeremyhu at macports dot org
2012-10-07 19:43 ` howarth at nitro dot med.uc.edu
2012-10-07 20:11 ` howarth at nitro dot med.uc.edu
2012-10-07 22:17 ` howarth at nitro dot med.uc.edu
2012-10-07 22:29 ` howarth at nitro dot med.uc.edu
2012-10-07 22:51 ` jeremyhu at macports dot org
2012-10-07 23:03 ` paolo.carlini at oracle dot com
2012-10-07 23:07 ` jeremyhu at macports dot org
2012-10-07 23:14 ` roblu2184 at gmail dot com
2012-10-07 23:15 ` paolo.carlini at oracle dot com
2012-10-07 23:19 ` roblu2184 at gmail dot com
2012-10-07 23:26 ` jeremyhu at macports dot org
2012-10-07 23:33 ` paolo.carlini at oracle dot com
2012-10-08  3:48 ` jeremyhu at macports dot org
2012-10-08  9:26 ` paolo.carlini at oracle dot com
2012-10-08 10:06 ` redi at gcc dot gnu.org
2012-10-08 11:00 ` redi at gcc dot gnu.org
2012-10-08 11:17 ` redi at gcc dot gnu.org
2012-10-08 13:47 ` howarth at nitro dot med.uc.edu [this message]
2012-10-08 14:03 ` howarth at nitro dot med.uc.edu
2012-10-08 14:33 ` redi at gcc dot gnu.org
2012-10-08 14:47 ` redi at gcc dot gnu.org
2012-10-08 15:14 ` [Bug libstdc++/54847] --enable-libstdcxx-time=yes doesn't find the functional nanosleep() " howarth at nitro dot med.uc.edu
2012-10-08 15:31 ` howarth at nitro dot med.uc.edu
2012-10-08 15:55 ` redi at gcc dot gnu.org
2012-10-08 16:03 ` redi at gcc dot gnu.org
2012-10-08 16:31 ` howarth at nitro dot med.uc.edu
2012-10-08 16:45 ` howarth at nitro dot med.uc.edu
2012-10-08 16:48 ` [Bug libstdc++/54847] --enable-libstdcxx-time=yes doesn't find the function " redi at gcc dot gnu.org
2012-10-08 17:04 ` howarth at nitro dot med.uc.edu
2012-10-08 17:16 ` redi at gcc dot gnu.org
2012-10-08 18:33 ` jeremyhu at macports dot org
2012-10-08 19:50 ` redi at gcc dot gnu.org
2012-10-08 20:10 ` jeremyhu at macports dot org
2012-10-08 20:31 ` howarth at nitro dot med.uc.edu
2012-10-08 20:42 ` redi at gcc dot gnu.org
2012-10-08 22:27 ` howarth at nitro dot med.uc.edu
2012-10-09  0:46 ` howarth at nitro dot med.uc.edu
2012-10-10 23:20 ` redi at gcc dot gnu.org
2012-11-06 11:35 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-54847-4-TUgWstSgg1@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).