From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26482 invoked by alias); 8 Oct 2012 13:47:52 -0000 Received: (qmail 26405 invoked by uid 48); 8 Oct 2012 13:47:34 -0000 From: "howarth at nitro dot med.uc.edu" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: howarth at nitro dot med.uc.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg00680.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54847 --- Comment #27 from Jack Howarth 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 #include ], [#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?