Bug #27945 Problem while installing DBD::mysql on Solaris 10
Submitted: 19 Apr 2007 6:53 Modified: 20 Feb 2013 22:41
Reporter: Ramesh PS Email Updates:
Status: Unsupported Impact on me:
None 
Category:Connectors: DBD::mysql ( Perl ) Severity:S2 (Serious)
Version:4.004 OS:Solaris (Solaris 10 on SPARC)
Assigned to: CPU Architecture:Any
Tags: DBD::MySQL, dbdimp.o, gcc, mysql.o

[19 Apr 2007 6:53] Ramesh PS
Description:
Versions
--------
OS  : SunOS mfin-sol01 5.10 Generic_118833-17 sun4u sparc SUNW,UltraAX-i2
gcc : version 3.4.6
perl: Version 5.8.4 built for sun4-solaris-64int
perlgcc : Version 5.8.4 built for sun4-solaris-64int

DBD::mysql - Version 4.004
MySQL : version 4.0.24-log (Standard that came with Solaris)

Hi I am trying to install the DBD::mysql downloaded from CPAN website.

I am using perlgcc to compile using gcc.

====================================================
-bash-3.00# perlgcc Makefile.PL

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/sfw/include/mysql -xstrconst -mt
  embedded      (mysql_config) =
  libs          (mysql_config) = -R/usr/sfw/lib -R/usr/sfw/lib/mysql -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  ssl           (guessed     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) =
  testpassword  (default     ) =
  testsocket    (default     ) =
  testuser      (default     ) =

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Using DBI 1.54 (for perl 5.008004 on sun4-solaris-64int) installed in /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI/
Writing Makefile for DBD::mysql

========================================================

-bash-3.00# make

cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
gcc -c  -I/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI -I/usr/sfw/include/mysql -xstrconst -mt -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing    -DVERSION=\"4.004\"  -DXS_VERSION=\"4.004\" -fPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   dbdimp.c
gcc: language strconst not recognized
gcc: dbdimp.c: linker input file unused because linking not done
/usr/perl5/5.8.4/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI/Driver.xst > mysql.xsi
/usr/perl5/5.8.4/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp  -typemap /usr/perl5/5.8.4/lib/ExtUtils/typemap  mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 612
gcc -c  -I/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI -I/usr/sfw/include/mysql -xstrconst -mt -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing    -DVERSION=\"4.004\"  -DXS_VERSION=\"4.004\" -fPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   mysql.c
gcc: language strconst not recognized
gcc: mysql.c: linker input file unused because linking not done
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/sfw/lib:/usr/lib:/lib" /usr/perl5/5.8.4/bin/perl myld gcc  -G dbdimp.o  mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so   -R/usr/sfw/lib -R/usr/sfw/lib/mysql -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm

gcc: dbdimp.o: No such file or directory
gcc: mysql.o: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/DBD/mysql/mysql.so'
========================================================

How to repeat:
Need to download the DBD::mysql module version 4.004

On solaris 10 SPARC 64 Version, use

perlgcc Makefile.PL
make
[20 Apr 2007 11:34] Sveta Smirnova
Thank you for the report.

Verified as described.

Bug is repeatable only with bundled MySQL 4.0.24 which is in "Extended support" status. See also http://www.mysql.com/company/legal/lifecycle/ Because it I changed severity.

Workaround: link DBD::MySQL with current MySQL 5.0.
[20 Apr 2007 13:16] Ramesh PS
I installed mysql  5.0.37 package after removing existing mysql packages on solaris 10. But still having same problem.

mysql  5.0.37
perl   5.6.1
gcc version 3.4.6
Solaris 10 SPARC 64 bit
========================

-bash-3.00# cd DBD-mysql-4.004
-bash-3.00# perlgcc Makefile.PL
I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/opt/mysql/mysql/include -mt -D_FORTEC_ -xarch=v9
  embedded      (mysql_config) =
  libs          (mysql_config) = -xarch=v9 -L/opt/mysql/mysql/lib -lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  ssl           (guessed     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) =
  testpassword  (default     ) =
  testsocket    (default     ) =
  testuser      (default     ) =

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Checking if your kit is complete...
Looks good
Have /usr/perl5/5.6.1/lib/Sun/Solaris/PerlGcc/Config.pm expected /usr/perl5/5.6.1/lib/sun4-solaris-64int/Config.pm
Your perl and your Config.pm seem to have different ideas about the architecture
they are running on.
Perl thinks: [PerlGcc]
Config says: [sun4-solaris-64int]
This may or may not cause problems. Please check your installation of perl if you
have problems building this extension.
Unrecognized argument in LIBS ignored: '-xarch=v9'
Using DBI 1.54 (for perl 5.006001 on sun4-solaris-64int) installed in /usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI/
Writing Makefile for DBD::mysql
-bash-3.00# make
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
gcc -c -I/usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI -I/opt/mysql/mysql/include -mt -D_FORTEC_ -xarch=v9 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing    -DVERSION=\"4.004\"  -DXS_VERSION=\"4.004\" -fPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE  dbdimp.c
gcc: language arch=v9 not recognized
gcc: dbdimp.c: linker input file unused because linking not done
/usr/perl5/5.6.1/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI/Driver.xst > mysql.xsi
/usr/perl5/5.6.1/bin/perl -I/usr/perl5/5.6.1/lib/sun4-solaris-64int -I/usr/perl5/5.6.1/lib /usr/perl5/5.6.1/lib/ExtUtils/xsubpp  -typemap /usr/perl5/5.6.1/lib/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 612
gcc -c -I/usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI -I/opt/mysql/mysql/include -mt -D_FORTEC_ -xarch=v9 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing    -DVERSION=\"4.004\"  -DXS_VERSION=\"4.004\" -fPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE  mysql.c
gcc: language arch=v9 not recognized
gcc: mysql.c: linker input file unused because linking not done
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/opt/mysql/mysql/lib:/lib" /usr/perl5/5.6.1/bin/perl myld gcc  -G dbdimp.o  mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so   -L/opt/mysql/mysql/lib -lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm
gcc: dbdimp.o: No such file or directory
gcc: mysql.o: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/DBD/mysql/mysql.so'
[20 Apr 2007 13:16] Ramesh PS
I installed mysql  5.0.37 package after removing existing mysql packages on solaris 10. But still having same problem.

mysql  5.0.37
perl   5.6.1
gcc version 3.4.6
Solaris 10 SPARC 64 bit
========================

-bash-3.00# cd DBD-mysql-4.004
-bash-3.00# perlgcc Makefile.PL
I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/opt/mysql/mysql/include -mt -D_FORTEC_ -xarch=v9
  embedded      (mysql_config) =
  libs          (mysql_config) = -xarch=v9 -L/opt/mysql/mysql/lib -lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  ssl           (guessed     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) =
  testpassword  (default     ) =
  testsocket    (default     ) =
  testuser      (default     ) =

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Checking if your kit is complete...
Looks good
Have /usr/perl5/5.6.1/lib/Sun/Solaris/PerlGcc/Config.pm expected /usr/perl5/5.6.1/lib/sun4-solaris-64int/Config.pm
Your perl and your Config.pm seem to have different ideas about the architecture
they are running on.
Perl thinks: [PerlGcc]
Config says: [sun4-solaris-64int]
This may or may not cause problems. Please check your installation of perl if you
have problems building this extension.
Unrecognized argument in LIBS ignored: '-xarch=v9'
Using DBI 1.54 (for perl 5.006001 on sun4-solaris-64int) installed in /usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI/
Writing Makefile for DBD::mysql
-bash-3.00# make
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
gcc -c -I/usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI -I/opt/mysql/mysql/include -mt -D_FORTEC_ -xarch=v9 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing    -DVERSION=\"4.004\"  -DXS_VERSION=\"4.004\" -fPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE  dbdimp.c
gcc: language arch=v9 not recognized
gcc: dbdimp.c: linker input file unused because linking not done
/usr/perl5/5.6.1/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI/Driver.xst > mysql.xsi
/usr/perl5/5.6.1/bin/perl -I/usr/perl5/5.6.1/lib/sun4-solaris-64int -I/usr/perl5/5.6.1/lib /usr/perl5/5.6.1/lib/ExtUtils/xsubpp  -typemap /usr/perl5/5.6.1/lib/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 612
gcc -c -I/usr/perl5/site_perl/5.6.1/sun4-solaris-64int/auto/DBI -I/opt/mysql/mysql/include -mt -D_FORTEC_ -xarch=v9 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing    -DVERSION=\"4.004\"  -DXS_VERSION=\"4.004\" -fPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE  mysql.c
gcc: language arch=v9 not recognized
gcc: mysql.c: linker input file unused because linking not done
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/opt/mysql/mysql/lib:/lib" /usr/perl5/5.6.1/bin/perl myld gcc  -G dbdimp.o  mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so   -L/opt/mysql/mysql/lib -lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm
gcc: dbdimp.o: No such file or directory
gcc: mysql.o: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/DBD/mysql/mysql.so'
[20 Apr 2007 17:56] Sveta Smirnova
Thank you for the feedback.

Bug is still repeatable with current versions and gcc.

With Sun Studio all work OK
[20 Apr 2007 17:57] Sveta Smirnova
With 4.0.24 DBD doesn't compile even with Sun Studio
[23 Apr 2007 6:09] Ramesh PS
HI,

I am trying with,

DBI    1.54
mysql  5.0.37    -- Installed using .pkg
perl   5.6.1
gcc version 3.4.6
Solaris 10 SPARC 64 bit

Please let me know any combination of versions which worked straght without any problem.
[23 Apr 2007 6:58] Sveta Smirnova
Hi Ramesh,

bug is not repeatable if use Sun Studio compilers (http://developers.sun.com/sunstudio/) instead of gcc.
[24 Apr 2007 10:39] Ramesh PS
HI,
I installed sunstudio 11 as suggested.

+++++++++++++++++++++++++++++++++++++++++++++++++
-bash-3.00# perl Makefile.PL
I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/opt/mysql/mysql/include -mt -D_FORTEC_ -xarch=v9
  embedded      (mysql_config) =
  libs          (mysql_config) = -xarch=v9 -L/opt/mysql/mysql/lib -lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  ssl           (guessed     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) =
  testpassword  (default     ) =
  testsocket    (default     ) =
  testuser      (default     ) =

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Checking if your kit is complete...
Looks good
Unrecognized argument in LIBS ignored: '-xarch=v9'
Using DBI 1.54 (for perl 5.008004 on sun4-solaris-64int) installed in /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI/
Writing Makefile for DBD::mysql

+++++++++++++++++++++++++
-bash-3.00# make
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cc -c  -I/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI -I/opt/mysql/mysql/include -mt -D_FORTEC_ -xarch=v9 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO -xO3 -xspace -xildoff    -DVERSION=\"4.004\"  -DXS_VERSION=\"4.004\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   dbdimp.c
"dbdimp.c", line 498: warning: implicit function declaration: parse_number
/usr/perl5/5.8.4/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI/Driver.xst > mysql.xsi
/usr/perl5/5.8.4/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp  -typemap /usr/perl5/5.8.4/lib/ExtUtils/typemap  mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 612
cc -c  -I/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI -I/opt/mysql/mysql/include -mt -D_FORTEC_ -xarch=v9 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO -xO3 -xspace -xildoff    -DVERSION=\"4.004\"  -DXS_VERSION=\"4.004\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   mysql.c
"mysql.xs", line 550: warning: implicit function declaration: mysql_st_next_results
"mysql.xs", line 686: warning: implicit function declaration: is_prefix
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/lib" /usr/perl5/5.8.4/bin/perl myld cc  -G dbdimp.o  mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so   -L/opt/mysql/mysql/lib -lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm
chmod 755 blib/arch/auto/DBD/mysql/mysql.so
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Manifying blib/man3/DBD::mysql.3
Manifying blib/man3/DBD::mysql::INSTALL.3
Manifying blib/man3/Bundle::DBD::mysql.3
-bash-3.00# make install
Installing /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBD/mysql/mysql.so
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Writing /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBD/mysql/.packlist
Appending installation info to /usr/perl5/5.8.4/lib/sun4-solaris-64int/perllocal.pod

+++++++++++++++++++++++++++++++++++++++++
Every thing looked fine except few warnings.

But when executed a script I am getting the error.

ld.so.1: perl: fatal: relocation error: file /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBD/mysql/mysql.so: symbol mysql_server_init: referenced symbol not found

Any suggestion for this?
[4 May 2007 4:32] Ramesh PS
HI,

I got the DBD::mysql installed without any problem after installing only C complier from Sun Studio 11. (About 27 packages are installed).

But earlier I was doing straight install of module and never had proble.
Is there any work around that doesnot require these packages?

Thanks for the help.
[4 May 2007 4:33] Ramesh PS
Also I had to recompile mysql with gcc.
[5 Jun 2008 3:50] Kaprino M
anyone have any luck building with the latest Solaris 10 (5/08)and on SUN's T5120 server? Which compiler was used to build the mysql 5.1.24 server? Sun studio 12 or gcc? is there a way to find out from the untar files?

thanks,
Kap
[5 Jun 2008 15:43] Kaprino M
Hi
I was also unsuccessful building DBD::MYSQl on Solaris 10 (5/08) on SUN T5120 server. I downloaded the MySQL SUN 64bit tar package. I also changed the -xarch=v9 to -m64 in the Makefile for 64bit Solaris, but I get following when I run make erros below. I also try perlgcc, do you know if the mysql tar file was built with SUN studio cc or gcc? mysql_config --cflags looks like SUN compiler? Below is also the OS, Mysql, and other tools being used. Any help would be appreciated.

Thanks,
kaprino

Error from make
make: Fatal error: Command failed for target `blib/arch/auto/DBD/mysql/mysql.so

OS:     Solaris 10 (5/08)
Mysql:  mysql-5.1.24-rc-solaris10-sparc-64bit tar file downloaded from mysql.com
DBD-mysql:   DBD-mysql-4.007
cc: Sun C 5.9 SunOS_sparc Patch 124867-01 2007/07/12
make: version of "/usr/ccs/bin/make": SunOS 5.10 118676-03 November 2006
perl: 
perl -V
Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
Platform:
osname=solaris, osvers=2.10, archname=sun4-solaris-64int
uname='sunos localhost 5.10 sun4u sparc SUNW,Ultra-2'
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO',
optimize='-xO3 -xspace -xildoff',
cppflags=''
ccversion='Sun WorkShop', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =''
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-R /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE'
cccdlflags='-KPIC', lddlflags='-G'

Characteristics of this binary (from libperl):
Compile-time options: USE_64_BIT_INT USE_LARGE_FILES
Locally applied patches:
22667 The optree builder was looping when constructing the ops ...
22715 Upgrade to FileCache 1.04
22733 Missing copyright in the README.
22746 fix a coredump caused by rv2gv not fully converting a PV ...
22755 Fix 29149 - another UTF8 cache bug hit by substr.
22774 [perl #28938] split could leave an array without ...
22775 [perl #29127] scalar delete of empty slice returned garbage
22776 [perl #28986] perl -e "open m" crashes Perl
22777 add test for change #22776 ("open m" crashes Perl)
22778 add test for change #22746 ([perl #29102] Crash on assign ...
22781 [perl #29340] Bizarre copy of ARRAY make sure a pad op's ...
22796 [perl #29346] Double warning for int(undef) and abs(undef) ...
22818 BOM-marked and (BOMless) UTF-16 scripts not working
22823 [perl #29581] glob() misses a lot of matches
22827 Smoke [5.9.2] 22818 FAIL(F) MSWin32 WinXP/.Net SP1 (x86/1 cpu)
22830 [perl #29637] Thread creation time is hypersensitive
22831 improve hashing algorithm for ptr tables in perl_clone: ...
22839 [perl #29790] Optimization busted: '@a = "b", sort @a' ...
22850 [PATCH] 'perl -v' fails if local_patches contains code snippets
22852 TEST needs to ignore SCM files
22886 Pod::Find should ignore SCM files and dirs
22888 Remove redundant %SIG assignments from FileCache
23006 [perl #30509] use encoding and "eq" cause memory leak
23074 Segfault using HTML::Entities
23106 Numeric comparison operators mustn't compare addresses of ...
23320 [perl #30066] Memory leak in nested shared data structures ...
23321 [perl #31459] Bug in read()
27722 perlio.c breaks on Solaris/gcc when > 256 FDs are available
SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
Built under solaris
Compiled at Aug 8 2007 19:08:30
@INC:
/usr/perl5/5.8.4/lib/sun4-solaris-64int
/usr/perl5/5.8.4/lib
/usr/perl5/site_perl/5.8.4/sun4-solaris-64int
/usr/perl5/site_perl/5.8.4
/usr/perl5/site_perl
/usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int
/usr/perl5/vendor_perl/5.8.4
/usr/perl5/vendor_perl 

# perl Makefile.PL --cflags="-I/opt/mysql/include -g -mt -D_FORTEC_ -m64 -DHAVE_RWLOCK_T -DUNIV_SOLARIS"
I used the following -cflags which I got from
# mysql_config --cflags
-I/opt/mysql/include -g -mt -D_FORTEC_ -xarch=v9 -DHAVE_RWLOCK_T -DUNIV_SOLARIS

but the -xarch=v9 was depricated to so I replace all -xarch=v9 to -m64.

Any help would be great, thanks.

# make
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cc -c -I/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI -I/opt/mysql/include -g -mt -D_FORTEC_ -m64 -DHAVE_RWLOCK_T -DUNIV_SOLARIS -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO -xO3 -xspace -xildoff -DVERSION=\"4.007\" -DXS_VERSION=\"4.007\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE" dbdimp.c
"dbdimp.c", line 464: warning: implicit function declaration: parse_number
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI/Driver.xst > mysql.xsi
/usr/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp -typemap /usr/perl5/5.8.4/lib/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 612
cc -c -I/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI -I/opt/mysql/include -g -mt -D_FORTEC_ -m64 -DHAVE_RWLOCK_T -DUNIV_SOLARIS -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO -xO3 -xspace -xildoff -DVERSION=\"4.007\" -DXS_VERSION=\"4.007\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE" mysql.c
"mysql.xs", line 550: warning: implicit function declaration: mysql_st_next_results
"mysql.xs", line 686: warning: implicit function declaration: is_prefix
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/opt/mysql/lib:/lib" /usr/bin/perl myld cc -G dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.so -L/opt/mysql/lib -lmysqlclient -lz -lposix4 -lresolv -lgen -lsocket -lnsl -lm
ld: fatal: file /opt/mysql/lib/libmysqlclient.so: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to blib/arch/auto/DBD/mysql/mysql.so
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/DBD/mysql/mysql.so'
[26 Nov 2008 16:34] Uwe Schrader
Hello, i've got the same issue on a Solaris 10 SPARC 64bit system:  can not get the DBD-mysql perl module compiled:

You can also optionally set the user to run 'make test' with:

perl Makefile.pl --testuser=username

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/local/mysql/include -mt -D_FORTEC_ -xarch=v9
  embedded      (mysql_config) =
  libs          (mysql_config) = -xarch=v9 -L/usr/local/mysql/lib -lmysqlclient -lz -lposix4 -lresolv -lgen -lsocket -lnsl -lm
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  ssl           (guessed     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) =
  testpassword  (default     ) =
  testsocket    (default     ) =
Use of uninitialized value in printf at Makefile.PL line 175, <PIPE> line 93.
  testuser      (            ) = root

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Unrecognized argument in LIBS ignored: '-xarch=v9'
Using DBI 1.607 (for perl 5.008004 on sun4-solaris-64int) installed in /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI/
Writing Makefile for DBD::mysql

When running a make, i get the following errormessage:

ld: fatal: file /usr/local/mysql/lib/libmysqlclient.so: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to blib/arch/auto/DBD/mysql/mysql.so
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/DBD/mysql/mysql.so'
[8 Aug 2011 19:03] Roberto Meneses
Hi
I have this issue at this time, someone has resolved this bug or have a suggestion?

Thanks

[root@monitoreo]#make
Skip blib/lib/DBD/mysql.pm (unchanged)
Skip blib/lib/DBD/mysql/GetInfo.pm (unchanged)
Skip blib/lib/DBD/mysql/INSTALL.pod (unchanged)
Skip blib/lib/Bundle/DBD/mysql.pm (unchanged)
gcc -c  -I/usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/DBI -I/opt/mysql/mysql/include -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/opt/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O    -DVERSION=\"4.019\"  -DXS_VERSION=\"4.019\" -fPIC "-I/usr/local/lib/perl5/5.8.8/sun4-solaris/CORE"   dbdimp.c
gcc -c  -I/usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/DBI -I/opt/mysql/mysql/include -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/opt/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O    -DVERSION=\"4.019\"  -DXS_VERSION=\"4.019\" -fPIC "-I/usr/local/lib/perl5/5.8.8/sun4-solaris/CORE"   mysql.c
mysql.xs: In function `XS_DBD__mysql__db__ListDBs':
mysql.xs:221: warning: ISO C90 forbids mixed declarations and code
mysql.xs: In function `XS_DBD__mysql__db_quote':
mysql.xs:610: warning: ISO C90 forbids mixed declarations and code
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/opt/mysql/mysql/lib:/usr/lib" /usr/bin/perl myld gcc  -G -L/usr/local/lib -L/opt/gnu/lib dbdimp.o  mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so  \
   -L/opt/mysql/mysql/lib -lmysqlclient -lthread -lsocket -lnsl -lm -lrt        \

ld: fatal: file /opt/mysql/mysql/lib/libmysqlclient.so: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to blib/arch/auto/DBD/mysql/mysql.so
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/DBD/mysql/mysql.so'
[root@monitoreo]#

[root@monitoreo]#perl -v

This is perl, v5.8.8 built for sun4-solaris

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

[root@monitoreo]#

[root@monitoreo]#/opt/mysql/mysql/bin/mysqld -V
/opt/mysql/mysql/bin/mysqld  Ver 5.5.15 for solaris10 on sparc (MySQL Community Server (GPL))
[root@monitoreo]#

[root@monitoreo]#uname -a
SunOS monitoreo 5.10 Generic_144488-04 sun4v sparc SUNW,Sun-Fire-T1000
[root@monitoreo]#
[20 Feb 2013 22:41] Sveta Smirnova
Thank you for the report.

We don't work on DBD::mysql bugs anymore. All its bugs should go to CPAN: https://rt.cpan.org/Public/Dist/Display.html?Name=DBD-mysql

And since this bug was repeatable only with version MySQL 4.0 and this version is not supported anymore as well, this can be considered as fully not supported report. Please upgrade.
[6 Aug 2013 17:22] Arnaud Adant
Even if Oracle does not support it since DBD::mysql is a third party connector,
it is indeed possible to install PERL DBD:mysql on Solaris 10.

For that you need to compile using gcc (/usr/sfw/gcc) :

- perl from source 

- the 2 PERL modules DBI and DBD::perl

- the MySQL client part compiled with gcc.

From the DBD::mysql manual : INSTALL.html

"

C compiler

A C compiler is only required, if you install from source. In most cases there are binary distributions of DBD::mysql available. However, if you need a C compiler, make sure, that it is the same C compiler that was used for compiling Perl and MySQL! Otherwise you will almost definitely encounter problems because of differences in the underlying C runtime libraries.In the worst case, this might mean to compile Perl and MySQL yourself. But believe me, experience shows that a lot of problems are fixed this way.

"

export PATH=$PATH:/usr/ccs/bin/

I needed to use this to build perl from source :

sh Configure -Dcc=/usr/sfw/bin/gcc

since gcc was not in the path by default

If you did not have cmake installed, you need to compile it from cmake-2.8.11.2.tar.gz :

export CXX=/usr/sfw/bin/g++
./configure
make

then you can use  cmake-2.8.11.2/bin/cmake to build mysql-5.5.33 from source

uncompress (gunzip then tar xvf)

export CC=/usr/sfw/bin/gcc
export CXX=/usr/sfw/bin/g++

cmake .
make
make package

uncompressed the package :

mysql-5.5.33-solaris10-xxx.tar.gz in a local directory (I used /tmp)

once the mysql-5.5.33 package is built and uncompressed you can use this command to install DBD::mysql (after the DBI module is installed).

../local/bin/perl Makefile.PL  --mysql_config="/tmp/mysql-5.5.33-solaris10-i386/bin/mysql_config"

in DBD-mysql-4.023

after

make
make install

Use this command to invoke a perl program

export LD_LIBRARY_PATH=/tmp/mysql-5.5.33-solaris10-xxx/lib/
/tmp/local/bin/perl test.pl