Shared libmysqld for embedded MySQL / MariaDB is back

A little introduction about the problem: When trying to build the embedded MySQL (and MariaDB) library, the build system produced a static linked instead of a shared library (libmysqld.a instead of which caused build failures (on 64bit systems only, it doesn’t affect 32bit) to all applications that depend on the shared library, most importantly Amarok. There was a dirty workaround for this though, export CFLAGS="-fPIC" before building MySQL and Amarok. This is very nasty though, as Robin explains, although most distros chose that way. The other option would be to disable the embedded feature from Amarok and force users to use an external MySQL instance instead. As a result, this led up to lots of argues, flames and yelling. After some time, three Gentoo Developers (Diego E. Petteno, Jorge Manuel B.S. Vicetto and Robin H. Johnson) managed to create a patch for MySQL 5.0 series that could produce a shared library, and while it was reported upstream, it got stuck somewhere in the middle and never made it to MySQL’s source code.

With the release of MySQL 5.1 we had to face the same problem, but it was twice as hard to deal with our users, as MySQL 5.1 got a fast stabilization because of security bugs, and the KDE Team suddenly got a million of complaints about a regression in Amarok. After some time, Maciej Mrozowski took the old patch over over and did a significant step in getting it ported to MySQL 5.1.51, creating a patch that while it creates a shared library it failed all tests. Out of the sudden, MariaDB developer Kristian Nielsen left a reply on our bug report that he committed a patch to MariaDB based on ours, and with his precious help on IRC we were able to have a working patch for MySQL and MariaDB as well, with the MySQL one reported upstream again. Let’s hope that this time it will be accepted, we don’t want to go through this again :) MariaDB will have the shared library patch in their next release,

In Gentoo land, MySQL 5.1.51 and Amarok 2.3.2-r1 will be stabilized soon (because of security bug 339717). The only blocker is bug 335995. Gentoo users can normally put dev-db/mysql-5.1.51 and media-sound/amarok-2.3.2-r1 in their /etc/portage/package.keywords file and enjoy the default embedded USE flag (by popular demand).

Bug reports:


Powered by Blogilo

5 Responses to Shared libmysqld for embedded MySQL / MariaDB is back

  1. Sander Knopper says:

    Wow, nice job!

    – A proud Gentoo user 😉

  2. Toralf Förster says:


    seems that currently embedded isn’t in the default USE flag set, isn’t it ?

  3. Toralf Förster says:

    Ah, the IUSE flag was meant – I interpreted the term “default USE flag” in that manner that the (desktop) profile has it as default.


Leave a Reply