From owner-freebsd-ports@FreeBSD.ORG Sat Jun 5 14:25:01 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA09116A4CE for ; Sat, 5 Jun 2004 14:25:01 -0700 (PDT) Received: from mail.mcneil.com (rrcs-west-24-199-45-54.biz.rr.com [24.199.45.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id B554743D3F for ; Sat, 5 Jun 2004 14:24:59 -0700 (PDT) (envelope-from sean@mcneil.com) Received: from localhost (localhost.mcneil.com [127.0.0.1]) by mail.mcneil.com (Postfix) with ESMTP id 479EFFD1C7; Sat, 5 Jun 2004 14:24:59 -0700 (PDT) Received: from mail.mcneil.com ([127.0.0.1]) by localhost (server.mcneil.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 19663-09; Sat, 5 Jun 2004 14:24:58 -0700 (PDT) Received: from [24.199.45.54] (mcneil.com [24.199.45.54]) by mail.mcneil.com (Postfix) with ESMTP id C1897FD07B; Sat, 5 Jun 2004 14:24:58 -0700 (PDT) From: Sean McNeil To: Michael Nottebrock In-Reply-To: <200406052313.28195.michaelnottebrock@gmx.net> References: <1086462964.42167.5.camel@server.mcneil.com> <200406052313.28195.michaelnottebrock@gmx.net> Content-Type: text/plain Message-Id: <1086470698.68421.8.camel@server.mcneil.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sat, 05 Jun 2004 14:24:58 -0700 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mcneil.com cc: matthias.andree@gmx.de cc: freebsd-ports@freebsd.org Subject: Re: post-patch blues with db3, db4, db41 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2004 21:25:02 -0000 On Sat, 2004-06-05 at 14:13, Michael Nottebrock wrote: > On Saturday 05 June 2004 21:16, Sean McNeil wrote: > > Hi, > > > > There are post-patch targets for these ports that are causing issues > > with the libraries built. The target: > > > > post-patch: > > @${REINPLACE_CMD} -Ee \ > > 's|-l?pthread|${PTHREAD_LIBS}|g' > > ${WRKSRC}/${CONFIGURE_SCRIPT} > > > > causes the library to be linked with libpthread.so. This is a > > dependency that we do not want. It will in turn cause issues with > > nss_ldap and db doesn't use any threading. It is thread safe, but that > > doesn't mean it should be linked with pthread. > > db links to a threads lib by default all by itself, the REINPLACE simply makes > sure it's linked to the right lib. Not true. The REINPLACE changes it so that the shared library is created with -lpthread instead of -pthread. This causes the library to include libpthread.so.1 as seen by ldd. The applications correctly link with the pthread library (at least for db41). There is no need to have /usr/local/lib/libdb41.so.1 require libpthread.so.1. This is wrong. > > > > I took out that target from my build of db41 and all is well for me. > > With it in, nss_ldap ends up causing all sorts of bad things to happen > > because it uses db41 (via openldap and sasl) and it in turn pulls in > > pthread when it shouldn't. > > It would seem nss_ldap needs to be fixed to be threads safe. nss_ldap is thread safe. Yet any nss* module should not itself cause the thread library to be pulled into an application. In fact, here is a general rule: No shared library that does not explicitly call pthread functionality (i.e. pthread* functions) should be linked to require libthread. This is a simple rule that db3, db4, and db41 do not follow. Removing the REINPLACE makes it follow the rule. I have tested this and found that this to be true. Sean