From owner-freebsd-current@FreeBSD.ORG Wed Sep 24 10:19:58 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 375A616A4B3; Wed, 24 Sep 2003 10:19:58 -0700 (PDT) Received: from basement.kutulu.org (pcp03610121pcs.longhl01.md.comcast.net [68.49.239.235]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FB9A43FCB; Wed, 24 Sep 2003 10:19:52 -0700 (PDT) (envelope-from kutulu@kutulu.org) Received: from wombat.localnet (wombat.localnet [192.168.69.3]) by basement.kutulu.org (Postfix) with ESMTP id C050DA97F; Wed, 24 Sep 2003 13:19:50 -0400 (EDT) Received: by wombat.localnet (Postfix, from userid 1001) id 5927CB926; Wed, 24 Sep 2003 13:19:50 -0400 (EDT) Date: Wed, 24 Sep 2003 13:19:49 -0400 From: Michael Edenfield To: Ian Dowse Message-ID: <20030924171949.GA90989@wombat.localnet> Mail-Followup-To: Ian Dowse , deischen@freebsd.org, Doug Barton , Freebsd Current References: <200309241703.aa94887@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: <200309241703.aa94887@salmon.maths.tcd.ie> X-Mailer: Mutt http://www.mutt.org/ X-Accept-Language: en X-PGP-Key: http://www.kutulu.org/pgp/kutulu.asc X-PGP-Fingerprint: 1CE0 3C31 7013 D529 406D 37DC 09CC CD84 A46C 878F User-Agent: Mutt/1.5.4i cc: deischen@freebsd.org cc: Doug Barton cc: Freebsd Current Subject: Re: Fixing -pthreads (Re: ports and -current) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2003 17:19:58 -0000 --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ian Dowse [030924 12:03]: > In message , = Daniel > Eischen writes: > >On Wed, 24 Sep 2003, Scott Long wrote: > >> PTHREAD_LIBS is a great tool for the /usr/ports mechanism, but doesn't > >> mean anything outside of that. > > > >That just meant it makes it easier to maintain ports so that > >they are PTHREAD_LIBS compliant (they would break when linked). > >I know it has no bearing on 3rd party stuff. >=20 > Just to throw one further approach out on the table, below is a > patch that makes gcc read from a file to determine what library to > associate with the -pthread flag. It's a hack of course, and probably > neither correct or optimal. If you want to make -pthread mean libkse, > create an /etc/pthread.libs that looks like: 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 +=3D PTHREADS_LIBS * elseif fileexists("libpthread") then LDFLAGS +=3D -lpthread * elseif fileexists("libthr") then LDFLAGS +=3D -lthr * elseif fileexists("libc_r") then LDFLAGS +=3D -lc_r * else error("Threading not supported.") or whatever. At that point, simply having PTHREADS_LIBS moved into the environment in bsd.port.mk and leaving all the ports using -pthread alone would automatically have them support PTHREADS_LIBS. Even better, the existing bsd.port.mk construct could become just another pre-defined environment variable, similar to LD_PRELOAD for the runtime linker, but which affects the compiler/link editor instead. --Mike --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/cdI1CczNhKRsh48RAqUbAKDLQxKeEwWYhppEk6WkOEHYl3RkZQCg2JVO xphmwdFOBkOhkNJ+/S8r5Bc= =tvnP -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X--