Mailing List Archive

Exim 4.05 & OpenSSL 0.9.6b
Another quandery.....

I am attempting to build Exim 4.05 with shareable OpenSSL libraries and
have run into a few problems with executing Exim.

Previously I have built Exim using the static OpenSSL libraries -
however this time round the shareable libraries are installed for
another application and consequently I have been unable execute Exim.

I am building Exim 4.05 on a Solaris 8 system with gcc 2.95.3.....

Firstly the build went smoothly

.....
awk '{ print ($1+1) }' cnumber.h > cnumber.temp
rm -f cnumber.h; mv cnumber.temp cnumber.h
gcc -c -g -O -DMAILQUO version.c
rm -f exim
gcc -o exim -Xlinker -B -Xlinker local acl.o child.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 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 -lsocket -lnsl -lkstat -lpam -ldl \
-ldb -lldap -lssl -lcrypto

>>> exim binary built

However on testing the newly built exim

$ ./exim -bV
ld.so.1: ./exim: fatal: libssl.so.0.9.6: open failed: No such file or
directory
Killed

The ldd command gave

$ ldd exim
libresolv.so.2 => /usr/lib/libresolv.so.2
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libkstat.so.1 => /usr/lib/libkstat.so.1
libpam.so.1 => /usr/lib/libpam.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libldap.so.4 => /usr/lib/libldap.so.4
libssl.so.0.9.6 => (file not found)
libcrypto.so.0.9.6 => (file not found)
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1

So I added /usr/local/lib to the LD_LIBRARY_PATH and the ldd command
gave

$ ldd exim
libresolv.so.2 => /usr/lib/libresolv.so.2
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libkstat.so.1 => /usr/lib/libkstat.so.1
libpam.so.1 => /usr/lib/libpam.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libldap.so.4 => /usr/lib/libldap.so.4
libssl.so.0.9.6 => /usr/local/lib/libssl.so.0.9.6
libcrypto.so.0.9.6 => /usr/local/lib/libcrypto.so.0.9.6
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1

So far so good; (I know the work round this problem is to use the -R
option for the ld command) however when I execute exim again I get the
following error

$ ./exim -bV
ld.so.1: ./exim: fatal: relocation error: file
/usr/local/lib/libssl.so.0.9.6: symbol main: referenced symbol not found
Killed

Any thoughts as to what this means and how I can get round this problem.

Thanks

Wm.
--
William Craven
ITServices Email: William.Craven@ubc.ca
University of British Columbia Tel: +1-604-822-8955
Vancouver, BC, Canada V6T 1Z2 Fax: +1-604-822-5116
Re: Exim 4.05 & OpenSSL 0.9.6b [ In reply to ]
William Craven <William.Craven@ubc.ca> writes:

> $ ./exim -bV
> ld.so.1: ./exim: fatal: relocation error: file
> /usr/local/lib/libssl.so.0.9.6: symbol main: referenced symbol not found
> Killed

Are you absolutely sure you don't compile and link the exim binary
against some other build of libssl (perhaps in some other location,
yet in INCLUDE_PATH) and then try to run exim using the one above?

--
(-) £ukasz Grochal lukie@rotfl.eu.org
(for PGP key visit:)
_____________________________________________ http://www.rotfl.eu.org/ __
... all in all it's just another rule in the firewall. /Ping Flood/
Re: Exim 4.05 & OpenSSL 0.9.6b [ In reply to ]
Nico Erfurth wrote:

> I'm not a Solaris-expert, but here are my guesses:
>
> - are there any header-files left from the old openssl-installation?
> maybe there are some problems

I checked that and the header files are correct

> - try to add -L/usr/local/lib to EXTRALIBS_EXIM in your Makefile

I tried that as well as -R/usr/local/lib but to no avail.

> - are you sure your dynamiclinker is using the right file?

Yes - the ldd command identifies which libraries it will load.

Wm.
--
William Craven
ITServices Email: William.Craven@ubc.ca
University of British Columbia Tel: +1-604-822-8955
Vancouver, BC, Canada V6T 1Z2 Fax: +1-604-822-5116
Re: Exim 4.05 & OpenSSL 0.9.6b [ In reply to ]
William Craven wrote:
>
> Nico Erfurth wrote:
>
> > I'm not a Solaris-expert, but here are my guesses:
> >
> > - are there any header-files left from the old openssl-installation?
> > maybe there are some problems
>
> I checked that and the header files are correct
>
> > - try to add -L/usr/local/lib to EXTRALIBS_EXIM in your Makefile
>
> I tried that as well as -R/usr/local/lib but to no avail.
>
> > - are you sure your dynamiclinker is using the right file?
>
> Yes - the ldd command identifies which libraries it will load.
>
> Wm.

Hi,

Here shows the SSL (TLS) part of Local/Makefile.
It works for me.

[ginger]% grep ssl Makefile
TLS_LIBS=-R/usr/local/ssl/lib -L/usr/local/ssl/lib -lssl -lcrypto
TLS_INCLUDE=-I/usr/local/ssl/include/

F.Y.I.
Use crle to set global shared library path.

HTH.

--
*** Save Solaris x86 ***
Toshio Kumagai TK2959 / TK127-AP
Toshio_Kumagai@Kumasan.ORG, Japan
Re: Exim 4.05 & OpenSSL 0.9.6b [ In reply to ]
Toshio Kumagai wrote:

> Here shows the SSL (TLS) part of Local/Makefile.
> It works for me.
>
> [ginger]% grep ssl Makefile
> TLS_LIBS=-R/usr/local/ssl/lib -L/usr/local/ssl/lib -lssl -lcrypto
> TLS_INCLUDE=-I/usr/local/ssl/include/
>
> F.Y.I.
> Use crle to set global shared library path.

Linking is not the issue here; the problem is that when exim has loaded
the SSL and Crypto Libraries - Exim fails to execute with the following
which I cannot make sense of.

The ldd command gives;

$ ldd exim
libresolv.so.2 => /usr/lib/libresolv.so.2
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libkstat.so.1 => /usr/lib/libkstat.so.1
libpam.so.1 => /usr/lib/libpam.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libldap.so.4 => /usr/lib/libldap.so.4
libssl.so.0.9.6 => /usr/local/lib/libssl.so.0.9.6
libcrypto.so.0.9.6 => /usr/local/lib/libcrypto.so.0.9.6
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1

So you can see that the libraries are loaded but when I execute exim I
get the following error message about a "Relocation Error"....

$ ./exim -bV
ld.so.1: ./exim: fatal: relocation error: file
/usr/local/lib/libssl.so.0.9.6: symbol main: referenced symbol not found
Killed

And what I am asking is what is this telling me !! And do I get round
this.

Thanks

Wm.
--
William Craven
ITServices Email: William.Craven@ubc.ca
University of British Columbia Tel: +1-604-822-8955
Vancouver, BC, Canada V6T 1Z2 Fax: +1-604-822-5116
Re: Exim 4.05 & OpenSSL 0.9.6b [ In reply to ]
On 20 June 2002, William Craven said:
> $ ./exim -bV
> ld.so.1: ./exim: fatal: relocation error: file
> /usr/local/lib/libssl.so.0.9.6: symbol main: referenced symbol not found
> Killed
>
> And what I am asking is what is this telling me !! And do I get round
> this.

A lame, clunky workaround (which doesn't really solve your problem, but
hopefully avoids it) would be to link statically with OpenSLL. You'll
need to have a libssl.a around somewhere; in the worst case, you'll have
to rebuild OpenSSL from scratch. You might have to edit Exim's Makefile
to ensure that you link against libssl.a, too.

Greg
Re: Exim 4.05 & OpenSSL 0.9.6b [ In reply to ]
Hi William,

I have similar experience on earlier version of Exim-3.1x.
At that time, I 've installed old ssl in /usr/local/openssl
and the headers in /usr/local/include/openssl.
gcc refers this old one.
And new one in /usr/local/ssl, execution path points here.

Do you have _ONLY ONE_ ssl headers/libraries in your system ?

HTH.

###

William Craven wrote:
>
> Toshio Kumagai wrote:
>
> > Here shows the SSL (TLS) part of Local/Makefile.
> > It works for me.
> >
> > [ginger]% grep ssl Makefile
> > TLS_LIBS=-R/usr/local/ssl/lib -L/usr/local/ssl/lib -lssl -lcrypto
> > TLS_INCLUDE=-I/usr/local/ssl/include/
> >
> > F.Y.I.
> > Use crle to set global shared library path.
>
> Linking is not the issue here; the problem is that when exim has loaded
> the SSL and Crypto Libraries - Exim fails to execute with the following
> which I cannot make sense of.
>
> The ldd command gives;
>
> $ ldd exim
> libresolv.so.2 => /usr/lib/libresolv.so.2
> libsocket.so.1 => /usr/lib/libsocket.so.1
> libnsl.so.1 => /usr/lib/libnsl.so.1
> libkstat.so.1 => /usr/lib/libkstat.so.1
> libpam.so.1 => /usr/lib/libpam.so.1
> libdl.so.1 => /usr/lib/libdl.so.1
> libldap.so.4 => /usr/lib/libldap.so.4
> libssl.so.0.9.6 => /usr/local/lib/libssl.so.0.9.6
> libcrypto.so.0.9.6 => /usr/local/lib/libcrypto.so.0.9.6
> libc.so.1 => /usr/lib/libc.so.1
> libmp.so.2 => /usr/lib/libmp.so.2
> /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
>
> So you can see that the libraries are loaded but when I execute exim I
> get the following error message about a "Relocation Error"....
>
> $ ./exim -bV
> ld.so.1: ./exim: fatal: relocation error: file
> /usr/local/lib/libssl.so.0.9.6: symbol main: referenced symbol not found
> Killed
>
> And what I am asking is what is this telling me !! And do I get round
> this.
>
> Thanks
>
> Wm.

--
*** Save Solaris x86 ***
Toshio Kumagai TK2959 / TK127-AP
Toshio_Kumagai@Kumasan.ORG, Japan