Problems installing DBD::mysql on Solaris 10

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am in the process of building a server and am trying to get Perl,
mySQL, Apache up and running. The machine is a Sun Sparc (64bit) with
everything running in 32bit mode (to my knowledge).

The machine was handed to me with a 'pre-release' (beta?) version
pre-installed on it. I downloaded Solaris 10 and installed (upgraded)
that. I added a few packages - all with the noddy cc compiler that
comes with it. I proceeded to install mysql (using pkgadd), followed
rapidly by the attempt to install - which failed as I needed gcc
in After some helpful information, I decided to install a
new copy of perl, using gcc.

So, I got gcc and used it to install a 2nd copy of Perl (so now there
are two on the box 5.8.4 and 5.8.7). has installed (hurrah!),
but DBD::mysql will not. I re-installed mysql (pkgrm, pkgadd) to make
sure I had 32-bit versions of both and that both were installed using
same compiler (I'm assuming that pkgadd will use gcc). I have read some
notes that perl and mysql must be installed with the same compiler for
DBD::mysql to work, so if anyone knows if I have missed anything, or a
really good way to make sure...

But I still cannot get it to install.

Below is the output of 'make':

Removing previously used /.cpan/build/DBD-mysql-3.0002 Going to build C/CA/CAPTTOFU/DBD-mysql-3.0002.tar.gz

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/local/mysql/mysql/include -xO3
-mt -D_FORTEC_ -xarch=v8 -xc99=none
  embedded      (mysql_config) =
  libs          (mysql_config) = -xarch=v8 -L/usr/local/mysql/mysql/lib
-lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lmtmalloc
  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=v8'
Using DBI 1.48 (for perl 5.008007 on sun4-solaris) installed in
Writing Makefile for DBD::mysql
cp lib/DBD/ blib/lib/DBD/
cp lib/DBD/mysql/ blib/lib/DBD/mysql/
cp lib/ blib/lib/
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Mysql/ blib/lib/Mysql/
cp lib/Bundle/DBD/ blib/lib/Bundle/DBD/
gcc -c  -I/opt/lib/perl5/site_perl/5.8.7/sun4-solaris/auto/DBI/
-I/usr/local/mysql/mysql/include -xO3 -mt -D_FORTEC_ -xarch=v8
-xc99=none -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe
-DXS_VERSION=\"3.0002\" -fPIC
"-I/opt/lib/perl5/5.8.7/sun4-solaris/CORE"   dbdimp.c
gcc: language c99=none not recognized
gcc: dbdimp.c: linker input file unused because linking not done
/opt/bin/perl -p -e "s/~DRIVER~/mysql/g"
/opt/lib/perl5/site_perl/5.8.7/sun4-solaris/auto/DBI//Driver.xst >
/opt/bin/perl /opt/lib/perl5/5.8.7/ExtUtils/xsubpp  -typemap
/opt/lib/perl5/5.8.7/ExtUtils/typemap  mysql.xs > mysql.xsc && mv
mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line
Warning: duplicate function definition 'rows' detected in mysql.xs,
line 559
gcc -c  -I/opt/lib/perl5/site_perl/5.8.7/sun4-solaris/auto/DBI/
-I/usr/local/mysql/mysql/include -xO3 -mt -D_FORTEC_ -xarch=v8
-xc99=none -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe
-DXS_VERSION=\"3.0002\" -fPIC "-I/opt/lib/perl5/5.8.7/sun4-solaris/
+CORE"   mysql.c
gcc: language c99=none not recognized
gcc: mysql.c: linker input file unused because linking not done
Running Mkbootstrap for DBD::mysql ()
chmod 644
rm -f blib/arch/auto/DBD/mysql/
LD_RUN_PATH="/usr/lib" /opt/bin/perl myld gcc  -G dbdimp.o  mysql.o  -o
blib/arch/auto/DBD/mysql/   -L/usr/local/mysql/mysql/lib
-lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lmtmalloc
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
  /usr/ccs/bin/make  -- NOT OK

Re: Problems installing DBD::mysql on Solaris 10

Not sure that I can help much.
Quoted text here. Click to load it

A month or so I struck the same message (different OS) in relation to the
building of a certain module .... but I can't recall which module it was, or
what was causing the error, or how I fixed the problem. So all I can really
tell you is that both dbdimp.c and mysql.c were supposed to be compiled into
dbdimp.o and mysql.o respectively, but they weren't - and that's why you get
the following message:

Quoted text here. Click to load it

And that's why the build process fails. If you can coerce gcc into compiling
those 2 '.c' files into the 2 '.o' files, and then re-run 'make', then the
build process should continue on (either to completion, or until the next
error :-)

It's a bit strange, because the 2 commands that fail to do what they should
(ie 'gcc - c ..... dbdimp.c' and 'gcc -c .... mysql.c') don't actually list
a "linker input file" afaict. So maybe it's just something in the command
syntax that's confusing things. What happens if you cd to the build
directory and run the original command(s) from the command line:

gcc -c  -I/opt/lib/perl5/site_perl/5.8.7/sun4-solaris/auto/DBI/ -I/usr/local
/mysql/mysql/include -xO3 -mt -D_FORTEC_ -xarch=v8 -xc99=none -DDBD_MYSQL_IN
SERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_O
FFSET_BITS=64 -O    -DVERSION=\"3.0002\" -DXS_VERSION=\"3.0002\" -fPIC
"-I/opt/lib/perl5/5.8.7/sun4-solaris/CORE"   dbdimp.c

It probably still fails - but you could try removing various switches and
see if you can strike an incantation that works. (There's already a
complaint about "-xc99=none" so try removing it first.) Then try the same in
relation to mysql.c.

(You might find it easier to meddle if you build by downloading the source
from CPAN and manually running 'perl Makefile.PL', 'make test', 'make
install', rather than using the automated


Re: Problems installing DBD::mysql on Solaris 10

All those flag settings come from the mysql setting:

Usage: /usr/local/mysql/mysql/bin/mysql_config [OPTIONS]
        --cflags         [-I/usr/local/mysql/mysql/include -xO3 -mt
-D_FORTEC_ -xarch=v8 -xc99=none]
        --include        [-I/usr/local/mysql/mysql/include]
        --libs           [-xarch=v8 -L/usr/local/mysql/mysql/lib
-lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lmtmalloc]
        --libs_r         [-xarch=v8 -L/usr/local/mysql/mysql/lib
-lmysqlclient_r -lz -lpthread -lthread -lposix4 -lcrypt -lgen -lsocket
-lnsl -lm -lmtmalloc -lpthread -lthread]
        --socket         [/tmp/mysql.sock]
        --port           [3306]
        --version        [4.1.15]
        --libmysqld-libs [-xarch=v8 -L/usr/local/mysql/mysql/lib
-lmysqld -lz -lpthread -lthread -lposix4 -lcrypt -lgen -lsocket -lnsl
-lm -lmtmalloc -lpthread -lthread   -lrt]

Now this is a .pkg install from - is it possible that I need
to get a .tar.gz and install my own, making sure my gcc compiler is
One thing that worries me is how to uninstall from this route..

Back to your point though - I stripped down the -x flags, which gives
me this result:
gcc -c  -I/opt/lib/perl5/site_perl/5.8.7/sun4-solaris/auto/DBI/
-I/usr/local/mysql/mysql/include -xnone -mt -D_FORTEC_
-DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe
-DXS_VERSION=\"3.0002\" -fPIC
"-I/opt/lib/perl5/5.8.7/sun4-solaris/CORE"   dbdimp.c
cc1: error: invalid option `t'

gcc -v
Reading specs from /opt/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.2/specs
Configured with: ../gcc-3.4.2/configure --prefix=/opt/sfw
--with-ld=/usr/ccs/bin/ld --with-gnu-as --with-as=/opt/sfw/bin/gas
--enable-shared --disable-libgcj
Thread model: posix
gcc version 3.4.2

Re: Problems installing DBD::mysql on Solaris 10

Quoted text here. Click to load it

Worth a try. Download from and do a manual install
as per instructions in the INSTALL file.
As long as 'perl Makefile.PL' uses your gcc-built perl, then gcc will be
As you indicated in your first post, you might need to build against a
*gcc-built* mysql.

Quoted text here. Click to load it

Why would you need to uninstall ? Perl modules are not usually uninstalled.
Normally a module simply gets overwritten whenever a different version of
said module is installed.

Quoted text here. Click to load it

I think the 't' option referred to is the 't' in '-mt'. Perhaps '-mt' needs
also to be removed. (I don't know if there's any future in this approach ...
faik it might work ... faik it might not :-)

I'm also a little bit puzzled by the appearance of 'cc1' in the error
message. That hints to me of 'cc' rather than 'gcc'.

(It would help if someone with specific knowledge of Solaris and cc could
help out here with some definitive information.)


Site Timeline