Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Sep 2003 13:19:49 -0400
From:      Michael Edenfield <kutulu@kutulu.org>
To:        Ian Dowse <iedowse@maths.tcd.ie>
Cc:        Freebsd Current <current@freebsd.org>
Subject:   Re: Fixing -pthreads (Re: ports and -current)
Message-ID:  <20030924171949.GA90989@wombat.localnet>
In-Reply-To: <200309241703.aa94887@salmon.maths.tcd.ie>
References:  <Pine.GSO.4.10.10309241029001.26896-100000@pcnet5.pcnet.com> <200309241703.aa94887@salmon.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help

--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Ian Dowse <iedowse@maths.tcd.ie> [030924 12:03]:
> In message <Pine.GSO.4.10.10309241029001.26896-100000@pcnet5.pcnet.com>, =
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030924171949.GA90989>