From owner-freebsd-current@FreeBSD.ORG Thu Apr 1 01:49:35 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 35FA016A4CE; Thu, 1 Apr 2004 01:49:35 -0800 (PST) Received: from postman.arcor.de (postman2.arcor-online.net [151.189.0.152]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D9DA43D31; Thu, 1 Apr 2004 01:49:34 -0800 (PST) (envelope-from eikemeier@fillmore-labs.com) Received: from fillmore.dyndns.org (port-212-202-49-130.reverse.qsc.de [212.202.49.130]) (authenticated bits=0)i319nROj003448 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 1 Apr 2004 11:49:32 +0200 (MEST) Received: from [172.16.0.2] (helo=fillmore-labs.com) by fillmore.dyndns.org with esmtp (Exim 4.31; FreeBSD) id 1B8ypB-000OEs-3P; Thu, 01 Apr 2004 11:49:27 +0200 Message-ID: <406BE5A2.8020106@fillmore-labs.com> Date: Thu, 01 Apr 2004 11:49:22 +0200 From: Oliver Eikemeier Organization: Fillmore Labs GmbH - http://www.fillmore-labs.com/ MIME-Version: 1.0 To: Sean McNeil References: <1080773331.1956.36.camel@server.mcneil.com> In-Reply-To: <1080773331.1956.36.camel@server.mcneil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit User-Agent: KMail/1.5.9 cc: "Jacques A. Vidrine" cc: freebsd-current@FreeBSD.org 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 09:49:35 -0000 Sean McNeil wrote: > On Wed, 2004-03-31 at 13:48, Daniel Eischen wrote: > >>On Mon, 29 Mar 2004, Daniel Eischen wrote: >> >> >>>On Mon, 29 Mar 2004, Jacques A. Vidrine wrote: >>> >>> >>>>Sean, could you report how this patch works for you? Hmm, actually, it >>>>looks almost identical to what you posted :-) Is there a reason that >>>>you stored the value of `__isthreaded' in a local variable? Did that >>>>make a difference for your case? >>> >>>I'm unsure how nss_ldap was built to depend on libpthread (or >>>any threads library). I built it from ports and 'ldd' didn't >>>report any dependency on a threads library. >> >>I rebuilt it and now it does depend on libpthread. I >>think it is because I had openldap-client-2.1.26 which >>didn't have a dependency on libpthread, but upgrading >>to openldap-client-2.1.28 brought in the dependency. >> >>Too bad these shared libraries can't be made to use >>the libgcc trick, so they can still be thread-safe >>but not depend on a threads library. That would >>also make it easier to use different thread libraries >>for different applications relying on common shared >>libraries. > > 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? -Oliver