summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2007-09-16 18:44:35 +0000
committerAndy Polyakov <appro@openssl.org>2007-09-16 18:44:35 +0000
commit90ac9ec2643b655fce3b8d9581baafb5d648fc18 (patch)
tree116375360ab9dee4218362e3ff16075e9186fac5
parentfe5c4c885be98b9804e539cc62ebc048485b13bb (diff)
BSD run-time linkers apparently demand RPATH on .so objects [from HEAD].
PR: 1381
-rwxr-xr-xConfigure20
1 files changed, 18 insertions, 2 deletions
diff --git a/Configure b/Configure
index ef8cb4befa..07d5ea8e4c 100755
--- a/Configure
+++ b/Configure
@@ -1221,8 +1221,11 @@ if (!$IsMK1MF)
}
$cpuid_obj.=" uplink.o uplink-cof.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/);
-# Compiler fix-ups
-if ($target =~ /icc$/)
+
+#
+# Platform fix-ups
+#
+if ($target =~ /\-icc$/) # Intel C compiler
{
my($iccver)=`$cc -V 2>&1`;
if ($iccver =~ /Version ([0-9]+)\./) { $iccver=$1; }
@@ -1236,6 +1239,19 @@ if ($target =~ /icc$/)
}
}
+# 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.
+if ($target =~ /^BSD\-/)
+ {
+ $shared_ldflag.=" -Wl,-rpath,\$(LIBRPATH)" if ($prefix !~ m|^/usr[/]*$|);
+ }
+
if ($sys_id ne "")
{
#$cflags="-DOPENSSL_SYSNAME_$sys_id $cflags";