Operating System - HP-UX
1834934 Members
2867 Online
110071 Solutions
New Discussion

Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

 
Abdelmonam
Occasional Advisor

Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

Hello,

I tried to build openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3 by following these instructions:
./config shared
make update
make
make test
make install

All is well, but when I execute make I got this error:

//many other lines
make -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 cms.o" \
LIBDEPS=" $LIBRARIES -Wl,+s -ldld" \
link_app.${shlib_target}
/usr/ccs/bin/ld: Unsatisfied symbols:
PKCS8_encrypt (first referenced in pkcs8.o) (code)
X509_set_pubkey (first referenced in req.o) (code)
//many other lines
X509_get_serialNumber (first referenced in req.o) (code)
collect2: ld returned 1 exit status
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.

Any idea please?
17 REPLIES 17
Steven E. Protter
Exalted Contributor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

Shalom,

You need to alter the source code to work with HP-UX 11.11

I don't know what the changes are, but HP still hasn't figured it out and published it for this version of openssl and HP-UX 11.11 or 11.23.

They have managed it for HP-UX 11.31

So you might want to wait for HP to get it right and post it to http://software.hp.com

Bugging your HP rep can't hurt.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Deepak Kr
Respected Contributor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

Advise..

You can use:

http://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=OPENSSL11I
"There is always some scope for improvement"
Torsten.
Acclaimed Contributor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

ready to install:

http://hpux.asknet.de/hppd/hpux/Languages/openssl-0.9.8h/

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Abdelmonam
Occasional Advisor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

I tried this source http://hpux.asknet.de/ftp/hpux/Languages/openssl-0.9.8h/openssl-0.9.8h-src-11.11.tar.gz

But I have got the same problem!

I think the problem is with the loader in HP-UX 11.11 and not in openssl, in fact I build openssl on the same plateforme but without "shared" option in "./config" command, and all was good, but when I tried to build openldap (my principal aim) I got this error:
/usr/ccs/bin/ld: Invalid loader fixup in text space needed in output file for symbol "X509_NAME_free" in input file "/usr/local/ssl//lib/libssl.a(ssl_lib.o)"collect2: ld returned 1 exit status

So I thought that the problem is that openldap can't find shared library of openssl, so I decided to re-build openssl using this option and you see the error!
Torsten.
Acclaimed Contributor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

Why not using the depot?

http://hpux.asknet.de/ftp/hpux/Languages/openssl-0.9.8h/openssl-0.9.8h-hppa-11.11.depot.gz

http://hpux.asknet.de/hppd/cgi-bin/redirect?hpux/Languages/openssl-0.9.8h/openssl-0.9.8h-hppa-11.11.depot.gz

Make sure to have all Run-time dependencies.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Dennis Handly
Acclaimed Contributor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

>I think the problem is with the loader in HP-UX 11.11 and not in openssl
>ld: Invalid loader fixup in text space needed in output file for symbol "X509_NAME_free" in input file "/libssl.a(ssl_lib.o)

No, this is a user problem. You forgot to tell the compiler to generate PIC code, -fpic.

Abdelmonam
Occasional Advisor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

I don't think, see here, you can find the -fPIC flag:

gcc -shared -fPIC -Wl,+h -Wl,libldap-2.3.sl.2 -Wl,+b -Wl,/usr/local/lib -o .libs/libldap-2.3.sl.2.27 .libs/bind.o .libs/open.o .libs/result.o .libs/error.o .libs/compare.o .libs/search.o .libs/controls.o .libs/messages.o .libs/references.o .libs/extended.o .libs/cyrus.o .libs/modify.o .libs/add.o .libs/modrdn.o .libs/delete.o .libs/abandon.o .libs/sasl.o .libs/sbind.o .libs/kbind.o .libs/unbind.o .libs/cancel.o .libs/filter.o .libs/free.o .libs/sort.o .libs/passwd.o .libs/whoami.o .libs/getdn.o .libs/getentry.o .libs/getattr.o .libs/getvalues.o .libs/addentry.o .libs/request.o .libs/os-ip.o .libs/url.o .libs/sortctrl.o .libs/vlvctrl.o .libs/init.o .libs/options.o .libs/print.o .libs/string.o .libs/util-int.o .libs/schema.o .libs/charray.o .libs/tls.o .libs/os-local.o .libs/dnssrv.o .libs/utf-8.o .libs/utf-8-conv.o .libs/turn.o .libs/groupings.o .libs/txn.o .libs/ppolicy.o .libs/version.o -L/usr/local/BerkeleyDB.4.7/lib ../../libraries/liblber/.libs/liblber.sl /usr/local/lib/libsasl2.sl -L/usr/local/ssl//lib -lssl -lcrypto -lc
/usr/ccs/bin/ld: Invalid loader fixup in text space needed in output file for symbol "X509_NAME_free" in input file "/usr/local/ssl//lib/libssl.a(ssl_lib.o)"collect2: ld returned 1 exit status
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
Dennis Handly
Acclaimed Contributor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

>see here, you can find the -fPIC flag:
gcc -shared -fPIC -Wl,+h -Wl,libldap-2.3.sl.2 -Wl,+b -Wl,/usr/local/lib -o

This is a link line. You need to compile with it. Especially the files in /usr/local/ssl//lib/libssl.a.
Abdelmonam
Occasional Advisor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

Yep, I am using the -fPIC flag even in compilation, in openLDAP and before in openssl:

example for the error of openssl (I think here we build the /usr/local/ssl//lib/libssl.a library):
gcc -DMONOLITH -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -DDSO_DL -D_REENTRANT -march=2.0 -O3 -DB_ENDIAN -D_REENTRANT -c -o ocsp.o ocsp.c
gcc -DMONOLITH -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -DDSO_DL -D_REENTRANT -march=2.0 -O3 -DB_ENDIAN -D_REENTRANT -c -o prime.o prime.cgcc -DMONOLITH -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -DDSO_DL -D_REENTRANT -march=2.0 -O3 -DB_ENDIAN -D_REENTRANT -c -o cms.o cms.c
gcc -DMONOLITH -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -DDSO_DL -D_REENTRANT -march=2.0 -O3 -DB_ENDIAN -D_REENTRANT -c -o openssl.o openssl.c
rm -f openssl
shlib_target=; if [ -n "libcrypto.sl libssl.sl" ]; then \
shlib_target="hpux-shared"; \
fi; \
LIBRARIES="../libssl.a ../libcrypto.a" ; \
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 cms.o" \
LIBDEPS=" $LIBRARIES -Wl,+s -ldld" \
link_app.${shlib_target}
gmake[2]: Entering directory `/***/kouka/openssl-0.9.8h/apps'
gmake[2]: Leaving directory `/***/kouka/openssl-0.9.8h/apps'
(cd ..; \
OPENSSL="`pwd`/util/opensslwrap.sh"; export OPENSSL; \
/opt/perl5/bin/perl tools/c_rehash certs)
Doing certs
gmake[1]: Leaving directory `/***/kouka/openssl-0.9.8h/apps'
making all in test...
gmake[1]: Entering directory `/***/kouka/openssl-0.9.8h/test'
gcc -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -DDSO_DL -D_REENTRANT -march=2.0 -O3 -DB_ENDIAN -D_REENTRANT -c -o bntest.o bntest.c
gmake[2]: Entering directory `/***/kouka/openssl-0.9.8h/test'
/usr/ccs/bin/ld: Unsatisfied symbols:
BN_mod_exp (first referenced in bntest.o) (code)
BN_bin2bn (first referenced in bntest.o) (code)
BN_from_montgomery (first referenced in bntest.o) (code)
BN_mod_sqr (first referenced in bntest.o) (code
.
.
.


and the problem persist!!!
Abdelmonam
Occasional Advisor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

There is no way to solve this problem?
Torsten.
Acclaimed Contributor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

Again, how about the depot?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Dennis Handly
Acclaimed Contributor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

>I am using the -fPIC flag even in compilation, in openLDAP and before in openssl:

I don't see a compile line for ssl_lib.o.
I assume you are rebuilding libssl.a?

>There is no way to solve this problem?

Sure, don't use no stinkin' archive libssl.a.
Do you have a libssl.sl?
Abdelmonam
Occasional Advisor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

>Again, how about the depot?

I used the depot for openssl and I install it fien, but the problem with openLDAP is the same.

>I don't see a compile line for ssl_lib.o.
>I assume you are rebuilding libssl.a?

It is a part of the output, perhaps it compile it above.

>Sure, don't use no stinkin' archive libssl.a.
>Do you have a libssl.sl?

Yes, see that:
hpval178,root,sys > whereis libssl.sl
libssl: /usr/local/lib/libssl.a /usr/local/lib/libssl.sl

So there is libssl.sl, what should I do?
Torsten.
Acclaimed Contributor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

You wrote earlier you installed the *source* depot, but how about the binaries?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Abdelmonam
Occasional Advisor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

>You wrote earlier you installed the *source* depot, but how about the binaries?

If you mean openssl, yes I tried the source at the first time (and it I said that it works when I execute ./config and doesn't work when I use ./config shared) and then I used the binary depot http://hpux.asknet.de/hppd/cgi-bin/redirect?hpux/Languages/openssl-0.9.8h/openssl-0.9.8h-hppa-11.11.depot.gz and I install it fine.

If you mean openLDAP, yes I tried only with source.
Dennis Handly
Acclaimed Contributor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

>So there is libssl.sl, what should I do?

From your link line of 12:40:41 GMT:
>-Wl,+h -Wl,libldap-2.3.sl.2 -Wl,+b -Wl,/usr/local/lib
Change to:
-Wl,+h,libldap-2.3.sl.2 -Wl,+b,/usr/local/lib

>-L/usr/local/ssl//lib -lssl
Change to:
-L/usr/local/lib -lssl
Abdelmonam
Occasional Advisor

Re: Building openssl-0.9.8h under HP-UX 11.11 using gcc 4.2.3

I can't find in which file this path exist /usr/local/ssl//lib/ so I can't change it, I rename it to /usr/local/ssl//lib.old and I made ln -s /usr/local/lib /usr/local/ssl//lib/
and then repeat the build of openLDAP, now make is well done, but when I try make test, I got this error:

//many lines here, then:

>>>>> Test succeeded
>>>>> ./scripts/test000-rootdse completed OK.
>>>>> waiting 10 seconds for things to exit

>>>>> Starting test001-slapadd ...
running defines.sh
Running slapadd to build slapd database...
Starting slapd on TCP/IP port 9011...
Using ldapsearch to retrieve all the entries...
Waiting 5 seconds for slapd to start...
Waiting 5 seconds for slapd to start...
Waiting 5 seconds for slapd to start...
Waiting 5 seconds for slapd to start...
Waiting 5 seconds for slapd to start...
Waiting 5 seconds for slapd to start...
kill: 20924: The specified process does not exist.
ldapsearch failed (1)!
>>>>> ./scripts/test001-slapadd failed (exit 1)
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
gmake: *** [test] Error 1