Bug #6418 libmysqlclient_r.so needs to be linked with -lz
Submitted: 4 Nov 2004 0:27 Modified: 12 Jan 2005 20:59
Reporter: [ name withheld ]
Status: Closed
Category:Server Severity:S3 (Non-critical)
Version:4.1.7 OS:Linux (Fedora Core 3)
Assigned to: Jim Winstead Target Version:

[4 Nov 2004 0:27] [ name withheld ]
Description:
I find that libmysqlclient_r.so is linked with the library options "-lpthread -lcrypt
-lnsl -lm -lpthread", while libmysqlclient.so is linked with "-lcrypt -lnsl -lm -lz". 
The lack of -lz for libmysqlclient_r.so causes "compress" and "uncompress" to show as
undefined symbols when a client tries to use that library.

How to repeat:
1. Build with "--enable-shared --enable-thread-safe-client".

2. ldd -r libmysqlclient_r.so.14.0.0

3. Note undefined symbols and lack of dependency on libz.  Compare to output for
libmysqlclient.so.

Suggested fix:
I think this is because configure only inserts ZLIB_LIBS into NON_THREADED_CLIENT_LIBS;
is there a reason that zlib isn't just added to LIBS?
[5 Dec 2004 23:10] Hartmut Holzgraefe
see also bug #7021
[5 Jan 2005 3:12] Jim Winstead
Added ZLIB_LIBS to libmysql_r/Makefile.am
[12 Jan 2005 20:59] Paul DuBois
No documentation change needed.