List:General Discussion« Previous MessageNext Message »
From:jillian Date:November 1 2002 5:30pm
Subject:Possible bug when compiling MySQL using libz.so on Solaris 2.6
View as plain text  
>Description:

We are running MySQL 3.23.53 on Solaris 2.6. There seems to be a problem
with MySQL finding libz.so. A plain vanilla installation (using ./configure 
with no extra arguments) results in make carping and then exiting. We thought
we had a sort of workaround in passing the following arguments to ./configure
(using tcsh):

env LDFLAGS="-L/usr/local/lib -R/usr/local/lib" ./configure
--prefix=/usr/local/mysql-3.23.53
--with-client-ldflags="-R/usr/local/lib -L/usr/local/lib"
--with-mysqld-ldflags="-R/usr/local/lib -L/usr/local/lib"

Before running make, we set LDFLAGS again:

env LDFLAGS="-L/usr/local/lib -R/usr/local/lib" make

Ommitting this step resulted in MySQL compiling and installing; however,
trying to connect to the database using DBI failed as libz.so could not 
be found. This was remedied by explicitly setting the environment as above.

Running ldd in the mysql/lib/mysql directory produced the following
output:

 ldd /usr/local/mysql/lib/mysql/libmysqlclient.so.10.0.0
        libz.so =>       (file not found)              
        libsocket.so.1 =>        /usr/lib/libsocket.so.1                      
        libnsl.so.1 =>   /usr/lib/libnsl.so.1             
        libm.so.1 =>     /usr/lib/libm.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        /usr/platform/SUNW,Ultra-Enterprise/lib/libc_psr.so.1

This behaviour was finally corrected by editing the Makefile in the
libmysql installation subdirectory as follows:

LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@

was changed to 

LINK = env LD_RUN_PATH=/usr/local/lib $(LIBTOOL) --mode=link
$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@

Adding LD_RUN_PATH seems to have solved the problem once and for all.

The problem first occurred when trying to install MySQL 3.23.51; our previous version 
(3.23.41) was just fine.

>How-To-Repeat:

Attempt to install MySQL on Solaris 2.6 using libz.so without taking one or more of the
aforementioned steps.

>Fix:

See above.

>Submitter-Id:	<submitter ID>
>Originator: Jillian-Beth Stamos-Kaschke

>Organization: <Inter.net Germany GmbH>
>MySQL support: [none| email support | extended email support ]
>Synopsis:	<Installation probs when using libz.so on Solaris>
>Severity:	
>Priority:	
>Category:	mysql
>Class:		
>Release:	mysql-3.23.53 (Source distribution)

>Environment:
System: SunOS segfault 5.6 Generic_105181-33 sun4u sparc SUNW,Ultra-Enterprise
Architecture: sun4

Some paths:  /usr/local/bin/perl /usr/local/bin/make /usr/local/bin/gmake
/usr/local/bin/gcc
GCC: Reading specs from
/usr/local/gcc-2.95.3/lib/gcc-lib/sparc-sun-solaris2.6/2.95.3/specs
gcc version 2.95.3 20010315 (release)
Compilation info: CC='gcc'  CFLAGS=''  CXX='g++'  CXXFLAGS=''  LDFLAGS='-L/usr/local/lib
-R/usr/local/lib'
LIBC: 
-rw-r--r--   1 bin      bin      1621560 Sep 10 00:37 /lib/libc.a
lrwxrwxrwx   1 root     root          11 Jun  9  2000 /lib/libc.so -> ./libc.so.1
-rwxr-xr-x   1 bin      bin      1025548 Sep 10 00:37 /lib/libc.so.1
-rw-r--r--   1 bin      bin      1621560 Sep 10 00:37 /usr/lib/libc.a
lrwxrwxrwx   1 root     root          11 Jun  9  2000 /usr/lib/libc.so -> ./libc.so.1
-rwxr-xr-x   1 bin      bin      1025548 Sep 10 00:37 /usr/lib/libc.so.1
Configure command: ./configure --prefix=/usr/local/mysql-3.23.53
'--with-client-ldflags=-R/usr/local/lib -L/usr/local/lib'
'--with-mysqld-ldflags=-R/usr/local/lib -L/usr/local/lib' 'LDFLAGS=-L/usr/local/lib
-R/usr/local/lib'
Perl: This is perl, version 5.005_02 built for sun4-solaris
Thread
Possible bug when compiling MySQL using libz.so on Solaris 2.6jillian1 Nov