Rob Janes via RT wrote:
> 
> I've solved the problem, but it would be nice if somebody could update the
> Configure script so it doesn't happen again. 

Well, here is a patch to 0.9.7c to add a --rpath=DIR option to Configure
and use it on a number of different systems, include HP-UX 11.23 in IA64
using GCC-3.3.2

I used to hard code in the Makefile the specific rpath I was using,
but decied to make ita parameter I was  working on this today! 
(So consider this a start.)

It also use -B symbolic or -symbolic when building the shared libs.  
And HP UX 11.23 is stting to use .so rather then .sl.


--- ./,config   Thu Mar 20 05:44:31 2003
+++ ./config    Thu Jan 15 12:48:00 2004
@@ -484,7 +484,9 @@
        CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
        CPU=${CPU:-0}
        if [ $CPU -ge 5000 ]; then
-               options="$options -mips4"
+#              options="$options -mips4"
+# We want compatability, so use mips3
+               options="$options -mips3"
        else
                options="$options -mips3"
        fi
--- ./,Makefile.org     Mon Aug 11 04:37:17 2003
+++ ./Makefile.org      Thu Jan 15 14:12:09 2004
@@ -25,6 +25,7 @@
 # Normally it is left empty.
 INSTALL_PREFIX=
 INSTALLTOP=/usr/local/ssl
+RPATH=
 
 # Do not edit this manually. Use Configure --openssldir=DIR do change this!
 OPENSSLDIR=/usr/local/ssl
@@ -282,10 +283,14 @@
        if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
                libs="$(LIBKRB5) $$libs"; \
        fi; \
+       if [ -n "${RPATH}" ]; then \
+               rpathparm="-Wl,-rpath,${RPATH}" \
+       fi; \
        ( set -x; ${CC} ${SHARED_LDFLAGS} \
                -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
                -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
                -Wl,-Bsymbolic \
+               $$rpathparm \
                -Wl,--whole-archive lib$$i.a \
                -Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \
        libs="-l$$i $$libs"; \
@@ -386,12 +391,19 @@
                if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
                        libs="$(LIBKRB5) $$libs"; \
                fi; \
+               if [ -n "${RPATH}" ]; then \
+                       rpathparm="-Wl,-R,${RPATH}"; \
+               fi; \
                ( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
                  MINUSZ='-z '; \
-                 (${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
+                 SYMBOLIC='-B symbolic' ; \
+                 (${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,' \
+                       && SYMBOLIC='-symbolic' ; \
                  set -x; ${CC} ${SHARED_LDFLAGS} -G -dy -z text \
                        -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
                        -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+                       $${SYMBOLIC} \
+                       $$rpathparm \
                        $${MINUSZ}allextract lib$$i.a $${MINUSZ}defaultextract \
                        $$libs ${EX_LIBS} -lc ) || exit 1; \
                libs="-l$$i $$libs"; \
@@ -456,9 +468,13 @@
                if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
                        libs="$(LIBKRB5) $$libs"; \
                fi; \
+               if [ -n "${RPATH}" ]; then \
+                       rpathparm="-Wl,-rpath,${RPATH}"; \
+               fi; \
                ( set -x; ${CC} ${SHARED_LDFLAGS} \
                        -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
                        -Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+               $$rpathparm \
                        -all lib$$i.a $$libs ${EX_LIBS} -lc) || exit 1; \
                libs="-l$$i $$libs"; \
                done; \
@@ -480,13 +496,17 @@
        if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
                libs="$(LIBKRB5) $$libs"; \
        fi; \
+       if [ -n "${RPATH}" ]; then \
+               rpathparm="+b ${RPATH}"; \
+       fi; \
        ( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
                +vnocompatwarnings \
                -b -z +s \
-               -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-               +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+               -o lib$$i${SHLIB_EXT} \
+               +h lib$$i${SHLIB_EXT} \
+               $$rpathparm \
                -Fl lib$$i.a -ldld -lc ) || exit 1; \
-       chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
+       chmod a=rx lib$$i${SHLIB_EXT}; \
        done
 
 # This assumes that GNU utilities are *not* used
@@ -503,12 +523,16 @@
        if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
                libs="$(LIBKRB5) $$libs"; \
        fi; \
+       if [ -n "${RPATH}" ]; then \
+               rpathparm="+b ${RPATH}"; \
+       fi; \
        ( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
                -b -z \
-               -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
-               +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+               -o lib$$i${SHLIB_EXT} \
+               +h lib$$i${SHLIB_EXT} \
+               $$rpathparm \
                +forceload lib$$i.a -ldl -lc ) || exit 1; \
-       chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
+       chmod a=rx lib$$i${SHLIB_EXT}; \
        done
 
 # The following method is said to work on all platforms.  Tests will
@@ -548,11 +572,15 @@
        if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
                libs="$(LIBKRB5) $$libs"; \
        fi; \
+       if [ -n "${RPATH}" ]; then \
+               rpathparm="-Wl,-blibpath:${RPATH}:/usr/lib:/lib"; \
+       fi; \
        ( set -x; \
          ld -r -o lib$$i.o $(ALLSYMSFLAG) lib$$i.a && \
          ( nm -Pg lib$$i.o | grep ' [BD] ' | cut -f1 -d' ' > lib$$i.exp; \
            $(SHAREDCMD) $(SHAREDFLAGS) \
                -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib$$i.o \
+               $$rpathparm \
                $$libs ${EX_LIBS} ) ) \
        || exit 1; \
        libs="-l$$i $$libs"; \
--- ./,Configure        Sun Sep 28 09:07:01 2003
+++ ./Configure Thu Jan 15 13:16:51 2004
@@ -10,7 +10,7 @@
 
 # see INSTALL for instructions.
 
-my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] 
[no-engine] [no-hw-xxx|no-hw]
[[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] 
[386] [--prefix=DIR] [--openssldir=OPENSSLDIR]
[--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
+my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] 
[no-engine] [no-hw-xxx|no-hw]
[[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] 
[386] [--prefix=DIR] [--rpath=DIR]
[--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
 
 # Options:
 #
@@ -18,6 +18,8 @@
 #               --prefix option is given; /usr/local/ssl otherwise)
 # --prefix      prefix for the OpenSSL include, lib and bin directories
 #               (Default: the OPENSSLDIR directory)
+# --rpath              Directories for loader to search for shared libs
+#                              other the /usr/lib. May be different then prefix.      
                         
 #
 # --install_prefix  Additional prefix for package builders (empty by
 #               default).  This needn't be set in advance, you can
@@ -262,6 +264,10 @@
 "hpux64-parisc-gcc","gcc:-DB_ENDIAN 
-DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR
DES_UNROLL DES_RISC1 
DES_INT::::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 
 # IA-64 targets
+# DEE using gcc-3.3.2  _ILP32 needed for asm
+"hpux-ia64-gcc","gcc:-DB_ENDIAN::-D_ILP32 -D_REENTRANT::-ldl:SIXTY_FOUR_BIT MD2_CHAR 
RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1
DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux-shared:-fpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"hpux64-ia64-gcc","gcc:-mlp64 -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT MD2_CHAR 
RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1
DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux-shared:-fpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+
 "hpux-ia64-cc","cc:-Ae +DD32 +O3 +Olit=all -z 
-DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR
DES_UNROLL DES_RISC1 
DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 # Frank Geurts <[EMAIL PROTECTED]> has patiently assisted with
 # with debugging of the following config.
@@ -597,6 +603,7 @@
 my $idx_arflags = $idx++;
 
 my $prefix="";
+my $rpath="";
 my $openssldir="";
 my $exe_ext="";
 my $install_prefix="";
@@ -823,6 +830,10 @@
                                {
                                $prefix=$1;
                                }
+                       elsif (/^--rpath=(.*)$/)
+                               {
+                               $rpath=$1;
+                               }
                        elsif (/^--openssldir=(.*)$/)
                                {
                                $openssldir=$1;
@@ -1218,6 +1229,7 @@
        s/^SHLIB_MINOR=.*/SHLIB_MINOR=$shlib_minor/;
        s/^SHLIB_EXT=.*/SHLIB_EXT=$shared_extension/;
        s/^INSTALLTOP=.*$/INSTALLTOP=$prefix/;
+       s/^RPATH=.*$/RPATH=$rpath/;
        s/^OPENSSLDIR=.*$/OPENSSLDIR=$openssldir/;
        s/^INSTALL_PREFIX=.*$/INSTALL_PREFIX=$install_prefix/;
        s/^PLATFORM=.*$/PLATFORM=$target/;




 The persistent problem imho is
> that the shared library linking is persistently wrong.  I've seen it on all
> of 0.9.6 and now on 0.9.7.  I am currently trying 0.9.7c.
> 
> problem number one:  +O4 optimization causes the HP c compiler to bomb.
> patched Configure to +O2, seems ok.  This is a small thing.
> 
> The big problem:
> 
> Try to run openssl, get libssl.sl.0.9.7 not found.
> 
> looking up the shared library usage using ldd on /usr/local/bin/openssl
> persistently reveals a libcrypto or libssl not found.
> 
> adding /usr/local/lib to LD_LIBRARY_PATH fixes the problem (for that
> session).
> 
> Looking up the ld man page suggests that specifying +b: on the ld command
> line should do the trick, provided -L /usr/local/lib is also on the command
> line.
> 
> Ok, patched in +b: into the hpux64 line, actually as "+b\\:".
> 
> Had to patch the split line too, using a negative look-behind assertion,
> plus a map to mop up the backslashes, cause otherwise it would have split on
> the colon I'm trying to have passed to ld.
> 
> Had to put in -L/usr/local/lib and +b: twice, once for libssl and libcrypto,
> and once for openssl.
> 
> yes, the openssl command now works.
> 
> I've attached the patch for Configure, if anybody's interested.
> 
> cheers
> rob janes (orb najes)
> [EMAIL PROTECTED] (unscramble to win, spambots)
> 
> ----------------------------------------------------------------------------
> This electronic message contains information from Primus Telecommunications
> Canada Inc. ("PRIMUS") , which may be legally privileged and confidential.
> The information is intended to be for the use of the individual(s) or entity
> named above. If you are not the intended recipient, be aware that any
> disclosure, copying, distribution or use of the contents of this information
> is prohibited. If you have received this electronic message in error, please
> notify us by telephone or e-mail (to the number or address above)
> immediately. Any views, opinions or advice expressed in this electronic
> message are not necessarily the views, opinions or advice of PRIMUS.
> It is the responsibility of the recipient to ensure that
> any attachments are virus free and PRIMUS bears no responsibility
> for any loss or damage arising in any way from the use
> thereof.The term "PRIMUS" includes its affiliates.
> ----------------------------------------------------------------------------
> Pour la version en fran�ais de ce message, veuillez voir
>  http://www.primustel.ca/fr/legal/cs.htm
> ----------------------------------------------------------------------------
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]

-- 

 Douglas E. Engert  <[EMAIL PROTECTED]>
 Argonne National Laboratory
 9700 South Cass Avenue
 Argonne, Illinois  60439 
 (630) 252-5444
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to