[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: back-bdb as module & DB 4.1.24



> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Pierangelo
Masarati

> > Jehan PROCACCIA a écrit :
> >> OK it link ok with BDB 4.1.24 now :-)
> >>
> >>[jehan@corbeau /usr/local/src/openldap-2.1.8]
> >>$ CPPFLAGS=-I/usr/local/jehan/bdb-4.1.24/include
> >> LDDFLAGS=-L/usr/local/jehan/bdb-4.1.24/lib ./configure
> --enable-debug
> >> --enable-crypt --enable-modules --enable-bdb --enable-ldbm
> >> --with-ldbm-api=berkeley --with-ldbm-module=dynamic
> --enable-monitor
> >> --with-bdb-module=dynamic --with-monitor-module=dynamic
> --enable-local
> >> --enable-cldap --disable-rlookups --with-tls --with-cyrus-sasl
> >> --enable-passwd --with-passwd-module=dynamic --enable-shell
> >> --with-shell-module=dynamic --enable-cleartext --enable-spasswd
> >> $ make depend
> >> $ make
> >> [jehan@corbeau /usr/local/src/openldap-2.1.8]
> >> $ ldd servers/slapd/slapd
> >>         libdb-4.1.so =>
> /usr/local/jehan/bdb-4.1.24/lib/libdb-4.1.so
> >> (0x40021000)
> >>
> >> But make test complains:
> >>
> >> make[1]: [test-bdb] Error 1 (ignored)
> >> run configure with --enable-bdb
> >
> > I had to modify the test Makefile so that it takes care of bdb as a
> > modules:
> >
> > [jehan@corbeau /usr/local/src/openldap-2.1.8]
> > $ vi tests/Makefile
> > line 264:
> > @if test "$(BUILD_BDB)" = "mod" ; then \ # before it was
> ="mod" it was
> > ="yes" !
> >
> > Then inlude the load of modules in the test slapd.conf file:
> >
> > [jehan@corbeau /usr/local/src/openldap-2.1.8/tests]
> > $ vi test-db/slapd.conf
> > modulepath      ../servers/slapd/back-bdb/.libs/
> > moduleload     back_bdb.la
> >
> > [jehan@corbeau /usr/local/src/openldap-2.1.8/tests]
> > $ ../servers/slapd/slapd -s0 -f ./test-db/slapd.conf -h
> > ldap://localhost:9009/
> > ../servers/slapd/slapd: relocation error:
> > ../servers/slapd/back-bdb/.libs/back_bdb.so.2: undefined symbol:
> > ldap_pvt_thread_rdwr_init
> >
> > Now I still get that undefined symbol problem ! ??
>
> that symbol is in the reentrant version of libldap, e.g. libldap_r;
> it looks like the library is not in the appropriate place.  I guess
> it should be installed before, or it is not actually linked
> by back_bdb.la.  You should try to see if is back_bdb.la (actually,
> ../servers/slapd/back-bdb/.libs/back_bdb.so.2) is linking libldap_r.so
> and if it doesn't you should check why (maybe something is missing
> in back-bdb/Makefile.in?)
>
> >
> > does someone managed to run BDB as a module whitout problems ?
>
> Good question.

Yes, we (Symas) use back-bdb built as a module. Symas CDS for Linux, HPUX,
and Solaris are all built this way.

> > After all is it usefull to use modules ?
>
> IMHO no.  I never tried, that's why I cannot really help but give
> a few twopence hints on dynamic linking...

There are a couple different problems going on. By default, slapd is
statically linked with libldap_r. Only the symbols that slapd itself uses are
bound from that library, and these symbols are re-exported by slapd for the
use of dynamic modules. But if a module needs a symbol that slapd doesn't,
then this problem occurs. The easiest solution is to edit the generated slapd
Makefile and remove "-static" from the libtool flags. When slapd is
dynamically linked with libldap_r then of course the entire library is
present, so the modules can find whatever they need.

The libtool script provides another mechanism to solve this problem but it
causes other problems of its own.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support