Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3C0BB578.7060207@ece.gatech.edu> Date: Mon, 03 Dec 2001 12:25:12 -0500 From: Charles Wilson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010914 X-Accept-Language: en-us MIME-Version: 1.0 To: "Tikka, Sami" CC: cygwin AT cygwin DOT com Subject: Re: OpenLDAP + gdbm? References: <30B026EA81B98D4082E2FD73B14CB812200881 AT fsfimail1 DOT FI DOT F-Secure DOT com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-milter (http://amavis.org/) 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/