From c4a9eb9e4465a5bf7d0f97e0153c816c9883396a Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 31 Dec 2012 16:15:36 +0100 Subject: [PATCH] Work around for 'version `OPENSSL_1.0.0' not found' When linking against the prebuilt libcrypto.so.1.0.0 and libssl.so.1.0.0 there is a problem running the viewer in gdb (on debian) because gdb links with libpython2.7.so which needs a newer openssl on my system (OPENSSL_1.0.1). The patch allows to work around this problem by defining -DUSE_SYSTEM_OPENSSL:BOOL=ON when configuring, which then causes the viewer to be compiled against the system libs. (If you already installed the prebuilt, you have to manually remove them with script/install.py --uninstall openSSL). The prebuilt libcurl expects a function SSLv2_client_method however, which is not present in my openssl system libs. A stub was added which is possible because the function in question isn't used anyway. --- indra/cmake/OpenSSL.cmake | 6 +++--- indra/llmessage/aicurl.cpp | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 60cd40c8b..fffe868fd 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -4,9 +4,9 @@ include(Prebuilt) set(OpenSSL_FIND_QUIETLY ON) set(OpenSSL_FIND_REQUIRED ON) -if (STANDALONE) +if (STANDALONE OR USE_SYSTEM_OPENSSL) include(FindOpenSSL) -else (STANDALONE) +else (STANDALONE OR USE_SYSTEM_OPENSSL) use_prebuilt_binary(openSSL) if (WINDOWS) set(OPENSSL_LIBRARIES ssleay32 libeay32) @@ -14,7 +14,7 @@ else (STANDALONE) set(OPENSSL_LIBRARIES ssl) endif (WINDOWS) set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) -endif (STANDALONE) +endif (STANDALONE OR USE_SYSTEM_OPENSSL) if (LINUX OR DARWIN) set(CRYPTO_LIBRARIES crypto) diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index e1568ea6b..467b37aa4 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/aicurl.cpp @@ -1014,6 +1014,8 @@ CURLcode CurlEasyRequest::curlCtxCallback(CURL* curl, void* sslctx, void* parm) options |= SSL_OP_NO_TLSv1_1; } #else + // This is expected when you compile against the headers of a version < 1.0.1 and then link at runtime with version >= 1.0.1. + // Don't do that. llassert_always(!need_renegotiation_hack); #endif SSL_CTX_set_options(ctx, options); @@ -1417,3 +1419,16 @@ CurlMultiHandle::~CurlMultiHandle() } } // namespace AICurlPrivate + +extern "C" { + +// Keep linker happy. +SSL_METHOD *SSLv2_client_method(void) +{ + // Never used. + llassert_always(false); + return NULL; +} + +} +