Bug #28569 libmysqlclient contains libz in MySQL-devel-community-5.0.41-0.rhel4.x86_64.rpm
Submitted: 21 May 2007 17:08 Modified: 18 Feb 2008 18:54
Reporter: Iain Frerichs Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.0.41 OS:Linux (RHEL4 x86_64)
Assigned to: Assigned Account CPU Architecture:Any

[21 May 2007 17:08] Iain Frerichs
Description:
When compiling client programs using the libs as per the mysql_config --libs command, duplicate symbols are found for various functions from zlib.

The command gives -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm

but both libz.a and libmysqlclient.a contain the following objects:

infback.o
zutil.o
crc32.o
compress.o
inflate.o
inftrees.o
inffast.o
trees.o
adler32.o
deflate.o
uncompr.o
gzio.o

I note that the libmysqlclient.a in both the 5.0.27 an 5.0.23 rpms (which I have to had) omitted these objects.

How to repeat:
Compile a client program.

I tried building the php-mysql module from a php-5.2.2 source RPM.

I have seen reports that this has affected users of Enterprise (5.0.40) as well:
http://www.jasonlitka.com/2007/05/05/upgrading-to-php-522-on-rhel-and-centos-4/

Suggested fix:
I can fix this by either:

1. Remove -lz from the flags provided by mysql_config by editing the file

or

2. Remove the offending zlib stuff from libmysqlclient.a using 
ar d /usr/lib64/mysql/libmysqlclient.a adler32.o compress.o c
rc32.o deflate.o gzio.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr
.o zutil.o
[20 Jun 2007 21:14] Hartmut Holzgraefe
The library from MySQL-devel-community-5.0.41-0.rhel4.x86_64.rpm does indeed contain those zlib object files (checked with "ar t libfile"), a self compiled package (using BUILD/compile-amd64-debug-max) doesn't though

looks like a problem with the RPM building process?
[17 Aug 2007 9:27] Filimon Roukoutakis
Hi, I encounter this also on RHEL4 i386 community RPMS for 5.0.41 and 5.0.45, in particular the linker messages are like this:

/usr/lib/mysql/libz.a(adler32.o)(.text+0x0): In function `adler32':
/data1/mysqldev/tmp-200707041150-5.0.45-27425/rpm/BUILD/mysql-5.0.45/zlib/adler32.c:61: multiple definition of `adler32'
/usr/lib/mysql/libmysqlclient.a(adler32.o)(.text+0x0):/data1/mysqldev/tmp-200707041150-5.0.45-27425/rpm/BUILD/mysql-5.0.45/zlib/adler32.c:61: first defined here
/usr/lib/mysql/libz.a(adler32.o)(.text+0x26d): In function `adler32_combine':
/data1/mysqldev/tmp-200707041150-5.0.45-27425/rpm/BUILD/mysql-5.0.45/zlib/adler32.c:132: multiple definition of `adler32_combine'
/usr/lib/mysql/libmysqlclient.a(adler32.o)(.text+0x26d):/data1/mysqldev/tmp-200707041150-5.0.45-27425/rpm/BUILD/mysql-5.0.45/zlib/adler32.c:132: first defined here

Seems like indeed a problem with the RPM packaging. cheers,

filimon
[1 Feb 2008 14:16] Helmut Wirth
I have this problem, too, after building mysql-5.1.22-rc (community) on RHEL3 (i386) from the official mysql src.rpm for this platform. Is someone working on a fix?
[18 Feb 2008 18:54] Timothy Smith
Duplicate of 34231.