From owner-freebsd-current@FreeBSD.ORG Thu Apr 1 05:50:47 2004 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 2448516A4CE for ; Thu, 1 Apr 2004 05:50:47 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC5DC43D31 for ; Thu, 1 Apr 2004 05:50:46 -0800 (PST) (envelope-from nectar@celabo.org) Received: from localhost (localhost [127.0.0.1]) by gw.celabo.org (Postfix) with ESMTP id 30D4B5485D; Thu, 1 Apr 2004 07:50:46 -0600 (CST) Received: from gw.celabo.org ([127.0.0.1]) by localhost (hellblazer.celabo.org [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 47573-04; Thu, 1 Apr 2004 07:50:35 -0600 (CST) Received: from lum.celabo.org (lum.celabo.org [10.0.1.107]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lum.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id 840AB54846; Thu, 1 Apr 2004 07:50:35 -0600 (CST) Received: by lum.celabo.org (Postfix, from userid 501) id C9DC6186503; Thu, 1 Apr 2004 06:45:19 -0600 (CST) Date: Thu, 1 Apr 2004 06:45:19 -0600 From: "Jacques A. Vidrine" To: Oliver Eikemeier Message-ID: <20040401124519.GA12985@lum.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Oliver Eikemeier , Sean McNeil , Daniel Eischen , freebsd-current@FreeBSD.org References: <1080773331.1956.36.camel@server.mcneil.com> <406BE5A2.8020106@fillmore-labs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <406BE5A2.8020106@fillmore-labs.com> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.6i cc: freebsd-current@FreeBSD.org cc: Sean McNeil Subject: Re: nss_ldap broken 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: Thu, 01 Apr 2004 13:50:47 -0000 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 ' 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