Hi!

I have some troubles building openssl-0.9.8 as a shared library. Static
version compiles fine, however, building shared library, compile fails. I
have tried recent snapshot (openssl-0.9.8-stable-SNAP-20051222), but
also with no luck.

Compile fails during linking time in LINK_APP section of the
Makefile.shared :

making all in apps...
gmake[1]: Entering directory
`/home/user/tmp/openssl-0.9.8-stable-SNAP-20051222/apps'
rm -f openssl
shlib_target=; if [ -n "libcrypto.sl.0.9.8 libssl.sl.0.9.8" ]; then \
        shlib_target="hpux-shared"; \
fi; \
if [ "${shlib_target}" = "darwin-shared" ] ; then \
  LIBRARIES="../libssl.a  ../libcrypto.a" ; \
else \
  LIBRARIES="-L.. -lssl  -L.. -lcrypto" ; \
fi; \
gmake -f ../Makefile.shared -e \
        APPNAME=openssl OBJECTS="openssl.o verify.o asn1pars.o req.o
dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca
.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o
x509.o genrsa.o gendsa.o s_server.o s_client.o speed
.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o
ciphers.o nseq.o pkcs12.o pkcs8.o spkac.o smime.o rand.o
engine.o ocsp.o prime.o" \
        LIBDEPS=" $LIBRARIES -Wl,+s -ldld" \
        link_app.${shlib_target}
gmake[2]: Entering directory
`/home/user/tmp/openssl-0.9.8-stable-SNAP-20051222/apps'
/usr/ccs/bin/ld: Unsatisfied symbols:
   PKCS8_encrypt (first referenced in pkcs8.o) (code)
   SSL_connect (first referenced in s_time.o) (code)
   SSL_alert_type_string_long (first referenced in s_cb.o) (code)
   X509_set_pubkey (first referenced in req.o) (code)
   X509_REQ_get_pubkey (first referenced in req.o) (code)
   SSL_get_current_cipher (first referenced in s_server.o) (code)
   CONF_modules_load (first referenced in apps.o) (code)
   X509_add1_trust_object (first referenced in x509.o) (code)
   DSA_free (first referenced in req.o) (code)
   OBJ_obj2nid (first referenced in ca.o) (code)
   BF_cbc_encrypt (first referenced in speed.o) (code)
   SSL_get_current_expansion (first referenced in s_client.o) (code)

   <...many many similar lines...>

   BIO_snprintf (first referenced in req.o) (code)
   d2i_DHparams (first referenced in dh.o) (code)
   DH_new (first referenced in dh.o) (code)
   X509_get_serialNumber (first referenced in req.o) (code)
collect2: ld returned 1 exit status
gmake[2]: *** [link_app.hpux] Error 1
gmake[2]: Leaving directory
`/home/user/tmp/openssl-0.9.8-stable-SNAP-20051222/apps'
gmake[1]: *** [openssl] Error 2
gmake[1]: Leaving directory
`/home/user/tmp/openssl-0.9.8-stable-SNAP-20051222/apps'
gmake: *** [build_apps] Error 1

I have truncated lines, since it is a clear problem - linker cannot find
ssl library, or to be exact - symbols, that should be located in
libssl.sl. I managed to get the linking command line:

gcc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DL -O3
-DB_ENDIAN -DBN_DIV2W -Wl,+s,+cdp,../:,+cdp,./:,+b,/usr/local/ssl/lib -o
openssl openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o
passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o
dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o s_server.o
s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o
sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o spkac.o smime.o rand.o
engine.o ocsp.o prime.o -L.. -lssl -L.. -lcrypto -Wl,+s -ldld

This looks good for me. And I *have* libssl in source root directory:
$ ls -al | grep libssl
-rw-r--r--   1 user    users       442444 Dec 23 10:15 libssl.a
lrwxr-xr-x   1 user    users           15 Dec 23 10:15 libssl.sl ->
libssl.sl.0.9.8
-r-xr-xr-x   1 user    users        12288 Dec 23 10:15 libssl.sl.0.9.8

Note, the size of a libssl.sl.0.9.8 is much smaller than the static
version.  Acctually, I am not very sure, what to do now. I suspect, that
libssl.sl.0.9.8 does not contain any symbol it should, and these
symbols are the symbols the linker cannot locate anywhere.

Any help is appreciated.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to