From patchwork Fri Feb 10 14:48:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 140664 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 77DC6B6EF7 for ; Sat, 11 Feb 2012 01:49:18 +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=1329490159; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Cc:Subject:References:Date:In-Reply-To: Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=VZ2DW/8Q3QA/SUADG+9QQyn+yyA=; b=tf0hmSBkNi9LiVQ1DCAEfZtioYD8ArrWEVrb25GNsWID/VZWufymZBzdh2D7B1 IePh7lTD0Ku9clM28xDnVUUIjlqoIQkBJLkwnKM+16+vvDJqap+RbVQKDD0Mtp+O Yqc5K13LqsDS+SvshDh0xohUeRJHD3+ovEjtp1jCMjRXg= 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:Received:Received:Received:From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:User-Agent:MIME-Version:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=upWCx44HqOfY3oUZFIE0bwtAkf8v8brq6zfj29SeUidlU4uOSxHamlHdOEYf3R klWMIrhT9N8nnMIO4PfVUENEKqI6SYsa39/c0P7NH2VITEqHM/bsml5Wed2Nj06M PqZjtjg/rS3EjlELlTODpK+KSon3NaixZZn2IGWbppFlY=; Received: (qmail 20856 invoked by alias); 10 Feb 2012 14:49:14 -0000 Received: (qmail 20844 invoked by uid 22791); 10 Feb 2012 14:49:12 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Feb 2012 14:48:58 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 1EB23CEB; Fri, 10 Feb 2012 15:48:57 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TbRB37c9AxCc; Fri, 10 Feb 2012 15:48:53 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id BB095CEA; Fri, 10 Feb 2012 15:48:53 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id q1AEmr9E008530; Fri, 10 Feb 2012 15:48:53 +0100 (MET) From: Rainer Orth To: Jonathan Wakely Cc: Mike Stump , gcc-patches Subject: Re: Gthreads patch to disable static initializer macros References: Date: Fri, 10 Feb 2012 15:48:53 +0100 In-Reply-To: (Jonathan Wakely's message of "Tue, 7 Feb 2012 10:55:01 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes 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 Jonathan Wakely writes: > On 6 February 2012 19:24, Mike Stump wrote: >> On Feb 5, 2012, at 12:26 PM, Jonathan Wakely wrote: >>> PRs libstdc++/51296 and libstdc++/51906 are both caused by problems >>> with the Pthreads static initializer macros such as >>> PTHREAD_MUTEX_INITIALIZER. >> >>> On Mac OS X 10.7 the PTHREAD_RECURSIVE_MUTEX_INITIALIZER is buggy. >> >> Thanks for all you work on this. > > Well I broke it so I had to fix it ;) > > I'm pleased to say we should now have an almost complete C++11 thread > implementation for most POSIX platforms, with hundreds of existing > libstdc++ tests moving from UNSUPPORTED to PASS on some secondary > platforms (aix and darwin, maybe hpux too.) Indeed, thanks for your hard work on this. The following patch on top of your previous one allows the 30_threads tests to PASS on Tru64 UNIX. Bootstrapped without regressions on alpha-dec-osf5.1b, ok for mainline? I've also noticed one feature of your patch that I don't like: __GTHREAD_{MUTEX,COND}_INIT_FUNCTION ignore the return values of pthread_{mutex,cond}_init_function instead of passing them on as all other gthr-posix.h functions do. This might lead to bad error handling, and my previous patch (based on an older version of yours you had attached to the PR) changed them to return int instead. I suppose changing this now is out of question, and this is left as 4.8 material. Rainer 2012-02-03 Rainer Orth libstdc++-v3: PR libstdc++/51296 * config/os/osf/ctype_base.h, config/os/osf/ctype_configure_char.cc, config/os/osf/ctype_inline.h, config/os/osf/error_constants.h: Copy from config/os/generic. * config/os/osf/os_defines.h: Likewise. (_GTHREAD_USE_MUTEX_INIT_FUNC, _GTHREAD_USE_COND_INIT_FUNC): Define. * configure.host : Use os/osf for os_include_dir. # HG changeset patch # Parent badf67959a1e06e2f8c98df3797878e3123aad8e Use __GTHREAD_MUTEX_INIT_FUNCTION on Tru64 UNIX (PR libstdc++/51296) diff --git a/libstdc++-v3/config/os/generic/ctype_base.h b/libstdc++-v3/config/os/osf/ctype_base.h copy from libstdc++-v3/config/os/generic/ctype_base.h copy to libstdc++-v3/config/os/osf/ctype_base.h diff --git a/libstdc++-v3/config/os/generic/ctype_configure_char.cc b/libstdc++-v3/config/os/osf/ctype_configure_char.cc copy from libstdc++-v3/config/os/generic/ctype_configure_char.cc copy to libstdc++-v3/config/os/osf/ctype_configure_char.cc diff --git a/libstdc++-v3/config/os/generic/ctype_inline.h b/libstdc++-v3/config/os/osf/ctype_inline.h copy from libstdc++-v3/config/os/generic/ctype_inline.h copy to libstdc++-v3/config/os/osf/ctype_inline.h diff --git a/libstdc++-v3/config/os/generic/error_constants.h b/libstdc++-v3/config/os/osf/error_constants.h copy from libstdc++-v3/config/os/generic/error_constants.h copy to libstdc++-v3/config/os/osf/error_constants.h diff --git a/libstdc++-v3/config/os/generic/os_defines.h b/libstdc++-v3/config/os/osf/os_defines.h copy from libstdc++-v3/config/os/generic/os_defines.h copy to libstdc++-v3/config/os/osf/os_defines.h --- a/libstdc++-v3/config/os/generic/os_defines.h +++ b/libstdc++-v3/config/os/osf/os_defines.h @@ -1,6 +1,6 @@ -// Specific definitions for generic platforms -*- C++ -*- +// Specific definitions for Tru64 UNIX -*- C++ -*- -// Copyright (C) 2000, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2000, 2009, 2010, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -33,4 +33,9 @@ // System-specific #define, typedefs, corrections, etc, go here. This // file will come before all others. +// Tru64 UNIX requires using pthread_mutex_init()/pthread_cond_init() to +// initialized non-statically allocated mutexes/condvars. +#define _GTHREAD_USE_MUTEX_INIT_FUNC +#define _GTHREAD_USE_COND_INIT_FUNC + #endif diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -280,7 +280,7 @@ case "${host_os}" in os_include_dir="os/bsd/netbsd" ;; osf*) - os_include_dir="os/generic" + os_include_dir="os/osf" # libstdc++.so relies on emutls on Tru64 UNIX, which only works with the # real functions implemented in libpthread.so, not with the dummies in # libgcc, so always pass -lpthread.