[SA-exim] wont compile exim4.14/sa-exim/dlopen 3.0 ?

Marc MERLIN marc at merlins.org
Tue May 13 09:44:28 PDT 2003


On Tue, May 13, 2003 at 05:43:13PM +0300, Anton Emilov wrote:
>       I followed strictly the build instructions but it appears I have
>       missed something. I am trying to build exim 4.14 with sa-exim
>       3.0 and dlopen patch on Debian box
 
On which architecture? 
 
>       Though I applied the patch
> 
> gcc -o exim -rdynamic acl.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o directory.o dns.o drtables.o enq.o exim.o expand.o filter.o globals.o header.o host.o ip.o log.o lss.o match.o moan.o os.o parse.o queue.o rda.o readconf.o receive.o retry.o rewrite.o route.o search.o smtp_in.o smtp_out.o spool_in.o spool_out.o store.o string.o tls.o tod.o transport.o tree.o verify.o local_scan.o  version.o \
>   pcre/libpcre.a \
>   routers/routers.a transports/transports.a lookups/lookups.a \
>   auths/auths.a \
>   -lresolv -lnsl -lcrypt    \
>    -ldb
> local_scan.o: In function `local_scan':
> local_scan.o(.text+0x3c): undefined reference to `dlerror'
> local_scan.o: In function `load_local_scan_library':
> local_scan.o(.text+0xc9): undefined reference to `dlopen'
> local_scan.o(.text+0xed): undefined reference to `dlsym'
> local_scan.o(.text+0xfd): undefined reference to `dlclose'
> local_scan.o(.text+0x11e): undefined reference to `dlsym'
> local_scan.o(.text+0x12e): undefined reference to `dlclose'
> local_scan.o(.text+0x14e): undefined reference to `dlclose'
> local_scan.o(.text+0x179): undefined reference to `dlclose'
> local_scan.o(.text+0x1a0): undefined reference to `dlsym'
> local_scan.o(.text+0x1bc): undefined reference to `dlclose'
> collect2: ld returned 1 exit status
> make[1]: *** [exim] Error 1
> make[1]: Leaving directory `/root/exim-4.14/build-Linux-i386'
> make: *** [go] Error 2
       
Right, you are missing -ldl, which prevents dynamic symbols from working.
On my system, it builts as such:
gcc -o exim -rdynamic acl.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o directory.o dns.o drtables.o enq.o exim.o expand.o filter.o globals.o header.o host.o ip.o log.o lss.o match.o moan.o os.o parse.o queue.o rda.o readconf.o receive.o retry.o rewrite.o route.o search.o smtp_in.o smtp_out.o spool_in.o spool_out.o store.o string.o tls.o tod.o transport.o tree.o verify.o local_scan.o perl.o version.o \
  -lpcre \
  routers/routers.a transports/transports.a lookups/lookups.a \
  auths/auths.a \
  -lresolv -lnsl -lcrypt   -lpam \
   -ldb -lldap -llber -lmysqlclient -lpq -rdynamic  -L/usr/local/lib /usr/lib/perl/5.6.1/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl/5.6.1/CORE -lperl -ldl -lm -lc -lcrypt -lgnutls -ltasn1 -lgcrypt
 
When you build exim, try setting EXTRALIBS_EXIM=-ldl in the Makefile
(exim's EDITME file)

I don't have to add -ldl, it gets added by itself. I looked while, and it 
seems to be becuase of perl on my system, which also sets -ldl.

I have a hard time to believe that the dlopen patch is missing -ldl from it,
but it seems to be the case.
I'll add it to the patch after you confirm that adding -ldl fixed it for you

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/   |   Finger marc_f at merlins.org for PGP key



More information about the SA-Exim mailing list