Date: Thu, 1 Apr 2004 06:45:19 -0600 From: "Jacques A. Vidrine" <nectar@FreeBSD.org> To: Oliver Eikemeier <eikemeier@fillmore-labs.com> Cc: Sean McNeil <sean@mcneil.com> Subject: Re: nss_ldap broken Message-ID: <20040401124519.GA12985@lum.celabo.org> In-Reply-To: <406BE5A2.8020106@fillmore-labs.com> References: <Pine.GSO.4.10.10403311642150.28223-100000@pcnet5.pcnet.com> <1080773331.1956.36.camel@server.mcneil.com> <406BE5A2.8020106@fillmore-labs.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 01, 2004 at 11:49:22AM +0200, Oliver Eikemeier wrote: > Sean McNeil wrote: > >I'm unclear as to why any library that is thread-safe would need to be > >linked with libpthread.so. Since libc already has the hooks in there, I > >don't see why you need to link with it unless you are actually > >using/relying on threads. IMHO, we should just not link libpthread.so > >into these shared libraries. > > I do understand some of the technical diffuculties here, but: > > - it should be documented somewhere (bsd.port.mk gives you only > PTHREAD_LIBS) > > - it requires some major surgery to ports makefiles to make sure that > libraries and application in a port are linked differently > > - there should be some easy tests, i.e. is it always an error if ldd *.so > contains libpthread? > > I committed a workaround for the OpenLDAP client port, but it seems that we > have may this problem in other parts of the system too, so a general > guideline (perhaps with a note in /usr/ports/CHANGES) would be appreciated. > Or do I overestimate the extend of this issue here? I don't know if you overestimate it or not for practical purposes, i.e. I'm not sure how many applications are actually affected. However, it makes me quite nervous. There are many uses of `plug-in' APIs that involve dlopen/dlclose of dynamic objects. So, I also think we should codify how these cases should be handled. I don't care for `the libgcc' hack... using #pragma seems inherently non-portable. Applications should not need to use anything other than `#include <pthread.h>' and invoke pthread_* APIs. Linking is inherently non-portable already :-) so perhaps requiring ``do not link threading libraries with objects that do not contain `main''' isn't such a burden. Cheers, -- Jacques Vidrine / nectar@celabo.org / jvidrine@verio.net / nectar@freebsd.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040401124519.GA12985>