summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-12-21 10:19:02 +0100
committerSergei Golubchik <serg@mariadb.org>2015-12-21 12:17:31 +0100
commite126baafbc78f15c794082f0a93740d81041d038 (patch)
tree5b9aeec751ef5d261fc3a2355a933408a934b4b7
parent591e74c7e8f682f2eada7496f50aa73f38bd168d (diff)
downloadmariadb-git-e126baafbc78f15c794082f0a93740d81041d038.tar.gz
MDEV-9249 MariaDB un-buildable on linux64: fails @ "error: ‘ERR_remove_state’ was not declared in this scope" when linking against OpenSSL 1.0.2e
ERR_remove_state is deprecated, use ERR_remove_thread_state if possible
-rw-r--r--cmake/ssl.cmake5
-rw-r--r--config.h.cmake2
-rw-r--r--include/violite.h4
3 files changed, 10 insertions, 1 deletions
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index ca950229129..43665d04a88 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -26,6 +26,7 @@ MACRO (MYSQL_USE_BUNDLED_SSL)
SET(SSL_INCLUDE_DIRS ${INC_DIRS})
SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PURE_C -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED")
+ SET(HAVE_ERR_remove_thread_state OFF CACHE INTERNAL "yassl doesn't have ERR_remove_thread_state")
CHANGE_SSL_SETTINGS("bundled")
#Remove -fno-implicit-templates
#(yassl sources cannot be compiled with it)
@@ -70,9 +71,13 @@ MACRO (MYSQL_CHECK_SSL)
MARK_AS_ADVANCED(CRYPTO_LIBRARY)
INCLUDE(CheckSymbolExists)
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
+ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
HAVE_SHA512_DIGEST_LENGTH)
+ CHECK_SYMBOL_EXISTS(ERR_remove_thread_state "openssl/err.h"
+ HAVE_ERR_remove_thread_state)
SET(CMAKE_REQUIRED_INCLUDES)
+ SET(CMAKE_REQUIRED_LIBRARIES)
IF(OPENSSL_FOUND AND CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
SET(SSL_SOURCES "")
SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY})
diff --git a/config.h.cmake b/config.h.cmake
index 73dc918bc3c..02952f6f395 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -465,7 +465,7 @@
#cmakedefine HAVE_BSD_SIGNALS 1
#cmakedefine HAVE_SVR3_SIGNALS 1
#cmakedefine HAVE_V7_SIGNALS 1
-
+#cmakedefine HAVE_ERR_remove_thread_state 1
#cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1
diff --git a/include/violite.h b/include/violite.h
index 14c99e8d8fe..ea7e3d7897c 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -123,6 +123,10 @@ typedef my_socket YASSL_SOCKET_T;
#include <openssl/ssl.h>
#include <openssl/err.h>
+#ifdef HAVE_ERR_remove_thread_state
+#define ERR_remove_state(X) ERR_remove_thread_state(NULL)
+#endif
+
enum enum_ssl_init_error
{
SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY,