[openssl-dev] [openssl.org #3822] BUG: Configure does not set RPATH correctly

noloader@gmail.com via RT rt at openssl.org
Sun Apr 26 12:09:17 UTC 2015


This discussion relates to 1.0.2a. But I know its applies to other
versions from all the changes I've had to make to Makefile.org.

I'm not sure if this me using Configure incorrectly, or a bug in
Configure. I suspect its the later.

Below, I used both --prefix and --openssldir in an attempt to set them.

If there is difficulty in determining what should be done, then
perhaps there should be a --rpath Configure option.

As a matter of fact, I tried to add an --rpath option to Configure.
The LDFLAGS are not being honored in the build system. Sigh....

*****

./Configure linux-x86_64 shared no-ssl2 no-ssl3 no-comp
--openssldir=/usr/local/ssl --prefix=/usr/local/ssl
make depend
make
ldd ./apps/openssl
    linux-vdso.so.1 =>  (0x00007ffc555f8000)
    libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0
(0x00007fa0e8174000)
    libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
(0x00007fa0e7d99000)
    ...
ldd ./apps/openssl
    linux-vdso.so.1 =>  (0x00007ffef14c8000)
    libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0
(0x00007ff03065b000)
    libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
(0x00007ff030280000)
    ...

*****

$ grep -i rpath *
CHANGES:  *) Add full support for -rpath/-R, both in shared libraries and
CHANGES:     uses the RPATH feature, and is available through the special
CHANGES:     configuration target "alpha-cc-rpath", which will never be selected
...
Makefile:        SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)'    \
Makefile.bak:        SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)'    \
Makefile.org:        SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)'    \
Makefile.shared:DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
Makefile.shared:    LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBPATH)"; \
Makefile.shared:        LDFLAGS="$(CFLAGS) -rpath $(LIBRPATH)"; \
Makefile.shared:        LDFLAGS="$(CFLAGS) -R $(LIBRPATH)"; \
Makefile.shared:    @LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
Makefile.shared:    LDFLAGS="$(CFLAGS)
-Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
Makefile.shared:    LDFLAGS="$(CFLAGS)
-Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
Makefile.shared:symlink.cygwin symlink.alpha-osf1 symlink.tru64
symlink.tru64-rpath symlink.beos:
Makefile.shared:link_o.tru64-shared-rpath: link_o.tru64-rpath
Makefile.shared:link_a.tru64-shared-rpath: link_a.tru64-rpath
Makefile.shared:link_app.tru64-shared-rpath: link_app.tru64-rpath
Makefile.shared:symlink.tru64-shared-rpath: symlink.tru64-rpath
...

-------------- next part --------------
13c13
< my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
---
> my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR] [--rpath=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
20a21,23
> # --rpath       prefix for the OpenSSL library directories. Use by libssl and
> #               and openssl. There is no default directory. You must opt-in
> #               for the behavior.
702a706
> my $requested_rpath="";
927a932,935
> 			elsif (/^--rpath=(.*)$/)
> 				{
> 				$requested_rpath=$1;
> 				}
1499a1508,1511
> if ($requested_rpath ne "")
> 	{
> 	$shared_ldflag.=" -Wl,-rpath,\$(requested_rpath)";
> 	}
1753a1766
> 
1755a1769
> print "RPATH         =$requested_rpath\n" if($requested_rpath ne "");
2058c2072
< 	    VALUE "LegalCopyright", "Copyright  ? 1998-2005 The OpenSSL Project. Copyright ? 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"
---
> 	    VALUE "LegalCopyright", "Copyright  \A9 1998-2005 The OpenSSL Project. Copyright \A9 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"


More information about the openssl-dev mailing list