summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-08-17 02:18:50 +0200
committerThomas Deutschmann <whissi@gentoo.org>2019-08-17 02:18:50 +0200
commit90814b24c49ca1d46a500200b33b6243835047ab (patch)
tree3cb6c83a53ba7d61765b63de56c931e0afd74047
parentFix MySQL 8.0 patch set (diff)
downloadmysql-extras-90814b24c49ca1d46a500200b33b6243835047ab.tar.gz
mysql-extras-90814b24c49ca1d46a500200b33b6243835047ab.tar.bz2
mysql-extras-90814b24c49ca1d46a500200b33b6243835047ab.zip
Add initial Percona-Server v8.0 patch set
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r--20018_all_percona-server-8.0.16-without-clientlibs-tools.patch197
-rw-r--r--20018_percona-server-8.0.16-fix-libressl-support.patch297
2 files changed, 494 insertions, 0 deletions
diff --git a/20018_all_percona-server-8.0.16-without-clientlibs-tools.patch b/20018_all_percona-server-8.0.16-without-clientlibs-tools.patch
new file mode 100644
index 0000000..dd06976
--- /dev/null
+++ b/20018_all_percona-server-8.0.16-without-clientlibs-tools.patch
@@ -0,0 +1,197 @@
+From b38aad3589e5d7138d366bbde6336421f11829e9 Mon Sep 17 00:00:00 2001
+From: root <root@dev1.fritz.box>
+Date: Sat, 17 Aug 2019 00:08:53 +0200
+Subject: [PATCH 4/5] 20018_all_percona-server-8.0.18-without-clientlibs-tools
+
+---
+ CMakeLists.txt | 13 +++++++++----
+ libmysql/CMakeLists.txt | 23 +++++++++++++++++------
+ scripts/CMakeLists.txt | 11 ++++++++---
+ support-files/CMakeLists.txt | 4 +++-
+ utilities/CMakeLists.txt | 15 ++++++++++++---
+ 5 files changed, 49 insertions(+), 17 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 586797bf..eac43129 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1047,8 +1047,6 @@ ENDIF()
+ MYSQL_CHECK_SSL()
+ MYSQL_CHECK_SSL_DLLS()
+
+-# Add system/bundled editline.
+-MYSQL_CHECK_EDITLINE()
+ # Add libevent
+ IF(NOT WITHOUT_SERVER)
+ MYSQL_CHECK_LIBEVENT()
+@@ -1140,7 +1138,9 @@ IF(WITH_UNIT_TESTS)
+ ENABLE_TESTING()
+ ENDIF()
+
+-ADD_SUBDIRECTORY(include)
++IF(NOT WITHOUT_CLIENTLIBS)
++ ADD_SUBDIRECTORY(include)
++ENDIF(NOT WITHOUT_CLIENTLIBS)
+ ADD_SUBDIRECTORY(dbug)
+ ADD_SUBDIRECTORY(strings)
+ ADD_SUBDIRECTORY(vio)
+@@ -1173,7 +1173,6 @@ IF(WITH_UNIT_TESTS)
+ ADD_SUBDIRECTORY(unittest/mytap/t)
+ ENDIF()
+
+-ADD_SUBDIRECTORY(client)
+ ADD_SUBDIRECTORY(utilities)
+ ADD_SUBDIRECTORY(share)
+ ADD_SUBDIRECTORY(libservices)
+@@ -1192,6 +1191,12 @@ ENDIF()
+ ADD_SUBDIRECTORY(scripts)
+ ADD_SUBDIRECTORY(support-files)
+
++IF(NOT WITHOUT_TOOLS)
++ # Add system/bundled editline
++ MYSQL_CHECK_EDITLINE()
++ ADD_SUBDIRECTORY(client)
++ENDIF(NOT WITHOUT_TOOLS)
++
+ IF(NOT WITHOUT_SERVER)
+ ADD_SUBDIRECTORY(mysql-test)
+ ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
+diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
+index 3258ad9b..ca05da85 100644
+--- a/libmysql/CMakeLists.txt
++++ b/libmysql/CMakeLists.txt
+@@ -240,12 +240,17 @@ IF(WIN32)
+ LIST(APPEND LIBS_TO_MERGE auth_win_client)
+ ENDIF()
+
+-# LDAP authentication SASL client plugin
+-MESSAGE(STATUS "Creating LDAP authentication SASL client library.")
+-ADD_SUBDIRECTORY(authentication_ldap)
+-
+-# Merge several convenience libraries into one big perconaserverclient
+-MERGE_CONVENIENCE_LIBRARIES(perconaserverclient ${LIBS_TO_MERGE} COMPONENT Development)
++IF(WITHOUT_CLIENTLIBS)
++ # Merge several convenience libraries into one big perconaserverclient
++ MERGE_CONVENIENCE_LIBRARIES(perconaserverclient ${LIBS_TO_MERGE} COMPONENT Development SKIP_INSTALL)
++ELSE(WITHOUT_CLIENTLIBS)
++ # LDAP authentication SASL client plugin
++ MESSAGE(STATUS "Creating LDAP authentication SASL client library.")
++ ADD_SUBDIRECTORY(authentication_ldap)
++
++ # Merge several convenience libraries into one big perconaserverclient
++ MERGE_CONVENIENCE_LIBRARIES(perconaserverclient ${LIBS_TO_MERGE} COMPONENT Development)
++ENDIF(WITHOUT_CLIENTLIBS)
+ TARGET_LINK_LIBRARIES(perconaserverclient PRIVATE ${LIBS_TO_LINK})
+
+ # Visual Studio users need debug static library for debug projects
+@@ -284,9 +289,15 @@ ENDIF()
+ IF(NOT DISABLE_SHARED)
+ # Merge several convenience libraries into one big perconaserverclient
+ # and link them together into shared library.
++IF(WITHOUT_CLIENTLIBS)
++ MERGE_LIBRARIES_SHARED(libmysql ${LIBS_TO_MERGE}
++ EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_FUNCTIONS_UNDOCUMENTED}
++ COMPONENT SharedLibraries SKIP_INSTALL)
++ELSE(WITHOUT_CLIENTLIBS)
+ MERGE_LIBRARIES_SHARED(libmysql ${LIBS_TO_MERGE}
+ EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_FUNCTIONS_UNDOCUMENTED}
+ COMPONENT SharedLibraries)
++ENDIF(WITHOUT_CLIENTLIBS)
+ TARGET_LINK_LIBRARIES(libmysql PRIVATE ${LIBS_TO_LINK})
+
+ IF(WIN32)
+diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
+index 22683309..541eeefc 100644
+--- a/scripts/CMakeLists.txt
++++ b/scripts/CMakeLists.txt
+@@ -470,14 +470,12 @@ ELSE()
+
+ IF(WITH_SYSTEMD)
+ SET(BIN_SCRIPTS
+- mysql_config
+ mysqldumpslow
+ ps_mysqld_helper
+ ps-admin
+ )
+ ELSE()
+ SET(BIN_SCRIPTS
+- mysql_config
+ mysqldumpslow
+ mysqld_multi
+ mysqld_safe
+@@ -486,6 +484,13 @@ ELSE()
+ )
+ ENDIF()
+
++ IF(NOT WITHOUT_CLIENTLIBS)
++ SET(BIN_SCRIPTS
++ ${BIN_SCRIPTS}
++ mysql_config
++ )
++ ENDIF(NOT WITHOUT_CLIENTLIBS)
++
+ SET(PKGCONFIG_FILE ${LIBMYSQL_OS_OUTPUT_NAME}.pc)
+ STRING(REGEX REPLACE "/mysql$" "" PKGCONFIG_DIR "${INSTALL_LIBDIR}")
+ SET(PKGCONFIG_DIR "${PKGCONFIG_DIR}/pkgconfig")
+@@ -500,7 +505,7 @@ ELSE()
+ ${CMAKE_CURRENT_BINARY_DIR}/${PKGCONFIG_FILE}
+ ESCAPE_QUOTES @ONLY)
+
+- IF(INSTALL_PKGCONFIGDIR)
++ IF(INSTALL_PKGCONFIGDIR AND NOT WITHOUT_CLIENTLIBS)
+ MESSAGE(STATUS "INSTALL ${PKGCONFIG_FILE} ${INSTALL_PKGCONFIGDIR}")
+ INSTALL(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/${PKGCONFIG_FILE}
+diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
+index a5a31590..3b155127 100644
+--- a/support-files/CMakeLists.txt
++++ b/support-files/CMakeLists.txt
+@@ -64,7 +64,9 @@ IF(UNIX)
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ ENDFOREACH()
+
+- INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
++ IF(NOT WITHOUT_CLIENTLIBS)
++ INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
++ ENDIF(NOT WITHOUT_CLIENTLIBS)
+
+ SET(bindir ${prefix}/${INSTALL_BINDIR})
+ SET(sbindir ${prefix}/${INSTALL_SBINDIR})
+diff --git a/utilities/CMakeLists.txt b/utilities/CMakeLists.txt
+index 9ffb59e6..d7263a75 100644
+--- a/utilities/CMakeLists.txt
++++ b/utilities/CMakeLists.txt
+@@ -90,10 +90,15 @@ IF(APPLE AND HAVE_CRYPTO_DYLIB AND HAVE_OPENSSL_DYLIB)
+ ADD_DEPENDENCIES(comp_err copy_openssl_dlls)
+ ENDIF()
+
+-MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.cc)
++IF(NOT WITHOUT_CLIENTLIBS)
++ MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.cc)
++ MYSQL_ADD_EXECUTABLE(perror perror.cc)
++ELSE(NOT WITHOUT_CLIENTLIBS)
++ MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.cc SKIP_INSTALL)
++ MYSQL_ADD_EXECUTABLE(perror perror.cc SKIP_INSTALL)
++ENDIF(NOT WITHOUT_CLIENTLIBS)
+ TARGET_LINK_LIBRARIES(my_print_defaults mysys mysys_ssl)
+
+-MYSQL_ADD_EXECUTABLE(perror perror.cc)
+ ADD_DEPENDENCIES(perror GenError)
+ TARGET_LINK_LIBRARIES(perror mysys mysys_ssl)
+
+@@ -103,7 +108,11 @@ IF (BUILD_BUNDLED_LZ4)
+ ENDIF()
+
+ IF (BUILD_BUNDLED_ZLIB OR NOT OPENSSL_EXECUTABLE_HAS_ZLIB)
+- MYSQL_ADD_EXECUTABLE(zlib_decompress zlib_decompress.cc)
++ IF(NOT WITHOUT_CLIENTLIBS)
++ MYSQL_ADD_EXECUTABLE(zlib_decompress zlib_decompress.cc)
++ ELSE(NOT WITHOUT_CLIENTLIBS)
++ MYSQL_ADD_EXECUTABLE(zlib_decompress zlib_decompress.cc SKIP_INSTALL)
++ ENDIF(NOT WITHOUT_CLIENTLIBS)
+ TARGET_LINK_LIBRARIES(zlib_decompress ${ZLIB_LIBRARY} mysys)
+ ENDIF()
+
+--
+2.22.1
+
diff --git a/20018_percona-server-8.0.16-fix-libressl-support.patch b/20018_percona-server-8.0.16-fix-libressl-support.patch
new file mode 100644
index 0000000..5e7b24e
--- /dev/null
+++ b/20018_percona-server-8.0.16-fix-libressl-support.patch
@@ -0,0 +1,297 @@
+From da955a3a74c57688d33d845d5cb12cccf8004ff2 Mon Sep 17 00:00:00 2001
+From: root <root@dev1.fritz.box>
+Date: Sat, 17 Aug 2019 00:15:49 +0200
+Subject: [PATCH 5/5] percona-server-8.0.16-fix-libressl-support
+
+---
+ cmake/ssl.cmake | 6 ++++--
+ extra/libevent/openssl-compat.h | 5 ++++-
+ mysys_ssl/my_md5.cc | 2 +-
+ .../src/bindings/xcom/xcom/xcom_ssl_transport.c | 4 ++--
+ plugin/x/client/xconnection_impl.cc | 4 ++--
+ router/src/http/src/tls_client_context.cc | 2 +-
+ router/src/http/src/tls_context.cc | 6 +++++-
+ router/src/http/src/tls_server_context.cc | 3 ++-
+ sql-common/client.cc | 3 ++-
+ sql/mysqld.cc | 4 ++--
+ sql/sys_vars.cc | 8 ++++----
+ vio/viossl.cc | 4 ++--
+ vio/viosslfactories.cc | 2 +-
+ 13 files changed, 32 insertions(+), 21 deletions(-)
+
+diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
+index e93a12e0..06cd36ec 100644
+--- a/cmake/ssl.cmake
++++ b/cmake/ssl.cmake
+@@ -313,12 +313,14 @@ MACRO (MYSQL_CHECK_SSL)
+ OPENSSL_FIX_VERSION "${OPENSSL_VERSION_NUMBER}"
+ )
+ ENDIF()
+- IF("${OPENSSL_MAJOR_VERSION}.${OPENSSL_MINOR_VERSION}.${OPENSSL_FIX_VERSION}" VERSION_GREATER "1.1.0")
++ CHECK_SYMBOL_EXISTS(TLS1_3_VERSION "openssl/tls1.h" HAVE_TLS1_3_VERSION)
++ IF(HAVE_TLS1_3_VERSION)
+ ADD_DEFINITIONS(-DHAVE_TLSv13)
+ ENDIF()
+ IF(OPENSSL_INCLUDE_DIR AND
+ OPENSSL_LIBRARY AND
+- CRYPTO_LIBRARY
++ CRYPTO_LIBRARY AND
++ OPENSSL_MAJOR_VERSION VERSION_GREATER_EQUAL "1"
+ )
+ SET(OPENSSL_FOUND TRUE)
+ FIND_PROGRAM(OPENSSL_EXECUTABLE openssl
+diff --git a/extra/libevent/openssl-compat.h b/extra/libevent/openssl-compat.h
+index 69afc716..deb21d6a 100644
+--- a/extra/libevent/openssl-compat.h
++++ b/extra/libevent/openssl-compat.h
+@@ -24,7 +24,6 @@ static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
+ #define BIO_set_init(b, val) (b)->init = (val)
+ #define BIO_set_data(b, val) (b)->ptr = (val)
+ #define BIO_set_shutdown(b, val) (b)->shutdown = (val)
+-#define BIO_get_init(b) (b)->init
+ #define BIO_get_data(b) (b)->ptr
+ #define BIO_get_shutdown(b) (b)->shutdown
+
+@@ -32,4 +31,8 @@ static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
+
+ #endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#define BIO_get_init(b) (b)->init
++#endif
++
+ #endif /* OPENSSL_COMPAT_H */
+diff --git a/mysys_ssl/my_md5.cc b/mysys_ssl/my_md5.cc
+index 095fcb4e..0bdc885a 100644
+--- a/mysys_ssl/my_md5.cc
++++ b/mysys_ssl/my_md5.cc
+@@ -56,7 +56,7 @@ static void my_md5_hash(unsigned char *digest, unsigned const char *buf,
+ int compute_md5_hash(char *digest, const char *buf, int len) {
+ int retval = 0;
+ int fips_mode = 0;
+-#if !defined(HAVE_WOLFSSL)
++#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ fips_mode = FIPS_mode();
+ #endif /* HAVE_WOLFSSL */
+ /* If fips mode is ON/STRICT restricted method calls will result into abort,
+diff --git a/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c b/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c
+index 67c151b2..6a18a717 100644
+--- a/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c
++++ b/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c
+@@ -297,7 +297,7 @@ error:
+ return 1;
+ }
+
+-#ifndef HAVE_WOLFSSL
++#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ #define OPENSSL_ERROR_LENGTH 512
+ static int configure_ssl_fips_mode(const uint fips_mode) {
+ int rc = -1;
+@@ -521,7 +521,7 @@ int xcom_init_ssl(const char *server_key_file, const char *server_cert_file,
+ int verify_server = SSL_VERIFY_NONE;
+ int verify_client = SSL_VERIFY_NONE;
+
+-#ifndef HAVE_WOLFSSL
++#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ if (configure_ssl_fips_mode(ssl_fips_mode) != 1) {
+ G_ERROR("Error setting the ssl fips mode");
+ goto error;
+diff --git a/plugin/x/client/xconnection_impl.cc b/plugin/x/client/xconnection_impl.cc
+index cab1836c..4ba28d8f 100644
+--- a/plugin/x/client/xconnection_impl.cc
++++ b/plugin/x/client/xconnection_impl.cc
+@@ -489,7 +489,7 @@ XError Connection_impl::get_ssl_error(const int error_id) {
+ return XError(CR_SSL_CONNECTION_ERROR, buffer);
+ }
+
+-#ifndef HAVE_WOLFSSL
++#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ /**
+ Set fips mode in openssl library,
+ When we set fips mode ON/STRICT, it will perform following operations:
+@@ -539,7 +539,7 @@ XError Connection_impl::activate_tls() {
+ if (!m_context->m_ssl_config.is_configured())
+ return XError{CR_SSL_CONNECTION_ERROR, ER_TEXT_TLS_NOT_CONFIGURATED};
+
+-#ifndef HAVE_WOLFSSL
++#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ char err_string[OPENSSL_ERROR_LENGTH] = {'\0'};
+ if (set_fips_mode((int)m_context->m_ssl_config.m_ssl_fips_mode, err_string) !=
+ 1) {
+diff --git a/router/src/http/src/tls_client_context.cc b/router/src/http/src/tls_client_context.cc
+index f9dff94d..ae7413b4 100644
+--- a/router/src/http/src/tls_client_context.cc
++++ b/router/src/http/src/tls_client_context.cc
+@@ -54,7 +54,7 @@ void TlsClientContext::verify(TlsVerify verify) {
+
+ void TlsClientContext::cipher_suites(const std::string &ciphers) {
+ // TLSv1.3 ciphers are controlled via SSL_CTX_set_ciphersuites()
+-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1)
++#ifdef TLS1_3_VERSION
+ if (1 != SSL_CTX_set_ciphersuites(ssl_ctx_.get(), ciphers.c_str())) {
+ throw TlsError("set-cipher-suites");
+ }
+diff --git a/router/src/http/src/tls_context.cc b/router/src/http/src/tls_context.cc
+index bae36860..2cdc3127 100644
+--- a/router/src/http/src/tls_context.cc
++++ b/router/src/http/src/tls_context.cc
+@@ -92,7 +92,7 @@ static constexpr int o11x_version(TlsVersion version) {
+ return TLS1_1_VERSION;
+ case TlsVersion::TLS_1_2:
+ return TLS1_2_VERSION;
+-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1)
++#ifdef TLS1_3_VERSION
+ case TlsVersion::TLS_1_3:
+ return TLS1_3_VERSION;
+ #endif
+@@ -122,9 +122,11 @@ void TlsContext::version_range(TlsVersion min_version, TlsVersion max_version) {
+ default:
+ // unknown, leave all disabled
+ // fallthrough
++#ifdef TLS1_3_VERSION
+ case TlsVersion::TLS_1_3:
+ opts |= SSL_OP_NO_TLSv1_2;
+ // fallthrough
++#endif
+ case TlsVersion::TLS_1_2:
+ opts |= SSL_OP_NO_TLSv1_1;
+ // fallthrough
+@@ -171,8 +173,10 @@ TlsVersion TlsContext::min_version() const {
+ return TlsVersion::TLS_1_1;
+ case TLS1_2_VERSION:
+ return TlsVersion::TLS_1_2;
++#ifdef TLS1_3_VERSION
+ case TLS1_3_VERSION:
+ return TlsVersion::TLS_1_3;
++#endif
+ case 0:
+ return TlsVersion::AUTO;
+ default:
+diff --git a/router/src/http/src/tls_server_context.cc b/router/src/http/src/tls_server_context.cc
+index 4f3fa39c..ecc97559 100644
+--- a/router/src/http/src/tls_server_context.cc
++++ b/router/src/http/src/tls_server_context.cc
+@@ -162,7 +162,8 @@ void TlsServerContext::init_tmp_dh(const std::string &dh_params) {
+ }
+
+ } else {
+-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0)
++#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) && \
++ !defined(LIBRESSL_VERSION_NUMBER)
+ dh2048.reset(DH_get_2048_256());
+ #else
+ /*
+diff --git a/sql-common/client.cc b/sql-common/client.cc
+index b6a253cc..2375bd19 100644
+--- a/sql-common/client.cc
++++ b/sql-common/client.cc
+@@ -7681,7 +7681,8 @@ int STDCALL mysql_options(MYSQL *mysql, enum mysql_option option,
+ #endif
+ break;
+ case MYSQL_OPT_SSL_FIPS_MODE: {
+-#if defined(HAVE_OPENSSL) && !defined(HAVE_WOLFSSL)
++#if defined(HAVE_OPENSSL) && \
++ !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'};
+ ENSURE_EXTENSIONS_PRESENT(&mysql->options);
+ mysql->options.extension->ssl_fips_mode = *(uint *)arg;
+diff --git a/sql/mysqld.cc b/sql/mysqld.cc
+index 22364edc..7b066343 100644
+--- a/sql/mysqld.cc
++++ b/sql/mysqld.cc
+@@ -4881,7 +4881,7 @@ static int init_thread_environment() {
+
+ static PSI_memory_key key_memory_openssl = PSI_NOT_INSTRUMENTED;
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ #define FILE_LINE_ARGS
+ #else
+ #define FILE_LINE_ARGS , const char *, int
+@@ -4917,7 +4917,7 @@ static void init_ssl() {
+ }
+
+ static int init_ssl_communication() {
+-#ifndef HAVE_WOLFSSL
++#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'};
+ int ret_fips_mode = set_fips_mode(opt_ssl_fips_mode, ssl_err_string);
+ if (ret_fips_mode != 1) {
+diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
+index 5d7f3555..334684d2 100644
+--- a/sql/sys_vars.cc
++++ b/sql/sys_vars.cc
+@@ -4405,7 +4405,7 @@ static Sys_var_ulong Sys_max_execution_time(
+ HINT_UPDATEABLE SESSION_VAR(max_execution_time), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1));
+
+-#ifndef HAVE_WOLFSSL
++#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ static bool update_fips_mode(sys_var *, THD *, enum_var_type) {
+ char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'};
+ if (set_fips_mode(opt_ssl_fips_mode, ssl_err_string) != 1) {
+@@ -4418,7 +4418,7 @@ static bool update_fips_mode(sys_var *, THD *, enum_var_type) {
+ }
+ #endif
+
+-#ifdef HAVE_WOLFSSL
++#if defined(HAVE_WOLFSSL) || defined(LIBRESSL_VERSION_NUMBER)
+ static const char *ssl_fips_mode_names[] = {"OFF", 0};
+ #else
+ static const char *ssl_fips_mode_names[] = {"OFF", "ON", "STRICT", 0};
+@@ -4426,7 +4426,7 @@ static const char *ssl_fips_mode_names[] = {"OFF", "ON", "STRICT", 0};
+ static Sys_var_enum Sys_ssl_fips_mode(
+ "ssl_fips_mode",
+ "SSL FIPS mode (applies only for OpenSSL); "
+-#ifndef HAVE_WOLFSSL
++#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ "permitted values are: OFF, ON, STRICT",
+ #else
+ "permitted values are: OFF",
+@@ -4434,7 +4434,7 @@ static Sys_var_enum Sys_ssl_fips_mode(
+ GLOBAL_VAR(opt_ssl_fips_mode), CMD_LINE(REQUIRED_ARG, OPT_SSL_FIPS_MODE),
+ ssl_fips_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+ ON_CHECK(NULL),
+-#ifndef HAVE_WOLFSSL
++#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ ON_UPDATE(update_fips_mode),
+ #else
+ ON_UPDATE(NULL),
+diff --git a/vio/viossl.cc b/vio/viossl.cc
+index d69119b3..5fb7c883 100644
+--- a/vio/viossl.cc
++++ b/vio/viossl.cc
+@@ -507,7 +507,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
+ #if !defined(HAVE_WOLFSSL) && !defined(DBUG_OFF)
+ {
+ STACK_OF(SSL_COMP) *ssl_comp_methods = NULL;
+- ssl_comp_methods = SSL_COMP_get_compression_methods();
++ ssl_comp_methods = (STACK_OF(SSL_COMP) *)SSL_COMP_get_compression_methods();
+ n = sk_SSL_COMP_num(ssl_comp_methods);
+ DBUG_PRINT("info", ("Available compression methods:\n"));
+ if (n == 0)
+@@ -515,7 +515,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
+ else
+ for (j = 0; j < n; j++) {
+ SSL_COMP *c = sk_SSL_COMP_value(ssl_comp_methods, j);
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ DBUG_PRINT("info", (" %d: %s\n", c->id, c->name));
+ #else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+ DBUG_PRINT("info",
+diff --git a/vio/viosslfactories.cc b/vio/viosslfactories.cc
+index ea79ad1b..8ed961d1 100644
+--- a/vio/viosslfactories.cc
++++ b/vio/viosslfactories.cc
+@@ -429,7 +429,7 @@ void ssl_start() {
+ }
+ }
+
+-#ifndef HAVE_WOLFSSL
++#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER)
+ /**
+ Set fips mode in openssl library,
+ When we set fips mode ON/STRICT, it will perform following operations:
+--
+2.22.1
+