Summary: | databases/mariadb106: fix build with LibreSSL | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Ivan Rozhuk <rozhuk.im> | ||||
Component: | Individual Port(s) | Assignee: | freebsd-ports-bugs (Nobody) <ports-bugs> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | brnrd, nulani, rozhuk.im | ||||
Priority: | --- | ||||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
I expect this is an issue with conflicts in detection and use of includes/libraries at build time. Running LibreBSD, I have LibreSSL in base and I don't encounter the issue, do you have a way to find out? (In reply to Bernard Spil from comment #1) Strange, it should not build with libressl. I use my patch + workaround from: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273961 LibreSSL 3.7.3_1 includes are used, as far it have definition with 1 arg: /usr/local/include/openssl/crypto.h:int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), void (*f)(void *)); Base OpenSSL have definition with 3 args: /usr/include/openssl/crypto.h:int CRYPTO_set_mem_functions( void *(*m) (size_t, const char *, int), void *(*r) (void *, size_t, const char *, int), void (*f) (void *, const char *, int)); Maria defines: /* OpenSSL version specific definitions */ #if defined(OPENSSL_VERSION_NUMBER) #if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ !(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x30500000L) #define HAVE_OPENSSL11 1 Next if HAVE_OPENSSL11 defined than it build code to call CRYPTO_set_mem_functions(). So it is 100% that LibreSSL includes used. If I do replace to #if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ !(defined(LIBRESSL_VERSION_NUMBER)) and HAVE_OPENSSL11 is undefined then another error happen: ... FAILED: vio/CMakeFiles/vio.dir/viosslfactories.c.o /usr/local/libexec/ccache/cc -DHAVE_CONFIG_H -DHAVE_OPENSSL -I/tmp/ports/usr/ports/databases/mariadb106-client/work/mariadb-10.6.15/include -I/usr/local/include -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/databases/mariadb106-client/work/mariadb-10.6.15=. -fstack-protector --param=ssp-buffer-size=4 -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/databases/mariadb106-client/work/mariadb-10.6.15=. -DNDEBUG -D_FORTIFY_SOURCE=2 -DDBUG_OFF -std=gnu99 -I/usr/local/include -isystem /usr/local/include -fPIC -MD -MT vio/CMakeFiles/vio.dir/viosslfactories.c.o -MF vio/CMakeFiles/vio.dir/viosslfactories.c.o.d -o vio/CMakeFiles/vio.dir/viosslfactories.c.o -c /tmp/ports/usr/ports/databases/mariadb106-client/work/mariadb-10.6.15/vio/viosslfactories.c In file included from vio/viosslfactories.c:17: In file included from vio/vio_priv.h:25: In file included from include/my_sys.h:28: include/m_ctype.h:47:23: warning: redefinition of typedef 'ulong' is a C11 feature [-Wtypedef-redefinition] typedef unsigned long ulong; ^ include/my_global.h:891:23: note: previous definition is here typedef unsigned long ulong; /* Short for unsigned long */ ^ vio/viosslfactories.c:67:17: error: incomplete definition of type 'struct dh_st' || !DH_set0_pqg(dh, dhp_bn, NULL, dhg_bn)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/ssl_compat.h:78:45: note: expanded from macro 'DH_set0_pqg' #define DH_set0_pqg(D,P,Q,G) ((D)->p= (P), (D)->g= (G)) ~~~^ /usr/local/include/openssl/ossl_typ.h:132:16: note: forward declaration of 'struct dh_st' typedef struct dh_st DH; ^ vio/viosslfactories.c:67:17: error: incomplete definition of type 'struct dh_st' || !DH_set0_pqg(dh, dhp_bn, NULL, dhg_bn)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/ssl_compat.h:78:58: note: expanded from macro 'DH_set0_pqg' #define DH_set0_pqg(D,P,Q,G) ((D)->p= (P), (D)->g= (G)) ~~~^ /usr/local/include/openssl/ossl_typ.h:132:16: note: forward declaration of 'struct dh_st' typedef struct dh_st DH; ^ 1 warning and 2 errors generated. ... .... /* The check is only done for OpenSSL 1.1.x. It could run for OpenSSL 1.0.x but it doesn't make much sense and it hits this bug: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1594748 */ #ifndef HAVE_OPENSSL11 int check_openssl_compatibility() { return 0; } #else ... here code that was fixed by attached patch... check_openssl_compatibility() - always build by CMake, and called by runtime: ... #ifdef HAVE_OPENSSL if (check_openssl_compatibility()) { sql_print_error("Incompatible OpenSSL version. Cannot continue..."); exit(1); } #endif ... Is it possible that you some how build without OpenSSL support or with WolfSSL as cryptoengine? (sorry for long and mess post, there is no formatting features) A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=a34cf9c2dbf503c8248371ba3bab24f34d2d045d commit a34cf9c2dbf503c8248371ba3bab24f34d2d045d Author: Bernard Spil <brnrd@FreeBSD.org> AuthorDate: 2024-08-18 12:21:26 +0000 Commit: Bernard Spil <brnrd@FreeBSD.org> CommitDate: 2024-08-18 12:23:18 +0000 databases/mariadb106-server: Update to 10.6.19 * Fix a ports LibreSSL issue [1] PR: 274494 [1] Reported by: Ivan Rozhuk <rozhuk im gmail com> databases/mariadb106-server/Makefile | 4 +- databases/mariadb106-server/distinfo | 6 +-- .../files/patch-MDEV-34254 (gone) | 52 ---------------------- .../files/patch-mysys__ssl_openssl.c | 15 +++++++ databases/mariadb106-server/patch (new) | 23 ++++++++++ .../patch-mysys__ssl_openssl.c (new) | 17 +++++++ 6 files changed, 60 insertions(+), 57 deletions(-) A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=91f311910cae4e5d87db8cdf202c918ba57ca437 commit 91f311910cae4e5d87db8cdf202c918ba57ca437 Author: Bernard Spil <brnrd@FreeBSD.org> AuthorDate: 2024-08-18 12:28:53 +0000 Commit: Bernard Spil <brnrd@FreeBSD.org> CommitDate: 2024-08-18 12:28:53 +0000 databases/mariadb1011-server: Update to 10.11.9 * Don't set db_dir twice [1] * Fix build with ports LibreSSL [2] PR: 280841 [1], 274494 [2] Reported by: <pradeep michchi gmail com> [1], Ivan Rozhuk <rozhuk im gmail com> [2] databases/mariadb1011-server/Makefile | 3 +- databases/mariadb1011-server/distinfo | 6 +- .../mariadb1011-server/files/patch-PR279362 (gone) | 85 ---------------------- .../files/patch-mysys__ssl_openssl.c | 15 ++++ .../mariadb1011-server/files/server.cnf.sample.in | 2 +- 5 files changed, 20 insertions(+), 91 deletions(-) A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=957454977fba96ef72286c46aa00befc9d9cd492 commit 957454977fba96ef72286c46aa00befc9d9cd492 Author: Bernard Spil <brnrd@FreeBSD.org> AuthorDate: 2024-08-18 12:38:49 +0000 Commit: Bernard Spil <brnrd@FreeBSD.org> CommitDate: 2024-08-18 12:38:49 +0000 databases/mariadb114-server: Update to 11.4.3 * Fix build with ports LibreSSL [1] * Clean up binary references in cnf * Create proper sample files and default conf PR: 274494 Reported by: Ivan Rozhuk <rozhuk im gmail com> databases/mariadb114-client/pkg-plist | 4 +- databases/mariadb114-connector-c/Makefile (new) | 12 + databases/mariadb114-connector-c/distinfo (new) | 3 + databases/mariadb114-connector-c/pkg-descr (new) | 6 + databases/mariadb114-connector-c/pkg-plist (new) | 150 +++++ databases/mariadb114-server/Makefile | 13 +- databases/mariadb114-server/distinfo | 6 +- .../files/patch-mysys__ssl_openssl.c | 15 + .../files/patch-storage_columnstore-tr1 (new) | 689 +++++++++++++++++++++ databases/mariadb114-server/files/pkg-message.in | 8 +- .../mariadb114-server/files/server.cnf.sample.in | 16 +- databases/mariadb114-server/pkg-plist | 8 +- 12 files changed, 904 insertions(+), 26 deletions(-) |
Created attachment 245639 [details] patch Same for 10.11.5: FAILED: mysys_ssl/CMakeFiles/mysys_ssl.dir/openssl.c.o /usr/local/libexec/ccache/cc -DHAVE_CONFIG_H -DHAVE_OPENSSL -I/tmp/ports/usr/ports/databases/mariadb1011-client/work/mariadb-10.11.5/include -I/tmp/ports/usr/ports/databases/mariadb1011-client/work/mariadb-10.11.5/include/providers -I/tmp/ports/usr/ports/databases/mariadb1011-client/work/mariadb-10.11.5/mysys_ssl -I/usr/local/include -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/databases/mariadb1011-client/work/mariadb-10.11.5=. -fstack-protector --param=ssp-buffer-size=4 -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/databases/mariadb1011-client/work/mariadb-10.11.5=. -DNDEBUG -D_FORTIFY_SOURCE=2 -DDBUG_OFF -std=gnu99 -I/usr/local/include -isystem /usr/local/include -fPIC -MD -MT mysys_ssl/CMakeFiles/mysys_ssl.dir/openssl.c.o -MF mysys_ssl/CMakeFiles/mysys_ssl.dir/openssl.c.o.d -o mysys_ssl/CMakeFiles/mysys_ssl.dir/openssl.c.o -c /tmp/ports/usr/ports/databases/mariadb1011-client/work/mariadb-10.11.5/mysys_ssl/openssl.c mysys_ssl/openssl.c:55:33: error: incompatible function pointer types passing 'void *(size_t, const char *, int)' (aka 'void *(unsigned long, const char *, int)') to parameter of type 'void *(*)(size_t)' (aka 'void *(*)(unsigned long)') [-Wincompatible-function-pointer-types] if (!CRYPTO_set_mem_functions(coc_malloc, NULL, NULL)) ^~~~~~~~~~ /usr/local/include/openssl/crypto.h:408:38: note: passing argument to parameter 'm' here int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), void (*f)(void *)); ^ 1 error generated.