This worklog has been replaced with mariadb.org/jira

This site is here for historical purposes only. Do not add or edit tasks here!

 
 
 

WorkLog Frontpage Log in / Register
High-Level Description | Task Dependencies | High-Level Specification | Low-Level Design | File Attachments | User Comments | Time Estimates | Funding and Votes | Progress Reports

 Extend build to create a shared libmysqld.so library
Title
Task ID74
Queue
Version
Status
Priority
Copies toSergei
Monty
ColinCharles

Created byKnielsen22 Jan 2010Done
Supervisor   
Lead Architect    
Architecture Review  
Implementor  
Code Review  
QA  
Documentation  
 High-Level Description
Currently, the embedded library libmysqld is only built as a static library,
libmysqld.a.

However, there is also a need for a shared embedded library, libmysqld.so.

A good example is Amarok, which is now using MySQL (and by default an embedded
libmysqld) for storing the user's music collection. Amarok is designed to load
a number of modules as .so plugins, and the code using libmysqld is one such
plugin. Any code that is to be loaded as a shared object on Linux must be
built with -fPIC (position independent code). Any library used must thus also
be built with -fPIC and preferably itself be linked statically.

Amarok is a widely used application (end-user desktop). It could be a good
leverage for making libmysqld more popular eg. in distros. However, currently
the distros need to resort to various hacks to make things work with libmysqld
and Amarok. Some links:

Fedora patches .spec to add -fPIC in the build, extract all objects from
libmysqld.a, and re-link them as libmysqld.so.

    http://cvs.fedoraproject.org/viewvc/devel/mysql/mysql.spec?r1=1.108&r2=1.109

Gentoo apparently have a patch for MySQL to build libmysqld.so:

    http://bugs.gentoo.org/attachment.cgi?id=188057

Debian seems to suggest building both libmysqld.a and libmysqld_pic.a, the
latter to be used for shared objects linking with embedded server:

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508406#52

It would be nice if the main build system was able to build properly
libmysqld.so, so different distros would not need to resort to different hacks
to get things working.

The normal way to build both .a and .so as far as I know is to use libtool; it
will then build each object twice (with and without -fPIC) if needed. This one
might want to make optional to reduce build times. It would also need to be
done for each storage engine.

An alternative would be to build everything with -fPIC. This should probably
be optional also, as on some architectures (ELF x86 32-bit), there is some
speed penalty for -fPIC. The libmysqld.so would then be made only in this
case. Distro packages could do a separate build with -fPIC to make
libmysqld.so (to not get -fPIC into the main server code).

There is a MySQL bug for this:

    http://bugs.mysql.com/bug.php?id=39288
 Task Dependencies
Others waiting for Task 74Task 74 is waiting forGraph
 
 High-Level Specification
This will be implemented by using libtool to build libmysqld, as well as all
included libraries: libmysys, libstrings, libvio, libdbug, libregex, and all
the statically linked storage engines.

However, at least in stable 5.1, we do not want to introduce .so versions of
these libraries (even though it would be beneficial for code size), as we do
not want to break existing build scripts etc. So we build them as libtool
convenience libraries (nodist_LTLIBRARIES=...).

The current MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS facility is hard to
support in a libtool build. Instead, we replace this with a generic facility
to supply different object file for storage engines in normal and embedded
server. This way, storage engines that previously depended on
MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS can instead build two different
library objects with appropriate build options for each.
 Low-Level Design
 File Attachments
 NameTypeSizeByDate
 User Comments
 Time Estimates
NameHours WorkedLast Updated
Total0 
 Hrs WorkedProgressCurrentOriginal
This Task04040
Total04040
 
 Funding and Votes
Votes: 0: 0%
 Make vote: Useless    Nice to have    Important    Very important    

Funding: 0 offers, total 0 Euro
 Progress Reports
(Knielsen - Wed, 17 Nov 2010, 15:26
    
High-Level Specification modified.
--- /tmp/wklog.74.old.28072	2010-11-17 15:26:51.000000000 +0000
+++ /tmp/wklog.74.new.28072	2010-11-17 15:26:51.000000000 +0000
@@ -1,16 +1,17 @@
-One approach that was discussed was the following:
+This will be implemented by using libtool to build libmysqld, as well as all
+included libraries: libmysys, libstrings, libvio, libdbug, libregex, and all
+the statically linked storage engines.
 
-The libmysqld/Makefile.am rule that makes libmysqld.a does so by taking all
-the different .a files myisam, mysys, etc), extracting all the .o files, and
-re-packing them as a single libmysqld.a. This is for convenience so users can
-link with a -lmysqld and get everything needed.
+However, at least in stable 5.1, we do not want to introduce .so versions of
+these libraries (even though it would be beneficial for code size), as we do
+not want to break existing build scripts etc. So we build them as libtool
+convenience libraries (nodist_LTLIBRARIES=...).
 
-A similar approach could be used to make libmysqld.so. This would only work if
--fPIC was part of the compiler flags. If so, the Makefile could similarly
-extract all the object files, and link them into a single libmysqld.so file.
-
-This would then require package scripts to do two builds, one with -fPIC and
-one without. The libmysqld.so would then be taken from the build with -fPIC,
-and the rest of stuff would come from the build without.
+The current MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS facility is hard to
+support in a libtool build. Instead, we replace this with a generic facility
+to supply different object file for storage engines in normal and embedded
+server. This way, storage engines that previously depended on
+MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS can instead build two different
+library objects with appropriate build options for each.
 
 

(Knielsen - Wed, 17 Nov 2010, 15:20
    
Status updated.
--- /tmp/wklog.74.old.27514	2010-11-17 15:20:17.000000000 +0000
+++ /tmp/wklog.74.new.27514	2010-11-17 15:20:17.000000000 +0000
@@ -1,2 +1,2 @@
-Code-Review
+Complete
 

(Sergei - Thu, 16 Sep 2010, 13:04
    
Status updated.
--- /tmp/wklog.74.old.8467	2010-09-16 13:04:53.000000000 +0000
+++ /tmp/wklog.74.new.8467	2010-09-16 13:04:53.000000000 +0000
@@ -1,2 +1,2 @@
-In-Progress
+Code-Review
 

(Sergei - Thu, 16 Sep 2010, 13:04
    
Code Review updated:  -> Sergei

(Sergei - Thu, 09 Sep 2010, 10:03
    
Status updated.
--- /tmp/wklog.74.old.29242	2010-09-09 10:03:25.000000000 +0000
+++ /tmp/wklog.74.new.29242	2010-09-09 10:03:25.000000000 +0000
@@ -1,2 +1,2 @@
-Assigned
+In-Progress
 

(Knielsen - Thu, 09 Sep 2010, 08:37
    
Category updated.
--- /tmp/wklog.74.old.27402	2010-09-09 08:37:54.000000000 +0000
+++ /tmp/wklog.74.new.27402	2010-09-09 08:37:54.000000000 +0000
@@ -1,2 +1,2 @@
-Server-BackLog
+Server-Sprint
 

(Knielsen - Thu, 09 Sep 2010, 08:37
    
Version updated.
--- /tmp/wklog.74.old.27402	2010-09-09 08:37:54.000000000 +0000
+++ /tmp/wklog.74.new.27402	2010-09-09 08:37:54.000000000 +0000
@@ -1,2 +1,2 @@
-Server-9.x
+Server-5.1
 

(Knielsen - Thu, 09 Sep 2010, 08:37
    
Status updated.
--- /tmp/wklog.74.old.27402	2010-09-09 08:37:54.000000000 +0000
+++ /tmp/wklog.74.new.27402	2010-09-09 08:37:54.000000000 +0000
@@ -1,2 +1,2 @@
-Un-Assigned
+Assigned
 

(Knielsen - Thu, 09 Sep 2010, 08:37
    
Implementor updated:  -> Knielsen

(Sergei - Thu, 09 Sep 2010, 08:26
    
updated estimates
Worked 0 hours and estimate 40 hours remain (original estimate increased by 40 hours).
-- View All Progress Notes (14 total) --


Report Generator:
 
Saved Reports:

WorkLog v4.0.0
  © 2010  Sergei Golubchik and Monty Program AB
  © 2004  Andrew Sweger <yDNA@perlocity.org> and Addnorya
  © 2003  Matt Wagner <matt@mysql.com> and MySQL AB