Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 606600 - dev-db/mysql-connector-c-6.1.6-r2 with dev-libs/openssl-1.1.0c - vio/viosslfactories.c:71:7: error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}'
Summary: dev-db/mysql-connector-c-6.1.6-r2 with dev-libs/openssl-1.1.0c - vio/viosslfa...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: openssl-1.1
  Show dependency tree
 
Reported: 2017-01-20 12:35 UTC by eroen
Modified: 2018-05-02 14:34 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-db/mysql-connector-c-6.1.6-r2:20170120-113135.log (mysql-connector-c-6.1.6-r2:20170120-113135.log,184.21 KB, text/plain)
2017-01-20 12:35 UTC, eroen
Details
0001-Don-t-use-deprecated-API-with-openssl-1.1.patch for 6.1.6 (0001-Don-t-use-deprecated-API-with-openssl-1.1.patch,7.06 KB, patch)
2017-01-20 15:08 UTC, eroen
Details | Diff
0001-Don-t-use-deprecated-API-with-openssl-1.1.patch for 6.1.9 (0001-Don-t-use-deprecated-API-with-openssl-1.1.patch,8.33 KB, patch)
2017-01-20 16:04 UTC, eroen
Details | Diff
emerge output for dev-db/mysql-connector-c-6.1.11-r1::gentoo (emerge_output.txt,102.89 KB, text/plain)
2018-03-26 08:41 UTC, bug2017
Details

Note You need to log in before you can comment on or make changes to this bug.
Description eroen 2017-01-20 12:35:11 UTC
Created attachment 460738 [details]
dev-db/mysql-connector-c-6.1.6-r2:20170120-113135.log

[ 72%] Building C object vio/CMakeFiles/vio.dir/viosslfactories.c.o
cd /var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src-abi_x86_32.x86/vio && /usr/bin/x86_64-pc-linux-gnu-gcc -m32 -DHAVE_CONFIG_H -DHAVE_OPENSSL -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src-abi_x86_32.x86/include -I/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/extra/rapidjson/include -I/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/include   -DNDEBUG -O0 -g -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement    -DNDEBUG -fPIC -o CMakeFiles/vio.dir/viosslfactories.c.o -c /var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c: In function 'get_dh2048':
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:69:11: warning: implicit declaration of function 'DH_new' [-Wimplicit-function-declaration]
   if ((dh=DH_new()))
           ^~~~~~
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:69:10: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
   if ((dh=DH_new()))
          ^
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:71:7: error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}'
     dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL);
       ^~
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:71:11: warning: implicit declaration of function 'BN_bin2bn' [-Wimplicit-function-declaration]
     dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL);
           ^~~~~~~~~
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:75:7: warning: implicit declaration of function 'DH_free' [-Wimplicit-function-declaration]
       DH_free(dh);
       ^~~~~~~
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c: In function 'ssl_start':
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:183:5: warning: implicit declaration of function 'SSL_library_init' [-Wimplicit-function-declaration]
     SSL_library_init();
     ^~~~~~~~~~~~~~~~
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:184:5: warning: implicit declaration of function 'OpenSSL_add_all_algorithms' [-Wimplicit-function-declaration]
     OpenSSL_add_all_algorithms();
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:191:5: warning: implicit declaration of function 'SSL_load_error_strings' [-Wimplicit-function-declaration]
     SSL_load_error_strings();
     ^~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c: In function 'new_VioSSLFd':
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:225:42: warning: implicit declaration of function 'TLSv1_client_method' [-Wimplicit-function-declaration]
                                          TLSv1_client_method() :
                                          ^~~~~~~~~~~~~~~~~~~
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:226:42: warning: implicit declaration of function 'TLSv1_server_method' [-Wimplicit-function-declaration]
                                          TLSv1_server_method())))
                                          ^~~~~~~~~~~~~~~~~~~
/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:224:42: warning: passing argument 1 of 'SSL_CTX_new' makes pointer from integer without a cast [-Wint-conversion]
   if (!(ssl_fd->ssl_context= SSL_CTX_new(is_client ?
                                          ^~~~~~~~~
In file included from /var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/include/violite.h:146:0,
                 from /var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/vio_priv.h:26,
                 from /var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src/vio/viosslfactories.c:16:
/usr/include/openssl/ssl.h:1302:17: note: expected 'const SSL_METHOD * {aka const struct ssl_method_st *}' but argument is of type 'int'
 __owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
                 ^~~~~~~~~~~
make[2]: *** [vio/CMakeFiles/vio.dir/build.make:135: vio/CMakeFiles/vio.dir/viosslfactories.c.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src-abi_x86_32.x86'
make[1]: *** [CMakeFiles/Makefile2:454: vio/CMakeFiles/vio.dir/all] Error 2
make[1]: Leaving directory '/var/tmp/portage/dev-db/mysql-connector-c-6.1.6-r2/work/mysql-connector-c-6.1.6-src-abi_x86_32.x86'
make: *** [Makefile:150: all] Error 2
 * ERROR: dev-db/mysql-connector-c-6.1.6-r2::gentoo failed (compile phase):
 *   emake failed
Comment 1 eroen 2017-01-20 13:22:15 UTC
It looks like upstream's version[0] is 6.1.9. That still doesn't work with openssl-1.1.0 though. :(

0: https://dev.mysql.com/downloads/connector/c/
Comment 2 eroen 2017-01-20 15:08:47 UTC
Created attachment 460752 [details, diff]
0001-Don-t-use-deprecated-API-with-openssl-1.1.patch for 6.1.6

With these patches, mysql-connector-c builds with openssl-1.1.0c. I have not tested with older openssl or libressl, but I don't think I broke anything.
Comment 3 eroen 2017-01-20 16:04:43 UTC
Created attachment 460754 [details, diff]
0001-Don-t-use-deprecated-API-with-openssl-1.1.patch for 6.1.9
Comment 4 bug2017 2018-03-26 08:41:40 UTC
Created attachment 525458 [details]
emerge output for dev-db/mysql-connector-c-6.1.11-r1::gentoo

The latest patch does not work against dev-db/mysql-connector-c-6.1.11-r1::gentoo anymore. It looks like there is a new DBUG_PRINT:

/var/tmp/portage/dev-db/mysql-connector-c-6.1.11-r1/work/mysql-connector-c-6.1.11-src/vio/viossl.c:430:44: error: dereferencing pointer to incomplete type ‘SSL_COMP {aka struct ssl_comp_st}’
         DBUG_PRINT("info", ("  %d: %s\n", c->id, c->name));
Comment 5 Larry the Git Cow gentoo-dev 2018-05-02 14:34:50 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d874ef4f478adbf245793017b1e6fc02f1e40a8

commit 5d874ef4f478adbf245793017b1e6fc02f1e40a8
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2018-05-02 14:34:28 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2018-05-02 14:34:28 +0000

    dev-db/mysql-connector-c: Add openssl-1.1 compatibility patch
    
    Closes: https://bugs.gentoo.org/606600
    Package-Manager: Portage-2.3.31, Repoman-2.3.9

 .../files/6.1.11-openssl-1.1.patch                 | 287 +++++++++++++++++++++
 .../mysql-connector-c-6.1.11-r1.ebuild             |   3 +-
 2 files changed, 289 insertions(+), 1 deletion(-)