Bug #59104 Unresolved function references in embedded library
Submitted: 21 Dec 2010 22:18 Modified: 23 Dec 2010 20:53
Reporter: [ name withheld ] Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S3 (Non-critical)
Version:5.5.8 OS:Linux (Fedora 13 x86_64)
Assigned to: CPU Architecture:Any

[21 Dec 2010 22:18] [ name withheld ]
I tried to convert libmysqld.a to a shared library.  This exposed several undefined references in it:

libmysqld.so.0: undefined reference to `Slave_reporting_capability::report(loglevel, int, char const*, ...) const'
libmysqld.so.0: undefined reference to `Relay_log_info::slave_close_thread_tables(THD*)'
libmysqld.so.0: undefined reference to `Relay_log_info::Relay_log_info(bool)'

I was able to work around that by removing sql_binlog.cc.o and rpl_utility.cc.o from the library link; but I imagine that at some point somebody's going to want to use functions from those modules in an embedded app, and it's not gonna work for them.  Alternatively, if those modules aren't meant to be supported in embedded usage, why are they being included in libmysqld.a?

How to repeat:
I'm building the shlib using this recipe in a finished build tree:

mkdir libmysqld/work
cd libmysqld/work
ar -x ../libmysqld.a
gcc $CFLAGS $LDFLAGS -shared -Wl,-soname,libmysqld.so.0 -o libmysqld.so.0.0.1 \
	*.o ../../probes_mysql.o \
	-lpthread -laio -lcrypt -lssl -lcrypto -lz -lrt -lstdc++ -ldl -lm -lc

That works as far as it goes, but as soon as you try to link it against an example program, you get the failures mentioned above.
[23 Dec 2010 20:53] Sveta Smirnova
Thank you for the report.

This is looks like duplicate of bug #39288 for me, because any third-party receipt to create shared library from libmysqld.a can not be treated as MySQL bug.