From owner-freebsd-threads@FreeBSD.ORG Fri Sep 5 17:07:11 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5CD4316A4BF; Fri, 5 Sep 2003 17:07:11 -0700 (PDT) Received: from cimlogic.com.au (cimlog.lnk.telstra.net [139.130.51.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B5EC43FE1; Fri, 5 Sep 2003 17:07:05 -0700 (PDT) (envelope-from jb@cimlogic.com.au) Received: from freebsd1.cimlogic.com.au (localhost [127.0.0.1]) by cimlogic.com.au (8.12.9/8.12.9) with ESMTP id h86092bZ031851; Sat, 6 Sep 2003 10:09:02 +1000 (EST) (envelope-from jb@cimlogic.com.au) Received: (from jb@localhost) by freebsd1.cimlogic.com.au (8.12.9/8.12.9/Submit) id h86092fm031850; Sat, 6 Sep 2003 10:09:02 +1000 (EST) Date: Sat, 6 Sep 2003 10:09:02 +1000 From: John Birrell To: deischen@FreeBSD.org Message-ID: <20030906000902.GA25237@freebsd1.cimlogic.com.au> References: <200309052235.h85MZoRF015386@latour.rsch.comm.mot.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: jb@FreeBSD.org cc: Loren James Rittle cc: freebsd-threads@FreeBSD.org Subject: Re: Removing -pthread from gcc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2003 00:07:11 -0000 On Fri, Sep 05, 2003 at 07:47:01PM -0400, Daniel Eischen wrote: > -pthread arose (in FreeBSD anyways) because you couldn't link > to both libc and libc_r in FreeBSD-[34]. In FreeBSD-5+, > we don't need -pthread. In other words, -pthread was replaced > by -lthr, -lkse11, -lkseMN, or -lc_r. The one dimensional > -pthread doesn't serve us any longer. > > I would have less of an objection if -pthread were kept in > but made a NOOP. > > > Please do not use a current shortcoming in ports(5) to kill a > > portability feature of gcc. A claim has been floated that -pthread is > > not standard. I tell you that is not the intention of the FSF gcc > > team, even if it is poorly documented. Since gcc 3.0 (some have been > > added post 3.0 release over time): > > > > -pthread is supported on Linux (I believe actually copied from FreeBSD > > even though they never had the switch -lc to issue). If -pthread is intended as a standard FSF gcc option, then it should be mapped to a NOOP for FreeBSD IMO. Back at the time when -pthread was added to FreeBSD's gcc (prior to being adopted by the FSF) the FreeBSD libc maintainers didn't want pthread stubs in libc, so an alternative library had to be built. The name came from OSF1. Since gcc 'knew' about libc, the only viable alternative was to also teach gcc about libc_r, hence the -pthread argument. I've just been through the exercise removing -pthread from my local application sources using the -current gcc which spits if -pthread is still used. From what I can see, this needn't be an error (or even a warning), because if the application uses one or more of the pthread functions (other than the ones which are stubbed), all you get is a link error. I think this still makes it obvious to ports people what is going on. So a NOOP is best. Change gcc in the FSF sources when appropriate, but let -current have the change now. -- John Birrell