[MDEV-11797] Build failure in libmariadb when LibreSSL is used Created: 2017-01-15  Updated: 2017-06-22  Resolved: 2017-06-22

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Scripts & Clients
Affects Version/s: 10.2.3
Fix Version/s: 10.2.6

Type: Bug Priority: Major
Reporter: Bernard Spil Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None
Environment:

FreeBSD build.brnrd.eu 11.0-RELEASE-p3 FreeBSD 11.0-RELEASE-p3 #0 r308890: Sun Nov 20 20:27:48 CET 2016 build@build.brnrd.eu:/usr/obj/usr/src/sys/BEASTIE110 amd64



 Description   

If LibreSSL is used as provider of SSL libraries, building libmariadb fails. This is due to LibreSSL defining OPENSSL_VERSION_NUMBER to 0x20000000L.

The patch is simple:

--- libmariadb/libmariadb/secure/openssl.c.orig 2016-12-22 11:09:46.000000000 +0100
+++ libmariadb/libmariadb/secure/openssl.c      2017-01-15 11:22:15.049274000 +0100
@@ -53,7 +53,7 @@
 #define MAX_SSL_ERR_LEN 100
 
 static pthread_mutex_t LOCK_openssl_config;
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
 static pthread_mutex_t *LOCK_crypto= NULL;
 #endif
 #if OPENSSL_USE_BIOMETHOD
@@ -86,7 +86,7 @@
 }
 
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
 /*
    thread safe callbacks for OpenSSL
    Crypto call back functions will be
@@ -209,7 +209,7 @@
 }
 #endif
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
 static void my_cb_locking(int mode, int n,
                           const char *file __attribute__((unused)),
                           int line __attribute__((unused)))
@@ -287,7 +287,7 @@
   /* lock mutex to prevent multiple initialization */
   pthread_mutex_init(&LOCK_openssl_config,MY_MUTEX_INIT_FAST);
   pthread_mutex_lock(&LOCK_openssl_config);
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
   if (!OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL))
     goto end;
 #else



 Comments   
Comment by Georg Richter [ 2017-06-22 ]

This bug was already closed in Connector/C and fixed together with MDEV-10332
Buildbot 64-bit
Buildbot 32-bit

Generated at Thu Feb 08 07:52:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.