error: compile 64 bit mysql on Solaris 10

I'm trying to build 64 bit mysql-5.0.37 on Solaris 10.

CFLAGS="-O3" CXX='gcc -m64 -mcpu=v9' CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure -disable-shared --prefix=/usr/local/mysql --datadir=/home1/mysql_data --with-mysqld-user=mysql

LD_LIBRARY_PATH=/usr/lib/sparcv9:/usr/local/lib/sparcv9:/usr/ccs/lib/sparcv9:/usr/sfw/lib/sparcv9

The make goes for a long time then. Although I see that I have 2 ELFCLASS32 but the error is failing after that on ld: fatal: Symbol referencing errors. No output written to mysql_tzinfo_to_sqlcollect2: ld returned 1 exit status.

I'm using ccs/bin/make. I don't know where to get 64 bit libraries for those two files, but what is the Symbol referencing errors?

Thank you

-------------------------------------------
ld: warning: file ../mysys/libmysys.a(my_init.o): wrong ELF class: ELFCLASS32
ld: warning: file ../strings/libmystrings.a(strmake.o): wrong ELF class: ELFCLASS32
Undefined first referenced
symbol in file
my_init mysql_tzinfo_to_sql.o
init_alloc_root mysql_tzinfo_to_sql.o
alloc_root mysql_tzinfo_to_sql.o
my_dirend mysql_tzinfo_to_sql.o
my_fclose mysql_tzinfo_to_sql.o
my_dir mysql_tzinfo_to_sql.o
my_progname mysql_tzinfo_to_sql.o
strmake mysql_tzinfo_to_sql.o
free_root mysql_tzinfo_to_sql.o
my_fopen mysql_tzinfo_to_sql.o
my_fread mysql_tzinfo_to_sql.o
ld: fatal: Symbol referencing errors. No output written to mysql_tzinfo_to_sql
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `mysql_tzinfo_to_sql'
Current working directory /home1/users/cross/packages/UnpackedDownloads/mysql-5.0.37/sql
*** Error code 1
The following command caused the error:
failcom='exit 1'; \
for f in x $MAKEFLAGS; do \
case $f in \
*=* | --[!k]);; \
*k
) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
list='share'; for subdir in $list; do \
echo "Making $target in $subdir"; \
if test "$subdir" = "."; then \
dot_seen=yes; \
local_target="$target-am"; \
else \
local_target="$target"; \
fi; \
(cd $subdir && make $local_target) \
|| eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
make "$target-am" || exit 1; \
fi; test -z "$fail"
make: Fatal error: Command failed for target `all-recursive'
Current working directory /home1/users/cross/packages/UnpackedDownloads/mysql-5.0.37/sql
*** Error code 1
make: Fatal error: Command failed for target `all'
Current working directory /home1/users/cross/packages/UnpackedDownloads/mysql-5.0.37/sql
*** Error code 1
The following command caused the error:
failcom='exit 1'; \
for f in x $MAKEFLAGS; do \
case $f in \
*=* | --[!k]);; \
*k
) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
list='. include Docs zlib cmd-line-utils sql-common pstack strings mysys dbug extra regex innobase myisam myisammrg heap vio sql libmysql client scripts man tests netware sql-bench mysql-test support-files server-tools'; for subdir in $list; do \
echo "Making $target in $subdir"; \
if test "$subdir" = "."; then \
dot_seen=yes; \
local_target="$target-am"; \
else \
local_target="$target"; \
fi; \
(cd $subdir && make $local_target) \
|| eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
make "$target-am" || exit 1; \
fi; test -z "$fail"
make: Fatal error: Command failed for target `all-recursive'
Current working directory /home1/users/cross/packages/UnpackedDownloads/mysql-5.0.37
*** Error code 1
make: Fatal error: Command failed for target `all'