Bug #6418 libmysqlclient_r.so needs to be linked with -lz
Submitted: 3 Nov 2004 23:27 Modified: 12 Jan 2005 19:59
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.7 OS:Linux (Fedora Core 3)
Assigned to: Jim Winstead CPU Architecture:Any

[3 Nov 2004 23: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 22:10] Hartmut Holzgraefe
see also bug #7021
[5 Jan 2005 2:12] Jim Winstead
Added ZLIB_LIBS to libmysql_r/Makefile.am
[12 Jan 2005 19:59] Paul DuBois
No documentation change needed.