Bug #959 libmysqld not being compiled properly
Submitted: 30 Jul 2003 9:55 Modified: 6 Aug 2003 4:49
Reporter: Brian Aker Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S1 (Critical)
Version:All OS:RPM
Assigned to: Lenz Grimmer

[30 Jul 2003 9:55] Brian Aker
Description:
Currently libmysqld is not being compiled as a proper library, this means that you can not use it in applications like Apache or anything that might load it.

IRC log:
<brian> LenZ:  You there, myself and hf are discussing an issue with binaries that may just be a build issue.
<LenZ> I'm here
<brian> Problem, the rpm's for 4.0 for the embedded library are not compiled correctly.
<brian> I am getting __builtin_new symbols in them.
<LenZ> hmm
<LenZ> so how can we get rid of this one?
<brian> strings libmysqld.a | grep builtin
<LenZ> I am not aware of any compile error - I compile the embeeded server along with the standard binary
<brian> That will tell you which binaries are bad.
<LenZ> but it does not tell my why :)
<brian> Are you compiling with -shared?
<LenZ> no
<brian> From talking to hf, the binaries he builds for himself are being compiled/linked correctly.
<brian> And he is doing it on Linux.
<LenZ> Have a look at support-files/mysql.spec.sh to see how it's compiled.
<LenZ> the embedded library is built along with the standard mysql binary, which is configured with "--disable-shared" and "-all-static" ldflags.
<brian> There must be another flag...
<LenZ> check it for yourself, the RPM spec file includes a function called BuildMySQL, which includes the common compile flags.
<brian> Yeah, I am looking at that.
<LenZ> It is being called twice, with some additional options: once for mysqld-max and for the standard mysqld
<brian> hmmm where is the client library being built?
<brian> Since it is being compiled correctly.
<LenZ> the second call builds the standard mysqld (included in MySQL-server)
<LenZ> brian: the client lib is built along with mysql-max, IIRC.
<LenZ> as it includes the --enable-shared option
<brian> Then mysqld needs to be build the same way.
<LenZ> they are being tarred up before the build restarts to create the standard mysqld
<LenZ> should the embedded library rather be built along with the shared libs?
<brian> Yes, or more to the point it needs to be build shared.
<brian> The current binary we are shipping for libmysqld can not be used with any library that will be dlopen(), so... No Apache, No perl...
<LenZ> actually, it seems like it's being built both times
<LenZ> but as the standard binary is built last, it will overwrite the first one I guess.

How to repeat:
strings libmysqld.a | grep builtin

We should probably check all versions that we are shipping to make sure that we are getting this right. 

Suggested fix:
See IRC log in description.
[6 Aug 2003 4:49] Lenz Grimmer
I've now fixed this in the 4.0 tree:

ChangeSet@1.1560.1.1, 2003-08-06 11:42:48+02:00, lenz@mysql.com
  Some fixes for the RPM spec file:

   - Fixed BUG#959 (libmysqld not being compiled properly)
   - Fixed BUG#998 (RPM build errors): added missing files to the
     distribution (mysql_fix_extensions, mysql_tableinfo, mysqldumpslow,
     mysql_fix_privilege_tables.1), removed "-n" from %install section.