From patchwork Wed Oct 10 23:09:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 190765 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3A4E42C0085 for ; Thu, 11 Oct 2012 10:09:52 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1350515393; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=om9lCoB1kJGSh75wSKnDVuj5uXc=; b=rzytKGwqAywrqYO0YxypiX6aVKxtaoavCiWoTy0fJA5mBKKjAk8Xu4Rf+OwJP/ eKApkFr5I+eucE0VdLHYj12xbf9Xle+mj/TZC0QeF55rF+vb5whK9bUMF1xtrQET MqoiwZFOCOdz6vsryQMB2X0CMFgP+ifBVvoE2sAPMrPc8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=mP6FMPZmm+ssQNmN61RXwNxJPG3kpMXz4F/u2iVZUsxEeVlQM9gJ1sM9UljqDC P4g0s9x2slBHW0V0F4YD8kQ7UuNQFKWrUDNO+dbYJauvvgC/ZKRmHOXpa7xiwm9D tLUsgQm6JBOy+Q+xNMmBCKuaSXFuh6c2Yt5p3bV65ex9Y=; Received: (qmail 24838 invoked by alias); 10 Oct 2012 23:09:47 -0000 Received: (qmail 24823 invoked by uid 22791); 10 Oct 2012 23:09:46 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_CX, TW_DC X-Spam-Check-By: sourceware.org Received: from mail-ie0-f175.google.com (HELO mail-ie0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Oct 2012 23:09:43 +0000 Received: by mail-ie0-f175.google.com with SMTP id c13so2157764ieb.20 for ; Wed, 10 Oct 2012 16:09:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.155.193 with SMTP id vy1mr6960721igb.50.1349910582261; Wed, 10 Oct 2012 16:09:42 -0700 (PDT) Received: by 10.42.158.202 with HTTP; Wed, 10 Oct 2012 16:09:42 -0700 (PDT) In-Reply-To: <20121009104928.661c8c18@coso> References: <20121009003921.GA25678@bromo.med.uc.edu> <20121009104928.661c8c18@coso> Date: Thu, 11 Oct 2012 00:09:42 +0100 Message-ID: Subject: Re: [PATCH] revised fix for nanosleep check in GLIBCXX_ENABLE_LIBSTDCXX_TIME for darwin From: Jonathan Wakely To: Benjamin De Kosnik Cc: Jack Howarth , libstdc++@gcc.gnu.org, mikestump@comcast.net, iain@codesourcery.com, gcc-patches@gcc.gnu.org Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 9 October 2012 18:49, Benjamin De Kosnik wrote: > >> I don't like the sched_yield macro being set there because it's >> detected correctly by configure anyway, but I'm not going to labour >> that point any more. > > Indeed. Then somebody will waste hours in the future wondering why > configure says no but their TU says yes. > > At least a comment in the configure bits admitting defeat, people. Committed to trunk like so. commit 1616a77cdcdf619b1621265f33165cf6c74a3eed Author: Jonathan Wakely Date: Thu Oct 11 00:06:14 2012 +0100 2012-10-10 Jack Howarth Jonathan Wakely * config/os/bsd/darwin/os_defines.h: Define _GLIBCXX_USE_NANOSLEEP and _GLIBCXX_USE_SCHED_YIELD. * acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Add comment. diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 960bae3..c4cde86 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1158,6 +1158,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]) diff --git a/libstdc++-v3/config/os/bsd/darwin/os_defines.h b/libstdc++-v3/config/os/bsd/darwin/os_defines.h index 421478d..be4aa14 100644 --- a/libstdc++-v3/config/os/bsd/darwin/os_defines.h +++ b/libstdc++-v3/config/os/bsd/darwin/os_defines.h @@ -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