Bug 247344 - databases/mariadb-connector-odbc: fix Undefined symbol "OPENSSL_init_ssl"
Summary: databases/mariadb-connector-odbc: fix Undefined symbol "OPENSSL_init_ssl"
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Bernard Spil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-17 15:02 UTC by Robert Nagy
Modified: 2021-10-21 15:42 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (brnrd)


Attachments
fix (959 bytes, patch)
2020-06-17 15:02 UTC, Robert Nagy
no flags Details | Diff
Pathc to make sure SSL is linked (441 bytes, patch)
2021-10-20 09:01 UTC, Richard van Vliet
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Nagy 2020-06-17 15:02:21 UTC
Created attachment 215659 [details]
fix

The mariadb-connector-odbc port requires libssl however it does not
link with it. The attached patch fixes that issue.
Comment 1 Bernard Spil freebsd_committer 2020-06-17 16:49:33 UTC
Thanks for the patch!

Have you reported this upstream as well?
https://jira.mariadb.org/projects/ODBC
Comment 2 Robert Nagy 2020-06-17 16:51:47 UTC
I did not report it upstream, I will leave that to someone else.
Comment 3 commit-hook freebsd_committer 2020-06-17 17:49:50 UTC
A commit references this bug:

Author: brnrd
Date: Wed Jun 17 17:49:42 UTC 2020
New revision: 539435
URL: https://svnweb.freebsd.org/changeset/ports/539435

Log:
  databases/mariadb-connector-odbc: Update to 3.1.7

   * Fix SSL detection as well

  PR:		247344
  Reported by:	Robert Nagy <robert openbsd org>

Changes:
  head/databases/mariadb-connector-odbc/Makefile
  head/databases/mariadb-connector-odbc/distinfo
Comment 4 Bernard Spil freebsd_committer 2020-06-17 17:52:39 UTC
Updated Connector/C and Connector/ODBC to 3.1 branch.

The detection in the configure stage now works proper. If there's still an issue, please reopen and I'll have a look. I didn't find references to OPENSSL_init_ssl in the 3.1.7 code.
Comment 5 Robert Nagy 2020-06-17 18:07:20 UTC
Your commit does not change the fact that the port does not link to libssl.

Also:

nm -a work/mariadb-connector-odbc-3.1.7-ga-src/libmaodbc.so | grep OPENSSL
                 U OPENSSL_init_ssl
Comment 6 commit-hook freebsd_committer 2020-06-22 09:49:03 UTC
A commit references this bug:

Author: brnrd
Date: Mon Jun 22 09:48:39 UTC 2020
New revision: 539799
URL: https://svnweb.freebsd.org/changeset/ports/539799

Log:
  databases/mariadb-connector-odbc: Fix linking libssl

  PR:		247344
  Submitted by:	Robert Nagy <robert openbsd org>

Changes:
  head/databases/mariadb-connector-odbc/Makefile
  head/databases/mariadb-connector-odbc/files/
  head/databases/mariadb-connector-odbc/files/patch-CMakeLists.txt
Comment 7 Richard van Vliet 2021-10-19 17:48:21 UTC
Hi,

I hope opening an old issue is correct.

I think this bug had been reintroduced with the remove of the Cmake patch.
I am using FreeBSD 13.0-RELEASE 

The Patch changed the CmakeLists.txt line to :
    SET(PLATFORM_DEPENDENCIES ${PLATFORM_DEPENDENCIES} ${LIB_MATH})

But the tar stil has the old line :
    SET(PLATFORM_DEPENDENCIES ${LIB_MATH})


I have no experience with C of Linking so i hope i have supplied sufficient info


# isql connection database PASSWORD select 1
ld-elf.so.1: /usr/local/lib/mariadb/libmaodbc.so: Undefined symbol "OPENSSL_init_ssl"


# readelf -a /usr/local/lib/mariadb/libmaodbc.so | grep 'SSL_init'
000000095c98 007300000007 R_X86_64_JUMP_SLOT  0000000000000000 OPENSSL_init_ssl + 0
   115: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND OPENSSL_init_ssl


# pkg info mariadb-connector-odbc
mariadb-connector-odbc-3.1.11
Name           : mariadb-connector-odbc
Version        : 3.1.11
Installed on   : Tue Oct 19 18:31:16 2021 CEST
Origin         : databases/mariadb-connector-odbc
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : databases
Licenses       : LGPL21
Maintainer     : brnrd@FreeBSD.org
WWW            : https://mariadb.com/kb/en/mariadb/mariadb-connector-odbc/
Comment        : MariaDB database connector for odbc
Options        :
	SSL            : on
Shared Libs required:
	libodbcinst.so.2
Shared Libs provided:
	libmaodbc.so
Annotations    :
	FreeBSD_version: 1300139
	repo_type      : binary
	repository     : newimage
Flat size      : 616KiB

The poudriere build logs are here. 

For Quarterly Q3
http://builder.newimage.nl/logs/bulk/FreeBSD_13-0_amd64-2021Q3/2021-09-15_01h03m11s/logs/mariadb-connector-odbc-3.1.11.log

For Latest
http://builder.newimage.nl/logs/bulk/FreeBSD_13-0_amd64-latest/2021-09-15_07h37m11s/logs/mariadb-connector-odbc-3.1.11.log
Comment 8 Richard van Vliet 2021-10-20 09:01:32 UTC
Created attachment 228861 [details]
Pathc to make sure SSL is linked

I have recreated the patch (Attached) and tested this on my system.
Tested with Ports tree 2021Q3

The log shows it's linked now
-- Linking Connector/C library statically(mariadbclient)
-- Version script: /wrkdirs/usr/ports/databases/mariadb-connector-odbc/work/mariadb-connector-odbc-3.1.11-ga-src/maodbc.def
-- All linked targets/external dependencies: mariadbclient odbcinst /usr/lib/libssl.so;/usr/lib/libcrypto.so;m


#ldd /usr/local/lib/mariadb/libmaodbc.so 
/usr/local/lib/mariadb/libmaodbc.so:
	libodbcinst.so.2 => /usr/local/lib/libodbcinst.so.2 (0x80070c000)
	libssl.so.111 => /usr/lib/libssl.so.111 (0x800727000)
	libcrypto.so.111 => /lib/libcrypto.so.111 (0x801000000)
	libm.so.5 => /lib/libm.so.5 (0x8007bf000)
	libc.so.7 => /lib/libc.so.7 (0x800263000)
	libthr.so.3 => /lib/libthr.so.3 (0x8012f5000)


isql now gives a Connected prompt.

Can this patch be included in the port.

Richard
Comment 9 Richard van Vliet 2021-10-20 15:45:06 UTC
I have reported this also to upstream here : https://jira.mariadb.org/browse/ODBC-340

Richard
Comment 10 Richard van Vliet 2021-10-21 15:42:14 UTC
Hi Upstream has accepted the bug and marked is for fix in 3.1.14

Cloud this patch be included in the current port until it is upgraded.


Upstream issue
https://jira.mariadb.org/browse/ODBC-340