From patchwork Thu Jan 12 10:21:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 135607 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 13AF2B6EF7 for ; Thu, 12 Jan 2012 21:22:16 +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=1326968538; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Cc:Subject:Date: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=TCFvyiYXAnvqpM21f7lEXvskL8E=; b=wyCDU9Esnk879US gTpgwK+pIbtaPjYX2O+bJ2JlIjN0VOxJs6db0qTxEzoK6Aizbn70PDhtn8l2bSES zjEZWi/6dFD8I7YHSDYgk1dy5YAdu+Taxr2hmVfmjd05DoHrKgtconOrZwjK6WZw zcfvFYvEUB9/MGmS1U4mMj3UgskQ= 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:Date: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=LYHJAm+2vnAf9hBu4YwgeqW8ExRPrtqPkpXdwt1Jp4CoXbGJaHSw2B01B9ZbWK aJSVHjYBgytix/fb75/Rw4H0khuFToY9BLzUPANNum6b3McDXvLLI79J/5M2sIRe Usb3Vfa78i1TU5SXAlc/8EOlqo3+BCIKSI9dp0aE2d4zA=; Received: (qmail 6385 invoked by alias); 12 Jan 2012 10:22:06 -0000 Received: (qmail 6370 invoked by uid 22791); 12 Jan 2012 10:22:04 -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; Thu, 12 Jan 2012 10:21:51 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 3C22E19C; Thu, 12 Jan 2012 11:21:50 +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 iKNyisLacKfq; Thu, 12 Jan 2012 11:21:48 +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 F2F7519A; Thu, 12 Jan 2012 11:21:47 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id q0CALlcw011147; Thu, 12 Jan 2012 11:21:47 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org Subject: [v3] Link libstdc++ with -lpthread on IRIX 6 (PR target/47852) Date: Thu, 12 Jan 2012 11:21:47 +0100 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 When PR target/47852 was filed last year, it turned out that this seemed to be the same problem as PR target/45693 on Tru64 UNIX, i.e. stub implementations of pthread functions getting in the way, although I couldn't really figure out how this happens. Since the problem on IRIX didn't show up anywhere in the testsuite and seemed to be a weird corner case, I all but forgot about it. Recently, though, a couple of 30_threads testcases started to fail: FAIL: 30_threads/future/cons/move_assign.cc execution test FAIL: 30_threads/shared_future/cons/assign.cc execution test FAIL: 30_threads/shared_future/cons/move_assign.cc execution test like this: terminate called after throwing an instance of 'std::system_error' what(): Function not implemented Abort It turns out that __gthread_cond_broadcast in void condition_variable::notify_all() noexcept { int __e = __gthread_cond_broadcast(&_M_cond); // XXX not in spec // EINVAL if (__e) __throw_system_error(__e); } returns ENOSYS due to a stub for pthread_cond_broadcast in libc. Linking libstdc++.so with -lpthread fixes those tests. I've relinked libstdc++.so with -lpthread using the patch below and rerun the libstdc++-v3 testsuite, where all 3 testcases pass now. I'll include the patch in the next full mips-sgi-irix6.5 bootstrap this weekend. Ok for mainline if that passes? Thanks. Rainer 2011-02-25 Rainer Orth PR target/47852 * configure.host (irix6.5*): Add -lpthread to OPT_LDFLAGS. # HG changeset patch # Parent dc4f565925904068ffc3f7444fbc4f73ebfdcd07 Link libstdc++ with -lpthread on IRIX 6 (PR target/47852) diff -r dc4f56592590 libstdc++-v3/configure.host --- a/libstdc++-v3/configure.host Tue Feb 22 15:54:16 2011 +0000 +++ b/libstdc++-v3/configure.host Fri Feb 25 19:39:22 2011 +0100 @@ -252,6 +252,10 @@ os_include_dir="os/irix/irix6.5" atomicity_dir=os/irix atomic_word_dir=os/irix + # libstdc++.so relies on emutls on IRIX, which only works with the + # real functions implemented in libpthread.so, not with the stubs in + # libc, so always pass -lpthread. + OPT_LDFLAGS="${OPT_LDFLAGS} -lpthread" ;; mingw32*) os_include_dir="os/mingw32"