Sunday, July 31, 2005

Problem installing MySQL 4.1.13 on Mac OS X 10.4.2

Bug report filed with : http://bugs.mysql.com/bug.php?id=12288

Here's the bug description:
Trying to compile MySQL 4.1.13 on  10.4.2
gcc_select show gcc 4.0.0:
$ gcc_select
Current default compiler:
gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)

$ locate gcc_s
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/libgcc_s.dylib
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/libgcc_static.a
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/libgcc_s_ppc64.dylib
/usr/sbin/gcc_select
/usr/share/man/man8/gcc_select.8


The build fails with:
...
Making all in sql
if g++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr/local/mysql\""
-DDATADIR="\"/usr/local/mysql/var\""
-DSHAREDIR="\"/usr/local/mysql/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I..
-I../innobase/include -I../include -I../include -I../regex -I. -O3
-DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti
-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE
-DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -MT gen_lex_hash.o -MD -MP -MF
".deps/gen_lex_hash.Tpo" -c -o gen_lex_hash.o gen_lex_hash.cc; then mv -f ".deps/gen_lex_hash.Tpo" ".deps/gen_lex_hash.Po"; else rm -f
".deps/gen_lex_hash.Tpo"; exit 1; fi
/bin/sh ../libtool --preserve-dup-deps --mode=link g++ -O3 -DDBUG_OFF
-fno-implicit-templates -fno-exceptions -fno-rtti -DHAVE_DARWIN_THREADS
-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ
-DIGNORE_SIGHUP_SIGQUIT -o gen_lex_hash gen_lex_hash.o ../myisam/libmyisam.a
../myisammrg/libmyisammrg.a ../heap/libheap.a ../vio/libvio.a
../mysys/libmysys.a ../dbug/libdbug.a ../regex/libregex.a
../strings/libmystrings.a -lz -lm
mkdir .libs
g++ -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti
-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE
-DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -o gen_lex_hash gen_lex_hash.o
-Wl,-bind_at_load ../myisam/libmyisam.a ../myisammrg/libmyisammrg.a
../heap/libheap.a ../vio/libvio.a ../mysys/libmysys.a ../dbug/libdbug.a
../regex/libregex.a ../strings/libmystrings.a -lz -lm
/usr/bin/ld: can't locate file for: -lgcc_s
collect2: ld returned 1 exit status
make[2]: *** [gen_lex_hash] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

How to repeat:
Use source distribution mysql-4.1.13.tar.gz

$ tar xfvz mysql-4.1.13.tar.gz
$ cd mysql-4.1.13
$ ./configure --prefix=/usr/local/mysql
$ make

Build fails.

Suggested fix:
None known yet.


1 comment:

py_genetic said...

This error is driving me insane, I've tried all the fixes however ld will not select libs. OSX 10.4.8 intel, gcc 4.0.1.

I get the exact same error cant find -lx x=any lib, horrible.

It appears that is a problem with 10.4 maybe apple knows.

Try setting LD_LIBRARY_PATH env var to the lib dir

Try MACOSX_DEPLOYMENT_TARGET env = 10.4