Bug #16790 Compilation fails using Sun Studio compilers on file ha_archive.cc
Submitted: 25 Jan 2006 20:16 Modified: 9 Feb 2006 11:23
Reporter: Daniel Rugotzke Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.18 OS:Solaris (Solaris 9 SPARC)
Assigned to: CPU Architecture:Any

[25 Jan 2006 20:16] Daniel Rugotzke
Description:
I am using the following compilers:
CC -V
CC: Sun C++ 5.7 2005/01/07
cc -V
cc: Sun C 5.7 2005/01/07
f77 -V
NOTICE: Invoking /opt/SUNWspro/bin/f90 -f77 -ftrap=%none -V
f90: Sun Fortran 95 8.1 2005/01/07
gmake
GNU Make version 3.79.1,
Zlib
zlib 1.2.1

and this is the configuration steps I took:

setenv CC cc
setenv CXX CC
setenv F77 f77
setenv CFLAGS "-Xa -xstrconst -D_FORTEC_ -xarch=v8plusa -mt -I/usr/local/ssl/include"
setenv CXXFLAGS "-noex -mt -D_FORTEC_ -xarch=v8plusa -I/usr/local/ssl/include"
setenv ASFLAGS "-xarch=v8plusa"
./configure --prefix=/usr/local/mysql \
--with-extra-charsets=complex \
--enable-thread-safe-client \
--enable-local-infile \
--enable-assembler \
--with-libwrap=/usr/local/lib/ \
--with-mysqld-user=mysql \
--with-innodb \
--with-berkeley-db \
--with-ndbcluster \
--with-csv-storage-engine \
--with-example-storage-engine \
--with-blackhole-storage-engine \
--with-archive-storage-engine \
--with-vio --with-openssl \
--with-openssl-includes=/usr/local/ssl/include \
--with-openssl-libs=/usr/local/ssl/lib \
--with-named-z-libs=/usr/local/lib/libz.a
gmake

The compilation ends like this:

CC -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../bdb/build_unix -I../innobase/include -I../ndb/include -I../ndb/include/ndbapi -I../ndb/include/mgmapi -I../include -I../include -I../regex -I.  -I/usr/local/ssl/include    -DDBUG_OFF -noex -mt -D_FORTEC_ -xarch=v8plusa -I/usr/local/ssl/include   -D_FILE_OFFSET_BITS=64 -DHAVE_RWLOCK_T  -c -o ha_archive.o ha_archive.cc
"item_strfunc.h", line 158: Warning (Anachronism): Assigning extern "C" unsigned(*)(charset_info_st*,char*,unsigned,char*,unsigned) to unsigned(*)(charset_info_st*,char*,unsigned,char*,unsigned).
"item_strfunc.h", line 172: Warning (Anachronism): Assigning extern "C" unsigned(*)(charset_info_st*,char*,unsigned,char*,unsigned) to unsigned(*)(charset_info_st*,char*,unsigned,char*,unsigned).
"ha_archive.cc", line 236: Error: The function "zlibCompileFlags" must have a prototype.
"ha_archive.cc", line 363: Warning: table hides handler::table.
"ha_archive.cc", line 364: Warning: share hides ha_archive::share.
"ha_archive.cc", line 431: Warning: share hides ha_archive::share.
1 Error(s) and 5 Warning(s) detected.
gmake[4]: *** [ha_archive.o] Error 1
gmake[4]: Leaving directory `/tmp/MySQL/tmp/sql'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/tmp/MySQL/tmp/sql'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/tmp/MySQL/tmp/sql'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/tmp/MySQL/tmp'
gmake: *** [all] Error 2

The work around to compile mysql 5.0.18 is to NOT use --with-archive-storage-engine  in the configuration.

How to repeat:
Attempt complation using archive storage engine.
[9 Feb 2006 11:23] Valeriy Kravchuk
Thank you for a problem report. Sorry, but I was not able to repeat the problem you described on our Solaris 9 SPARC:

bash-2.05$ $CC -V
cc: Sun C 5.6 2004/07/15
usage: cc [ options] files.  Use 'cc -flags' for details
bash-2.05$ uname -a
SunOS butch 5.9 Generic_118558-09 sun4u sparc SUNW,UltraAX-i2

5.0.18 just compiled successfully on this machine using the following commands:

export PATH=/export/home/mysqldev/butch-64bit/bin:/opt/sfw/bin:/usr/sfw/bin:/usr/local/bin:/usr/bin:/usr/xpg4/bin:/usr/sbin:/usr/openwin/bin:/usr/dt/bin:/usr/ccs/bin:/usr/ucb:/opt/SUNWspro/bin

export CC=cc-5.0 CXX=CC ASFLAGS=-xarch=v9 CFLAGS="-xO3 -Xa -xstrconst -mt -D_FORTEC_ -xarch=v9" CXXFLAGS="-xO3 -noex -mt -D_FORTEC_ -xarch=v9" LDFLAGS=-xarch=v9

./configure --prefix=/users/vkravchuk/dbs/5.0-butch --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler
--with-named-curses-libs=-lcurses --with-innodb --with-archive-storage-engine

make

This is how it usually compiles (subset of options for compiling -Max verison of MySQL binaries). I have no machines to compile with other versions of Sun Studio on SPARC now.