From owner-freebsd-current@FreeBSD.ORG Wed Sep 24 22:10:39 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 725CD16A4B3 for ; Wed, 24 Sep 2003 22:10:39 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A605F43FF3 for ; Wed, 24 Sep 2003 22:10:38 -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.10/8.12.1) with ESMTP id h8P5AbgG017498; Thu, 25 Sep 2003 01:10:37 -0400 (EDT) Date: Thu, 25 Sep 2003 01:10:37 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Loren James Rittle In-Reply-To: <200309250336.h8P3axl3035080@latour.rsch.comm.mot.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org Subject: Re: Fixing -pthreads (Re: ports and -current) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2003 05:10:39 -0000 On Wed, 24 Sep 2003, Loren James Rittle wrote: > >I was looking through gcc last night to see how conceptually difficult > >it would be to do something like this. But instead of a file, I was > >thinking of this process: > > > >* if env("PTHREADS_LIBS") then LDFLAGS += PTHREADS_LIBS > >* elseif fileexists("libpthread") then LDFLAGS += -lpthread > >* elseif fileexists("libthr") then LDFLAGS += -lthr > >* elseif fileexists("libc_r") then LDFLAGS += -lc_r > >* else error("Threading not supported.") > > Hello Mike, > > I too thought about making -pthread an exact alias for > env("PTHREADS_LIBS") (and, if empty, pick -lpthread or the classic > default -lc_r). The main issue is that the FSF gcc has not accepted > any code into the gcc driver which depends on environment variables. What is FSF gcc policy with regard to having multiple thread switches, ala Solaris? An alternative would be to retain -pthread = -lc_r and switch it over to -lpthread once sparc64 and alpha ports are done, then add a -thread switch for -lthr if folks want similar treatment for libthr. -- Dan Eischen