Touch the correct variables for the system; shlib_wrap.sh on Solaris
authorRichard Levitte <levitte@openssl.org>
Wed, 9 Mar 2016 10:36:32 +0000 (11:36 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 9 Mar 2016 11:18:34 +0000 (12:18 +0100)
If there is cause to think LD_LIBRARY_PATH_32 and LD_PRELOAD_32 are
appropriate variables to touch, do so.  Otherwise, touch the usual
LD_LIBRARY_PATH and LD_PRELOAD.  This covers for older installations
that don't have a mix of 32-bit and 64-bit libs.

Reviewed-by: Andy Polyakov <appro@openssl.org>
util/shlib_wrap.sh

index 9b1dd66578aba9a727ab35c331042299a4d84bb9..ce463f17e8229183cde9719118dcb190e8d173ae 100755 (executable)
@@ -28,9 +28,13 @@ SunOS|IRIX*)
                preload_var=LD_PRELOAD_64
                ;;
        *ELF\ 32*SPARC*|*ELF\ 32*80386*)
-               [ -n "$LD_LIBRARY_PATH_32" ] && rld_var=LD_LIBRARY_PATH_32
-               LD_PRELOAD_32="$LIBCRYPTOSO $LIBSSLSO"; export LD_PRELOAD_32
-               preload_var=LD_PRELOAD_32
+               # We only need to change LD_PRELOAD_32 and LD_LIBRARY_PATH_32
+               # on a multi-arch system.  Otherwise, trust the fallbacks.
+               if [ -f /lib/64/ld.so.1 ]; then
+                   [ -n "$LD_LIBRARY_PATH_32" ] && rld_var=LD_LIBRARY_PATH_32
+                   LD_PRELOAD_32="$LIBCRYPTOSO $LIBSSLSO"; export LD_PRELOAD_32
+                   preload_var=LD_PRELOAD_32
+               fi
                ;;
        # Why are newly built .so's preloaded anyway? Because run-time
        # .so lookup path embedded into application takes precedence