MySQL Forums
Forum List  »  Source, Builds, Binaries

Building MySQL 5.0.22 with gcc 2.95.2 on sparc-sun-solaris2.8
Posted by: Troy Loveday
Date: July 06, 2006 04:50PM

I'm having problems building MySQL 5.0.22 with gcc 2.95.2 on sparc Solaris 2.8 (SunOS 5.8).

(The binary MySQL distribution for this platform is built with the Sun C compiler, but the Perl I must use for DBI and DBD::mysql is built with gcc. This difference causes problems when trying to build DBD::mysql.)

My configure command is:

CC=gcc CFLAGS="-O3" \
CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" \
./configure \
--prefix=/home/troyl/local/mysql \
--enable-assembler \
--with-mysqld-ldflags=-all-static \
;

The configure script overrides --with-named-thread if it finds shared libs.
From configure.in:

# Hack for Solaris >= 2.5
# We want both the new and the old interface

if test "$with_named_thread" = "no"
then
AC_MSG_CHECKING("Solaris threads")
if test -f /usr/lib/libpthread.so -a -f /usr/lib/libthread.so
then
with_named_thread="-lpthread -lthread"
AC_MSG_RESULT("yes")
else
AC_MSG_RESULT("no")
fi
fi

Also, MYSQL_EXTRA_LDFLAGS is added to mysql_tzinfo_to_sql_LDADD.
From sql/Makefile.in:

mysql_tzinfo_to_sql_LDADD = @MYSQLD_EXTRA_LDFLAGS@ $(LDADD) $(CXXLDFLAGS)

These two cause the make to fail in the sql/ subdirectory when linking mysql_tzinfo_to_sql because gcc is called with '-static', '-lthread', and '-lpthread':

/bin/bash ../libtool --preserve-dup-deps --tag=CXX --mode=link gcc -DDBUG_OFF -O3 -felide-constructors -fno-exceptions -fno-rtti -fno-implicit-templates -fno-exceptions -fno-rtti -D_FILE_OFFSET_BITS=64 -DHAVE_CURSES_H -I/home/troyl/local/src/mysql-5.0.22/include -DHAVE_RWLOCK_T -DUSE_PRAGMA_IMPLEMENTATION -o mysql_tzinfo_to_sql mysql_tzinfo_to_sql.o -all-static ../myisam/libmyisam.a ../myisammrg/libmyisammrg.a ../heap/libheap.a ../vio/libvio.a ../mysys/libmysys.a ../dbug/libdbug.a ../regex/libregex.a ../strings/libmystrings.a ../zlib/libz.la -lpthread -lthread -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lpthread -lthread
gcc -DDBUG_OFF -O3 -felide-constructors -fno-exceptions -fno-rtti -fno-implicit-templates -fno-exceptions -fno-rtti -D_FILE_OFFSET_BITS=64 -DHAVE_CURSES_H -I/home/troyl/local/src/mysql-5.0.22/include -DHAVE_RWLOCK_T -DUSE_PRAGMA_IMPLEMENTATION -o mysql_tzinfo_to_sql mysql_tzinfo_to_sql.o -static ../myisam/libmyisam.a ../myisammrg/libmyisammrg.a ../heap/libheap.a ../vio/libvio.a ../mysys/libmysys.a ../dbug/libdbug.a ../regex/libregex.a ../strings/libmystrings.a ../zlib/.libs/libz.a -lpthread -lthread -lpthread -lthread -lpthread -lthread -lpthread -lthread -lpthread -lthread -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lpthread -lthread
ld: fatal: library -lpthread: not found
ld: fatal: library -lthread: not found
ld: fatal: library -lpthread: not found
ld: fatal: library -lthread: not found
ld: fatal: library -lpthread: not found
ld: fatal: library -lthread: not found
ld: fatal: library -lpthread: not found
ld: fatal: library -lthread: not found
ld: fatal: library -lpthread: not found
ld: fatal: library -lthread: not found
ld: fatal: library -lposix4: not found
ld: fatal: library -lpthread: not found
ld: fatal: library -lthread: not found

Does anyone have any idea what I'm doing wrong here?

Thanks for your time.

Options: ReplyQuote


Subject
Views
Written By
Posted
Building MySQL 5.0.22 with gcc 2.95.2 on sparc-sun-solaris2.8
2795
July 06, 2006 04:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.