Mail Archives: cygwin/2001/12/03/12:26:12
Tikka, Sami wrote:
> I'm trying to compile OpenLDAP with LDBM support for libgdbm. I have the
> latest Cygwin. I did:
>
> LIBS=-lregex ./configure
> make depend
> make
>
> Everything goes just fine until:
>
> gcc -g -O2 -I../../include -I../../include
> -L/home/Administrator/src/openldap-2.
> 0.18/libraries -o slapd main.o daemon.o connection.o search.o filter.o add.o
> cha
> rray.o attr.o entry.o config.o backend.o result.o operation.o dn.o compare.o
> mod
> ify.o delete.o modrdn.o ch_malloc.o value.o ava.o bind.o unbind.o abandon.o
> filt
> erentry.o phonetic.o acl.o str2filter.o aclparse.o init.o user.o repl.o
> lock.o c
> ontrols.o extended.o kerberos.o passwd.o schema.o schema_check.o
> schema_init.o s
> chema_prep.o schemaparse.o ad.o at.o mr.o syntax.o oc.o configinfo.o
> starttls.o
> index.o sets.o root_dse.o sasl.o module.o suffixalias.o mods.o version.o
> libback
> ends.a -lavl -lldbm -lldif -llutil -lldap_r -llber -lgdbm -lssl -lcrypto
> -lcrypt
> -lregex
> Warning: resolving _gdbm_errno by linking to __imp__gdbm_errno (auto-import)
> nmth000000.o(.idata$4+0x0): undefined reference to `_nm__gdbm_errno'
> collect2: ld returned 1 exit status
>
> What's wrong?
> $ nm /usr/lib/libgdbm.a|grep gdbm_errno
> U _gdbm_errno
> U _gdbm_errno
> U _gdbm_errno
> U _gdbm_errno
> U _gdbm_errno
> U _gdbm_errno
> U _gdbm_errno
> U _gdbm_errno
> U _gdbm_errno
> U _gdbm_errno
> 00000010 D _gdbm_errno
>
> So, gdbm_errno does exist, in the data segment. What am I doing wrong?
>
>
You are trying to access the "gdbm_errno" variable from the gdbm
library. However, cyggdbm.dll does not export that variable -- because
it is private and you're not supposed to access it directly from client
code (Bad OpenLDAP. No cookie.)
Since the linker can't find gdbm_errno in the importlib for gdbm
(because the import lib only contains those symbols that are properly
exported by the dll), the linker tries to do the 'auto-import' thing.
But, the current gdbm package was built long before auto-import support
was added to ld, so cyggdbm.dll doesn't contain any of the auto-import
thunks (_nm_*). So that fails, too.
Solution: fix OpenLDAP to call the gdbm error reporting *function* and
NOT to access the gdbm_error *variable* directly.
--Chuck
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -