Bug #19900 mysql_config problems
Submitted: 18 May 2006 8:23 Modified: 18 Jan 2008 21:48
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.21 OS:Linux (gentoo-linux)
Assigned to: Hartmut Holzgraefe CPU Architecture:Any

[18 May 2006 8:23] [ name withheld ]
I have essentially the same problem as http://bugs.mysql.com/bug.php?id=5396, which was closed for 4.x but it seems to reappear on the 5.0 branch.
I have looked at the gentoo-ebuilds and patches and it does not seem to have something, which could be the cause of this behaviour.
mysql_config --libmysqld-libs returns:
-Wl,-O1 -Wl,--as-needed -L/usr/lib/mysql -lmysqld -lz -lpthread -lcrypt -lnsl -lm -lpthread -lrt
on mysqld built with ssl-support, as a result I have absolutely the same output as in the other bug - compilation against libmysqld.a fails with unresolved ssl-symbols, adding -lssl corrects the problem.
The other thing is that mysql_config should not return the linker flags -Wl,-O1 -Wl,--as-needed.
This is the configure line, with which mysql was built:
./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libexecdir=/usr/sbin --sysconfdir=/etc/mysql --localstatedir=/var/lib/mysql --sharedstatedir=/usr/share/mysql --libdir=/usr/lib/mysql --includedir=/usr/include/mysql --with-low-memory --enable-local-infile --with-mysqld-user=mysql --with-client-ldflags=-lstdc++ --enable-thread-safe-client --with-comment=Gentoo Linux mysql-5.0.21 --with-unix-socket-path=/var/run/mysqld/mysqld.sock --without-readline --without-docs --enable-shared --enable-static --without-libwrap --with-openssl --without-debug --with-server --with-extra-tools --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all --with-berkeley-db=./bdb --with-geometry --without-ndbcluster --without-big-tables --with-embedded-privilege-control --with-embedded-server --with-bench --enable-assembler --build=i686-pc-linux-gnu
if this helps.

How to repeat:
how to repeat 
mysql_config --libmysqld-libs

Suggested fix:
mysql_config should return the ssl-linker flags if it is built with ssl-support and filter all the other irrelevant-flags.
[18 Jan 2008 21:48] Hartmut Holzgraefe
Not an issue anymore in 5.0.51 and 5.1.22