mysql-4.1.11 / php-5.0.4: shared library / linker puzzles [Long]

Joseph E. Sacco, Ph.D. joseph_sacco at comcast.net
Sat Apr 9 15:05:10 MDT 2005


Puzzle solved:

	Welcome to the wonderful world of libtool.

		http://www.gnu.org/software/libtool/manual.html
		[when all else fails, Read The Fine Manual]

So what happened?

As mentioned in the previous post, the SRPM from MySQL creates RPM's
that install the shared mysql client libraries under /usr/lib and static
mysql client libraries under /usr/lib/mysql. I found this split annoying
because:

        (1) This split causes mischief and confusion [ask me].
        
        (2) This split does not occur when MySQL is built from the
        official MySQL tarball. Here, the default location for *all*
        mysql libraries, both static and shared, is 
        	
        	/usr/local/mysql/lib.

I had copied the shared mysql client libraries into /usr/lib/mysql to
put everything in one place.  I figured that whenever *anything* was
linked with

	-L /usr/lib/mysql -lmyslclient

the linker would pick up the shared version of the client library
first.  I was perplexed when that didn't happen when building the PHP
extension mysqli.so

So what's wrong?  Is the linker broken?  No...  It is doing exactly what
it was told to do, not what I wanted it to do [imfamous lament].

A review of the PHP build log shows that the PHP build uses libtool to
build the PHP extensions. Lurking around in /usr/lib/mysql is a libtool
file, 

	libmysqlclient.la 

that contains *directives* for libtool. Since /usr/lib/mysql originally
contained only static libraries, it is not surprising to learn that the
libtool file contains only directives for static libraries. Duh...

A little bit of editing transformed the libtool file into something what
would favor shared libraries.

Live and learn.


-Joseph

========================================================================


On Fri, 2005-04-08 at 18:08, Joseph E. Sacco, Ph.D. wrote:
> I have managed to get php-5.0.4 to load without our favorite PPC error
> rearing up its ugly head:
> 
>         PHP Warning:  PHP Startup: Unable to load dynamic library
>         '/usr/lib/php/modules/mysqli.so' -
>         /usr/lib/php/modules/mysqli.so: R_PPC_REL24 relocation at
>         0x0cbae510 for symbol `__stpcpy' out of range in Unknown on line
>         0
> 
> The workaround to eliminate this error is puzzling [at least to me].
> Maybe someone on the list can provide an insight into what's going on.
> 

-- 
joseph_sacco[at]comcast[dot]net



More information about the yellowdog-general mailing list