Hi, 

Yesterday I posted a message regarding building OpenSSL-0.9.6c under
HPUX 11.X and had to manually link the ssl shared library and 
copy files by hand. Well Yea that sucks quite a bit. But this morning I
was talking to one of my developers and ,he's new to HPUX and trying to
get his own code to work too, told me about the linker flag +cdp. Which
replaced the recorded path with the specified path. 

>From what we understand, HP-UX automaticaly binds the build directories
into the object for run time linking. So by using the +cdp flag you can
get around this. Syntax is: +cdp <build path or old path>:<new path>

We are building in a directory called: /usr/local/src/openssl-0.9.6c and
the destination directory is /usr/local/ssl/lib. 

Built everything cleanly with the following. I used the HP Ansi C
compiler and the built in system linker (/usr/ccs/bin/ld) 

hps[src/openssl-0.9.6c]$ ./Configure threads shared hpux-parisc-cc

(configures makefiles correctly, everything is cool here)

I then add the following to the do_hpux-shared section to the top level
Makefile:

......

-L/usr/local/src/openssl-0.9.6c \
+cpd /usr/local/src/openssl-0.9.6c:/usr/local/ssl/lib \

......

then...
hp[src/openssl-0.9.6c]$ make    <-- Successful build
hp[src/openssl-0.9.6c]$ make test   <--- All tests work fine
hp[src/openssl-0.9.6c]# make install  

Then tested Sendmail+STARTTLS config after rebuilding Sendmail it. 


I ran ldd on my sendmail executable:

hp[src/openssl-0.9.6c]#ldd obj.HP-UX.11.11.9000-800/sendmail/sendmail
        /usr/lib/libc.2 =>      /usr/lib/libc.2
        /usr/lib/libdld.2 =>    /usr/lib/libdld.2
        /usr/lib/libc.2 =>      /usr/lib/libc.2
        /usr/local/sasl/lib/libsasl.sl.8 =>     /usr/local/sasl/lib/libsasl.sl.8
        /usr/local/ssl/lib/libcrypto.sl.0.9.6
=>      /usr/local/ssl/lib/libcrypto.sl.0.9.6
        /usr/lib/libc.2 =>      /usr/lib/libc.2
        /usr/lib/libdld.2 =>    /usr/lib/libdld.2
        /usr/local/ssl/lib/libssl.sl.0.9.6
=>      /usr/local/ssl/lib/libssl.sl.0.9.6
        /usr/lib/libc.2 =>      /usr/lib/libc.2
        /usr/lib/libdld.2 =>    /usr/lib/libdld.2
        /usr/local/ssl/lib/libcrypto.sl.0.9.6
=>      /usr/local/ssl/lib/libcrypto.sl.0.9.6
        /usr/lib/libnsl.1 =>    /usr/lib/libnsl.1
        /usr/lib/libxti.2 =>    /usr/lib/libxti.2


No /usr/local/src/openssl-0.9.6c (finally!)

Here is the excerpt from the man page: 

 +cdp oldpath:newpath
                         
 Replace the recorded path for a shared library in
the a.out.  In 32-bit mode, ld records the
absolute path names of any shared libraries
searched at link time in the a.out file.  When the
program begins execution, the dynamic loader
attaches any shared libraries that were searched
at link time. Although you can use the +b and/or
+s linker options to direct the dynamic loader to
directories to search for the shared libraries,
the dynamic loader, as a last resort, searches for
the shared libraries in its absolute, recorded
path in the a.out.  You can specify more than one
shared library oldpath:newpath, but each must be
preceded by the +cdp option.

Maybe this could get included in the next release of OpenSSL. ?

If you have questions, please let me know.. 

Thanks!
Chris


p.s. My entry for do_hpux-shared

# This assumes that GNU utilities are *not* used
do_hpux-shared:
        libs='${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
        ( set -x; /usr/ccs/bin/ld +vnocompatwarnings \
                -L/usr/local/src/openssl-0.9.6c \
                +cdp /usr/local/src/openssl-0.9.6c:/usr/local/ssl/lib \
                -b -z -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
                +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
                -Fl lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
        libs="$$libs -L. -l$$i"; \
        done






















 +cdp oldpath:newpath
  Replace the recorded path for a sha                         the
a.out.  In 32-bit mode, ld records the
                          absolute path names of any shared libraries
                          searched at link time in the a.out file.  When
the
                          program begins execution, the dynamic loader
                          attaches any shared libraries that were
searched
                          at link time. Although you can use the +b
and/or
                          +s linker options to direct the dynamic loader
to
                          directories to search for the shared
libraries,
                          the dynamic loader, as a last resort, searches
for
                          the shared libraries in its absolute, recorded
                          path in the a.out.  You can specify more than
one
                          shared library oldpath:newpath, but each must
be
                          preceded by the +cdp option.







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

Reply via email to