From owner-freebsd-threads@FreeBSD.ORG Fri Sep 5 17:18:24 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 EB91B16A4BF; Fri, 5 Sep 2003 17:18:24 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2385043F75; Fri, 5 Sep 2003 17:18:24 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h860I8tp010516; Fri, 5 Sep 2003 20:18:08 -0400 (EDT) Date: Fri, 5 Sep 2003 20:18:08 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: John Birrell In-Reply-To: <20030906000902.GA25237@freebsd1.cimlogic.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Reply-To: deischen@FreeBSD.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2003 00:18:25 -0000 On Sat, 6 Sep 2003, John Birrell wrote: > 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. If you link an application, then it will. But if you are linking a library (OpenGL, libgthread, etc), I don't think you will get the error. > So a NOOP is best. Change gcc in the FSF sources when appropriate, but let > -current have the change now. -- Dan Eischen