From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16530 invoked by alias); 22 Feb 2011 01:24:09 -0000 Received: (qmail 16520 invoked by uid 22791); 22 Feb 2011 01:24:08 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail1.thewrittenword.com (HELO mail1.thewrittenword.com) (69.67.212.77) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Feb 2011 01:24:03 +0000 Received: from mail1.il.thewrittenword.com (emma-internal-gw.il.thewrittenword.com [192.168.13.25]) by mail1.thewrittenword.com (Postfix) with ESMTP id 786A35CFA; Tue, 22 Feb 2011 01:47:59 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.4.4 mail1.thewrittenword.com 786A35CFA Received: from tw.local (unknown [192.168.1.254]) by mail1.il.thewrittenword.com (Postfix) with ESMTP id 2D0AB11A9; Tue, 22 Feb 2011 01:24:02 +0000 (UTC) Received: from tw.local (localhost.localdomain [127.0.0.1]) by tw.local (8.14.4/8.14.4) with ESMTP id p1M1O1lu027013; Mon, 21 Feb 2011 19:24:01 -0600 Received: (from pogma@localhost) by tw.local (8.14.4/8.14.4/Submit) id p1M1O0YQ027012; Mon, 21 Feb 2011 19:24:00 -0600 Date: Tue, 22 Feb 2011 01:45:00 -0000 From: "Peter O'Gorman" To: Jonathan Wakely Cc: gcc-help@gcc.gnu.org, ro@cebitec.uni-bielefeld.de Subject: Re: -lpthread -lstdc++ crashes on IRIX 6.5 Message-ID: <20110222012400.GM5577@tw.local> References: <20110221181036.GK5577@tw.local> <20110222004912.GL5577@tw.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00347.txt.bz2 On Tue, Feb 22, 2011 at 01:06:01AM +0000, Jonathan Wakely wrote: > > We're rebuilding now with a modified g++spec.c (patched to reorder > > -lpthread after -lstdc++), but still not sure that is the correct fix > > for this. > > The reason I asked is that on most platforms -pthread does two things, > it uses -D_REENTRANT when compiling (technically when preprocessing) > and uses -lpthread when linking. On some platforms doing one without > the other is not supported, so you should use -pthread when compiling > and when linking. While I agree with all of this, adding -lpthread to the link line as well as -pthread should not cause the resulting application to crash. I see I never got to that in my original mail, sorry :(. Even if we consistently use -pthread for compiling and linking with gcc, we sometimes end up with a -lpthread on the link line (often because libtool has it in some .la files dependency_libs, sometimes due to pkgconfig), and when that happens the resulting application crashes at launch. Peter -- Peter O'Gorman pogma@thewrittenword.com