[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Thu Oct 13 00:21:57 UTC 2016


The branch master has been updated
       via  38be1ea85515a34b3f7285134bdfc1f88082331b (commit)
       via  71d8ff1a8998da20db5ab8d4024c3d155b2f6733 (commit)
       via  fad599f7f147ee71e5581211fb654c2c8c491cd8 (commit)
       via  075f7e2c6062a33352f570eeafe3c95e41419521 (commit)
      from  7954dced19a7e59e7055eab95a981fa943c7d100 (commit)


- Log -----------------------------------------------------------------
commit 38be1ea85515a34b3f7285134bdfc1f88082331b
Author: Richard Levitte <levitte at openssl.org>
Date:   Wed Oct 12 17:57:10 2016 +0200

    Remove automatic RPATH - Add a CHANGES entry
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit 71d8ff1a8998da20db5ab8d4024c3d155b2f6733
Author: Richard Levitte <levitte at openssl.org>
Date:   Thu Oct 13 00:08:55 2016 +0200

    Remove automatic RPATH - adapt shlib_wrap.sh
    
    Looking for something starting with '-Wl,-rpath,' isn't good enough,
    as someone might give something like '-Wl,--enable-new-dtags,-rpath,/PATH'.
    Looking for ',-rpath,' should be safe enough.
    
    We could remove the preloading stuff entirely, but just in case the
    user has chosen to given RPATH setting arguments at configuration,
    we'd better make sure testing will still work.  Fair warning, there
    are some configuration options that do not work with preloaded OpenSSL
    libraries, such as the sanity checking ones.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit fad599f7f147ee71e5581211fb654c2c8c491cd8
Author: Richard Levitte <levitte at openssl.org>
Date:   Wed Oct 12 17:05:35 2016 +0200

    Remove automatic RPATH - add user rpath support
    
    Make Configure recognise -rpath and -R to support user added rpaths
    for OSF1 and Solaris.  For convenience, add a variable LIBRPATH in the
    Unix Makefile, which the users can use as follows:
    
        ./config [options] -Wl,-rpath,\$(LIBRPATH)
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit 075f7e2c6062a33352f570eeafe3c95e41419521
Author: Richard Levitte <levitte at openssl.org>
Date:   Wed Oct 12 17:18:11 2016 +0200

    Remove automatic RPATH
    
    Before OpenSSL 1.1.0, binaries were installed in a non-standard
    location by default, and runpath directories were therefore added in
    those binaries, to make sure the executables would be able to find the
    shared libraries they were linked with.
    
    With OpenSSL 1.1.0 and on, binaries are installed in standard
    directories by default, and the addition of runpath directories is
    therefore not needed any more.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 CHANGES                           |  6 ++++++
 Configurations/unix-Makefile.tmpl | 21 ++++++---------------
 Configure                         | 11 ++++++++++-
 Makefile.shared                   | 14 +++++++-------
 util/shlib_wrap.sh.in             |  4 ++--
 5 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/CHANGES b/CHANGES
index eb18673..d1e772d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -11,6 +11,12 @@
      https://www.akkadia.org/drepper/SHA-crypt.txt
      [Richard Levitte]
 
+ Changes between 1.1.0b and 1.1.0c [xx XXX xxxx]
+
+  *) Removed automatic addition of RPATH in shared libraries and executables,
+     as this was a remainder from OpenSSL 1.0.x and isn't needed any more.
+     [Richard Levitte]
+
  Changes between 1.1.0a and 1.1.0b [26 Sep 2016]
 
   *) Fix Use After Free for large message sizes
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 7f6caea..8d1dfbe 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -153,6 +153,10 @@ LIBDIR={- #
 ENGINESDIR={- use File::Spec::Functions;
               catdir($prefix,$libdir,"engines-$sover") -}
 
+# Convenience variable for those who want to set the rpath in shared
+# libraries and applications
+LIBRPATH=$(INSTALLTOP)/$(LIBDIR)
+
 MANDIR=$(INSTALLTOP)/share/man
 DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
 HTMLDIR=$(DOCDIR)/html
@@ -176,20 +180,7 @@ PLIB_LDFLAGS= {- $target{plib_lflags} -}
 EX_LIBS= {- $target{ex_libs} -} {- $config{ex_libs} -}
 LIB_CFLAGS={- $target{shared_cflag} || "" -}
 LIB_CXXFLAGS={- $target{shared_cxxflag} || "" -}
-LIB_LDFLAGS={- $target{shared_ldflag}." ".$config{shared_ldflag}
-               # Unlike other OSes (like Solaris, Linux, Tru64,
-               # IRIX) BSD run-time linkers (tested OpenBSD, NetBSD
-               # and FreeBSD) "demand" RPATH set on .so objects.
-               # Apparently application RPATH is not global and
-               # does not apply to .so linked with other .so.
-               # Problem manifests itself when libssl.so fails to
-               # load libcrypto.so. One can argue that we should
-               # engrave this into Makefile.shared rules or into
-               # BSD-* config lines above. Meanwhile let's try to
-               # be cautious and pass -rpath to linker only when
-               # $prefix is not /usr.
-               . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
-                  ? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
+LIB_LDFLAGS={- $target{shared_ldflag}." ".$config{shared_ldflag} -}
 DSO_CFLAGS={- $target{shared_cflag} || "" -}
 DSO_CXXFLAGS={- $target{shared_cxxflag} || "" -}
 DSO_LDFLAGS=$(LIB_LDFLAGS)
@@ -1107,7 +1098,7 @@ $bin$exeext: $objs $deps
 		APPNAME=$bin$exeext OBJECTS="$objs" \\
 		LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
 		CC='$cc' CFLAGS='$cflags' \\
-		LDFLAGS='\$(LDFLAGS)' LIBRPATH='\$(INSTALLTOP)/\$(LIBDIR)' \\
+		LDFLAGS='\$(LDFLAGS)' \\
 		link_app.$shlib_target
 EOF
   }
diff --git a/Configure b/Configure
index 024b93f..38637fb 100755
--- a/Configure
+++ b/Configure
@@ -545,8 +545,9 @@ $config{build_type} = "release";
 
 my %unsupported_options = ();
 my %deprecated_options = ();
-foreach (@argvcopy)
+while (@argvcopy)
 	{
+	$_ = shift @argvcopy;
 	# VMS is a case insensitive environment, and depending on settings
 	# out of our control, we may receive options uppercased.  Let's
 	# downcase at least the part before any equal sign.
@@ -733,6 +734,14 @@ foreach (@argvcopy)
 			{
 			$libs.=$_." ";
 			}
+		elsif (/^-rpath$/ or /^-R$/)
+			# -rpath is the OSF1 rpath flag
+			# -R is the old Solaris rpath flag
+			{
+			my $rpath = shift(@argvcopy) || "";
+			$rpath .= " " if $rpath ne "";
+			$libs.=$_." ".$rpath;
+			}
 		elsif (/^-static$/)
 			{
 			$libs.=$_." ";
diff --git a/Makefile.shared b/Makefile.shared
index 77dae6e..e82ed1d 100644
--- a/Makefile.shared
+++ b/Makefile.shared
@@ -176,7 +176,7 @@ DO_GNU_SO=\
 	ALLSYMSFLAGS='-Wl,--whole-archive'; \
 	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
 	$(DO_GNU_SO_COMMON)
-DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"
+DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS)"
 
 #This is rather special.  It's a special target with which one can link
 #applications without bothering with any features that have anything to
@@ -220,7 +220,7 @@ link_shlib.bsd:
 	fi; $(LINK_SO_SHLIB)
 link_app.bsd:
 	@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
-	LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBPATH)"; \
+	LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
 	fi; $(LINK_APP)
 
 # For Darwin AKA Mac OS/X (dyld)
@@ -352,7 +352,7 @@ link_app.alpha-osf1:
 	@if $(DETECT_GNU_LD); then \
 		$(DO_GNU_APP); \
 	else \
-		LDFLAGS="$(CFLAGS) $(LDFLAGS) -rpath $(LIBRPATH)"; \
+		LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
 	fi; \
 	$(LINK_APP)
 
@@ -385,7 +385,7 @@ link_app.solaris:
 	@ if $(DETECT_GNU_LD); then \
 		$(DO_GNU_APP); \
 	else \
-		LDFLAGS="$(CFLAGS) $(LDFLAGS) -R $(LIBRPATH)"; \
+		LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
 	fi; \
 	$(LINK_APP)
 
@@ -476,7 +476,7 @@ link_shlib.irix:
 	fi; \
 	$(LINK_SO_SHLIB)
 link_app.irix:
-	@LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
+	@LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
 	$(LINK_APP)
 
 # 32-bit PA-RISC HP-UX embeds the -L pathname of libs we link with, so
@@ -514,7 +514,7 @@ link_shlib.hpux:
 	$(LINK_SO_SHLIB) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
 link_app.hpux:
 	@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
-	LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
+	LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,+s,+cdp,../:,+cdp,./:"; \
 	fi; \
 	$(LINK_APP)
 
@@ -540,7 +540,7 @@ link_shlib.aix:
 	rm -f $(DSTDIR)/$$SHLIB$$SHLIB_SOVER 2>&1 > /dev/null ; \
 	$(LINK_SO_SHLIB_VIA_O)
 link_app.aix:
-	LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
+	LDFLAGS="$(CFLAGS) -Wl,-bsvr4 $(LDFLAGS)"; \
 	$(LINK_APP)
 
 
diff --git a/util/shlib_wrap.sh.in b/util/shlib_wrap.sh.in
index eff1141..27a1e51 100755
--- a/util/shlib_wrap.sh.in
+++ b/util/shlib_wrap.sh.in
@@ -81,7 +81,7 @@ SunOS|IRIX*)
 	;;
 esac
 
-{- output_off() if $config{ex_libs} !~ /(^|\s)-Wl,-rpath,/; ""; -}
+{- output_off() if $config{ex_libs} !~ /,-rpath,/; ""; -}
 if [ -f "$LIBCRYPTOSO" -a -z "$preload_var" ]; then
 	# Following three lines are major excuse for isolating them into
 	# this wrapper script. Original reason for setting LD_PRELOAD
@@ -97,7 +97,7 @@ if [ -f "$LIBCRYPTOSO" -a -z "$preload_var" ]; then
 	DYLD_INSERT_LIBRARIES="$LIBCRYPTOSO:$LIBSSLSO"	# MacOS X
 	export LD_PRELOAD _RLD_LIST DYLD_INSERT_LIBRARIES
 fi
-{- output_on() if $config{ex_libs} !~ /(^|\s)-Wl,-rpath,/; ""; -}
+{- output_on() if $config{ex_libs} !~ /,-rpath,/; ""; -}
 
 cmd="$1"; [ -x "$cmd" ] || cmd="$cmd${EXE_EXT}"
 shift


More information about the openssl-commits mailing list