Bug #64386 libmysqlclient18 does not use symbol versioning
Submitted: 20 Feb 2012 20:18 Modified: 10 Dec 2012 17:07
Reporter: Steven Ayre Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5 OS:Linux
Assigned to: CPU Architecture:Any
Tags: libmysqlclient, libmysqlclient18, library, symbol, symbols, versioning, versions

[20 Feb 2012 20:18] Steven Ayre
Description:
In MySQL 5.1, libmysqlclient16 used versioned symbols.

In MySQL 5.5, libmysqlclient18 no longer uses versioned symbols.

This appears to be as a result of the move to cmake - the libmysql/libmysql.ver.in file is no longer used as the compiler is not given the -Wl,version-script option that were used when building previous versions.

How to repeat:
Compile MySQL 5.5 and examine the the symbols using 'objdump -T libmysqlclient.so.18.0.0'

Compare for example the my_connect symbols from libmysqlclient16:
000000000008dce0 g    DF .text  0000000000000144  libmysqlclient_16 my_connect
to libmysqlclient18:
0000000000039bd0 g    DF .text  0000000000000179  Base        my_connect

Suggested fix:
Use libmysql.ver.in to generate libmysql.ver and then use the -Wl,version-script ld flag, as in 5.1 under the previous build system.
[21 Feb 2012 6:50] Valeriy Kravchuk
Thank you for the problem report. Verified just as described:

[openxs@chief 5.5]$ objdump -T lib/libmysqlclient.so.18.0.0 | grep my_connect
0000000000035648 g    DF .text  00000000000001cc  Base        my_connect
[openxs@chief 5.5]$ objdump -T ../5.1/lib/mysql/libmysqlclient.so.16.0.0 | grep my_connect
00000000000b518c g    DF .text  00000000000000ef  libmysqlclient_16 my_connect
[14 Jun 2012 10:29] Nicholas Bamber
adding the necessary invocations

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: versioned_symbols.patch (text/x-patch), 841 bytes.

[10 Dec 2012 17:07] Paul DuBois
Noted in 5.6.8 changelog.

libmysqlclient did not use symbol versioning. Thanks to Nicholas
Bamber for the patch.