Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Jun 2004 10:15:45 +0200
From:      Matthias Andree <ma@dt.e-technik.uni-dortmund.de>
To:        freebsd-ports@freebsd.org
Subject:   Re: post-patch blues with db3, db4, db41
Message-ID:  <20040608081545.GB20356@merlin.emma.line.org>
In-Reply-To: <1086462964.42167.5.camel@server.mcneil.com>
References:  <1086462964.42167.5.camel@server.mcneil.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 05 Jun 2004, Sean McNeil wrote:

> 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

And how would this cause the link with libpthread if the original
BDB configure script didn't request that in the first place?

I've tried ldd and readelf -d and objdump -p and see no reference to
pthread whatsoever in spite of libdb41_cxx.so.1 using pthread functions,
I'd expect a NEEDED tag. SONAME is there however.

The original script might however need to replace -pthread with -lc_r or
-lpthread on FreeBSD 5.

> dependency that we do not want.  It will in turn cause issues with
> nss_ldap and db doesn't use any threading.

No threads but mutexes. The CXX variant also defines some local weak
thread-related symbols.

> It is thread safe, but that
> doesn't mean it should be linked with pthread.

What FreeBSD version and machine are you running on? I only have freebsd
4.10 release and 5-CURRENT on x86 (i386).

Berkeley DB appears to use POSIX mutexes on the non-x86 machines, and
GCC assembly mutextes on x86 machines (and in the db41 port for amd64
machines, too, see http://www.freebsd.org/cgi/query-pr.cgi?pr=64886 ).

BerkeleyDB uses autoconf and some tests to figure if it should use some
native implementation, POSIX mutexes (in -lpthread) or UI mutexes (for
instance on Solaris, -lthread).

> 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

What sorts?

> because it uses db41 (via openldap and sasl) and it in turn pulls in
> pthread when it shouldn't.

Please show details.

> Could this target be removed from the ports mentioned?

It will break the compile for some of the versions, and I recently fixed
mutex related bugs for one of the newer db ports (db42 IIRC) for amd64,
by forcing x86/gcc-assembly mutexes for amd64.

-- 
Matthias Andree

Encrypted mail welcome: my GnuPG key ID is 0x052E7D95



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