]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/openssl fix: xenial autoconf logic problem: gcc/ld got too smart... 14215/head
authorMarcus Watts <mdw@linuxbox.com>
Thu, 23 Feb 2017 07:30:52 +0000 (02:30 -0500)
committerMarcus Watts <mdw@linuxbox.com>
Thu, 23 Feb 2017 07:30:52 +0000 (02:30 -0500)
On xenial, cc -o foo -lssl -lcrypto doesn't always
record libssl.so libcrypto.so as runtime library dependencies.
It is necessary to actually *use* a function from the library before
it gets recorded.  The ld(1) options "--as-needed" and "no-as-needed"
control this.  Evidently the default has changed in xenial.
That caused my smart "soname" detecting logic for openssl to
stop working.  To make it work, the test program has to
actually reference routines or variables inside the library.

This is a quick fix for xenial / autoconf.  There needs to be
a better fix for cmake and master.

Signed-off-by: Marcus Watts <mwatts@redhat.com>
configure.ac

index 62c64d2614938c003929950ca8f0d423929ddc2c..a1013a73677cf6cc8a31f6d487393cb7ef6c5731 100644 (file)
@@ -538,7 +538,8 @@ AC_MSG_NOTICE([radosgw: openssl INCLUDES $OPENSSL_INCLUDES LIBS $OPENSSL_LIBS])
 AC_MSG_CHECKING(for radosgw/civetweb: sonames for openssl libraries)
   saved_LIBS="${LIBS}"
   LIBS="$OPENSSL_LIBS"
-  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <openssl/ssl.h>
+#include <openssl/evp.h>], [SSL *s = 0;printf ("%p %d\n", (void*)EVP_md5(), SSL_get_fd(s))])],
       [AC_MSG_RESULT([linked])
 eval `$OBJDUMP -p ./conftest$ac_exeext | sed -n 's/^  NEEDED  *libssl/LIBSSL_SONAME=libssl/p;
 s/^  NEEDED  *libcrypto/LIBCRYPTO_SONAME=libcrypto/p'`],