DBX showing incorrect values in shared library built with -g - solaris

-bash-3.2$ uname -a
SunOS b2s-sol10spr-1 5.10 Generic_147147-26 sun4v sparc sun4v
-bash-3.2$ dbx -V
Sun DBX Debugger 8.0 SunOS_sparc 2014/10/21
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 8.0' in your .dbxrc
(dbx)
I'm getting a weird issue where the debugger is just showing completely wrong values for function parameters & local/member variables.
Here's a sample backtrace
=>[1] SQLGetDiagRecW(HandleType = -28417, Handle = 0x480000000101dfc1, RecNumber = -12288, Sqlstate = (nil), NativeError = 0xffffffff7fffdf, MessageText = 0x9100000001002bbd, BufferLength = -9583, TextLength = 0x380000000101da91), line 3154 in "CInterface.cpp"
[2] extract_diag_error_w(htype = 3, handle = 0x3, connection = 0x1014d32c0, head = 0x101e5a5e0, return_code = -1, save_to_diag = 0), line 4447 in "__info.c"
[3] function_return_ex(level = 3, handle = 0x101e5a1a0, ret_code = -1, save_to_diag = 0), line 4863 in "__info.c"
[4] SQLExecDirectW(statement_handle = 0x101e5a1a0, statement_text = 0x101dacde0, text_length = -3), line 442 in "SQLExecDirectW.c"
<truncated>
Frame 1 is in the problematic shared library, while the other frames are in the unixODBC libodbc.so
If we look at the code for extract_diag_error_w (you can get the code from http://www.unixodbc.org/unixODBC-2.3.1.tar.gz, the following snippet is from DriverManager/__info.c )
ret = SQLGETDIAGRECW( connection,
head -> handle_type,
handle,
rec_number,
sqlstate,
&native,
msg1,
sizeof( msg1 ),
&len );
Note that we have, elsewhere
#define SQLGETDIAGRECW(con,typ,han,rn,st,nat,msg,bl,tlp)\
(con->functions[77].funcW)\
(typ,han,rn,st,nat,msg,bl,tlp)
in dbx, if I go to frame 2 and print head -> handle_type, I get 3, but if I go to frame 1 and print HandleType, I get -28417.
I'd expect dbx, if it can't find the value (due to optimization or w/e, even though this was a debug build), to tell me so (<value optimized out> or somesuch). Also, every value I look at seems to be wrong (I've confirmed that the debugger is lying to me via control flow, there's code like if (x < 0) throw ...; where dbx claims it's some negative number, but the exception doesn't get thrown.
The problematic shared libary was built on another machine (while unixODBC was built locally), so maybe that's involved? It was also built w/ gcc, where I used the default compiler when building unixODBC (though I think it's also w/ gcc, since they both have a dependency on libgcc_s.so.1)
Any suggestions? (I'd guess updating dbx might work, but it would be difficult in this environment).
edit: Here's an example w/ local variables
(dbx) next
t#1 (l#1) stopped in Simba::Support::ODBCStringConverter::ConvertWStringToSQLWCHARString at line 64 in file "ODBCStringConverter.cpp"
64 simba_int32 length = in_length;
(dbx) next
t#1 (l#1) stopped in Simba::Support::ODBCStringConverter::ConvertWStringToSQLWCHARString at line 66 in file "ODBCStringConverter.cpp"
66 if (0 == in_length)
(dbx) print length
length = 11
(dbx) print in_length
in_length = 419430399
(dbx) next
t#1 (l#1) stopped in Simba::Support::ODBCStringConverter::ConvertWStringToSQLWCHARString at line 73 in file "ODBCStringConverter.cpp"
73 else if (SIMBA_NTS == in_length)
(dbx) next
t#1 (l#1) stopped in Simba::Support::ODBCStringConverter::ConvertWStringToSQLWCHARString at line 79 in file "ODBCStringConverter.cpp"
79 simba_int32 bufferBytes = length;
(dbx) next
t#1 (l#1) stopped in Simba::Support::ODBCStringConverter::ConvertWStringToSQLWCHARString at line 80 in file "ODBCStringConverter.cpp"
80 if (!in_isLengthInBytes)
(dbx) print bufferBytes
bufferBytes = 1744830464
(dbx)
edit 2: Here's how the troublesome library was built (need to rebuild unixODBC, will do that later).
Example command for compiling one of the .cpp files (I removed a bunch of include directories)
/opt/csw/gcc4/bin/g++ -DSIZEOF_LONG_INT=8 -DSQL_WCHART_CONVERT -DHAVE_MEMMOVE -m64 -fPIC -pthread -Wall -Wno-unknown-pragmas -DSIMBA -D_REENTRANT -DCLUNIX -DNDEBUG -D_POSIX_PTHREAD_SEMANTICS -O0 -g -D_DEBUG -c Common/QSTableMetadataFile.cpp -o Common/QSTableMetadataFile_solaris10sparc_gcc4_9_debug64.cpp.o
Command used to link (removed a bunch of .o files)
/opt/csw/gcc4/bin/g++ -DSIMBA -D_REENTRANT -m64 -fPIC -pthread -Wall -Wno-unknown-pragmas -lrt -O0 -g -shared -L/bamboo/bamboo-agent-home/xml-data/build-dir/ThirdParty/icu/53.1.x/solaris10sparc/gcc4_9/release64/lib -lstdc++ -licudata_sb64 -licui18n_sb64 -licuuc_sb64 -lpthread -lm -lsocket -lnsl -Wl,-M,exports_SunOS.map -Wl,-zallextract,/bamboo/bamboo-agent-home/xml-data/build-dir/SimbaEngine/Maintenance/10.1/Product/Lib/solaris10sparc/gcc4_9/debug64/libSimbaDSI.a,/bamboo/bamboo-agent-home/xml-data/build-dir/SimbaEngine/Maintenance/10.1/Product/Lib/solaris10sparc/gcc4_9/debug64/libSimbaSupport.a,/bamboo/bamboo-agent-home/xml-data/build-dir/SimbaEngine/Maintenance/10.1/Product/Lib/solaris10sparc/gcc4_9/debug64/libAEProcessor.a,/bamboo/bamboo-agent-home/xml-data/build-dir/SimbaEngine/Maintenance/10.1/Product/Lib/solaris10sparc/gcc4_9/debug64/libCore.a,/bamboo/bamboo-agent-home/xml-data/build-dir/SimbaEngine/Maintenance/10.1/Product/Lib/solaris10sparc/gcc4_9/debug64/libDSIExt.a,/bamboo/bamboo-agent-home/xml-data/build-dir/SimbaEngine/Maintenance/10.1/Product/Lib/solaris10sparc/gcc4_9/debug64/libExecutor.a,/bamboo/bamboo-agent-home/xml-data/build-dir/SimbaEngine/Maintenance/10.1/Product/Lib/solaris10sparc/gcc4_9/debug64/libParser.a,/bamboo/bamboo-agent-home/xml-data/build-dir/SimbaEngine/Maintenance/10.1/Product/Lib/solaris10sparc/gcc4_9/debug64/libSimbaODBC.a -Wl,-zweakextract -o ../Bin/solaris10sparc/gcc4_9/debug64/libQuickstart64.so

Related

File format not recognized error while installing CBLAS on a Ubuntu machine

I need to install CBLAS on an Ubuntu 16.04.4 machine. The following values have been set in the Makefile.in file of CBLAS:
SHELL = /bin/sh
PLAT = LINUX
BLLIB = /home/ubuntu/BLAS-3.8.0/blas_LINUX.a
CBLIB = /home/ubuntu/CBLAS/lib/cblas_LINUX.a
CC = gcc
FC = gfortran
LOADER = $(FC)
CFLAGS = -O3 -DADD_ -fPIC
FFLAGS = -O3 -fPIC
ARCH = gcc
ARCHFLAGS = -shared -o
RANLIB = ranlib
However, while running the make command I run into following error:
ranlib: /home/ubuntu/CBLAS/lib/cblas_LINUX.a: File format not recognized
The following is the stack trace:
Can someone suggest how this can be resolved?
CBLAS shared libraries : sudo apt install libatlas3-base libatlas-base-dev
libatlas3-base provides
/usr/lib/atlas-base/atlas/libblas.so.3
/usr/lib/atlas-base/atlas/libblas.so.3.0
/usr/lib/atlas-base/atlas/liblapack.so.3
/usr/lib/atlas-base/atlas/liblapack.so.3.0
/usr/lib/atlas-base/libatlas.so.3
/usr/lib/atlas-base/libatlas.so.3.0
/usr/lib/atlas-base/libcblas.so.3
/usr/lib/atlas-base/libcblas.so.3.0
/usr/lib/atlas-base/libf77blas.so.3
/usr/lib/atlas-base/libf77blas.so.3.0
/usr/lib/atlas-base/liblapack_atlas.so.3
/usr/lib/atlas-base/liblapack_atlas.so.3.0
/usr/lib/libatlas.so.3
/usr/lib/libcblas.so.3 ← ←
/usr/lib/libf77blas.so.3
/usr/lib/liblapack_atlas.so.3
libatlas-base-dev provides
/usr/lib/atlas-base/atlas/libblas.a
/usr/lib/atlas-base/atlas/libblas.so
/usr/lib/atlas-base/atlas/liblapack.a
/usr/lib/atlas-base/atlas/liblapack.so
/usr/lib/atlas-base/libatlas.a
/usr/lib/atlas-base/libatlas.so
/usr/lib/atlas-base/libcblas.a
/usr/lib/atlas-base/libcblas.so
/usr/lib/atlas-base/libf77blas.a
/usr/lib/atlas-base/libf77blas.so
/usr/lib/atlas-base/liblapack_atlas.a
/usr/lib/atlas-base/liblapack_atlas.so
/usr/lib/libatlas.a
/usr/lib/libatlas.so
/usr/lib/libcblas.a
/usr/lib/libcblas.so ← ←
/usr/lib/libf77blas.a
/usr/lib/libf77blas.so
/usr/lib/liblapack_atlas.a
/usr/lib/liblapack_atlas.so

Segfault when running hello world shellcode in C program

sorry if this question sounds dumb but I am very new to shellcoding and I was trying to get a hello world example to work on a 32 bit linux machine.
As this is shellcoding, I used a few tricks to remove null bytes and shorten the code. Here it is:
section .data
section .text
global _start
_start:
;Instead of xor eax,eax
;mov al,0x4
push byte 0x4
pop eax
;xor ebx,ebx
push byte 0x1
pop ebx
;xor ecx,ecx
cdq ; instead of xor edx,edx
;mov al, 0x4
;mov bl, 0x1
mov dl, 0x8
push 0x65726568
push 0x74206948
;mov ecx, esp
push esp
pop ecx
int 0x80
mov al, 0x1
xor ebx,ebx
int 0x80
This code works fine when I compile and link it with the following commands:
$ nasm -f elf print4.asm
$ ld -o print4 -m elf_i386 print4.o
However, I tried running it within the following C code:
$ cat shellcodetest.c
#include
#include
char *shellcode = "\x04\x6a\x58\x66\x01\x6a\x5b\x66\x99\x66\x08\xb2\x68\x68\x68\x65\x69\x48\x54\x66\x59\x66\x80\xcd\x01\xb0\x31\x66\xcd\xdb\x80";
int main(void) {
( *( void(*)() ) shellcode)();
}
$ gcc shellcodetest.c –m32 –z execstack -o shellcodetest
$ ./shellcodetest
Segmentation fault (core dumped)
Could someone please explain what is happening there? I tried running the code in gdb and noticed something weird happening with esp. But as I said before, I still lack experience to really understand what is going on here.
Thanks in advance!
Your shellcode does not work, because it is not entered in the correct endianness. You did not state how you extracted the bytes from the file print4, but both objdump and xxd gives the bytes in correct order.
$ xxd print4 | grep -A1 here
0000060: 6a04 586a 015b 99b2 0868 6865 7265 6848 j.Xj.[...hherehH
0000070: 6920 7454 59cd 80b0 0131 dbcd 8000 2e73 i tTY....1.....s
$ objdump -d print4
print4: file format elf32-i386
Disassembly of section .text:
08048060 <_start>:
8048060: 6a 04 push $0x4
8048062: 58 pop %eax
8048063: 6a 01 push $0x1
...
The changes you need to do is to swap the byte order, '\x04\x6a' -> '\x6a\x04'.
When I run your code with this change, it works!
$ cat shellcodetest.c
char *shellcode = "\x6a\x04\x58\x6a\x01\x5b\x99\xb2\x08\x68\x68\x65\x72\x65\x68\x48\x69\x20\x74\x54\x59\xcd\x80\xb0\x01\x31\xdb\xcd\x80";
int main(void) {
( *( void(*)() ) shellcode)();
}
$ gcc shellcodetest.c -m32 -z execstack -o shellcodetest
$ ./shellcodetest
Hi there$

Perl installtion on ARMv7eb

I have cross compiled tool chain for armv7eb. Now I have copied the tools to my target machine and tried to build perl on target. In this process of building perl, there is a binary called 'miniperl' which crashes, outputting "ILLEGAL INSTRUCTION".
Can someone help me point out what I should be doing?
PERL VERSION: 5.8.8
GCC: 4.1.3
Please find the crash log below. Does anybody have any suggestions?
sh cflags "optimize='-O'" opmini.o` -DPIC -fPIC -DPERL_EXTERNAL_GLOB opmini.c
CCCMD = cc -DPERL_CORE -c -msoft-float -dynamic -fno-strict-aliasing -pipe -Wdeclaration-after-statement -O -Wall
LD_LIBRARY_PATH=/usr/pkg/src/perl-5.8.8:/lib:/usr/lib:/usr/pkg/lib:/usr/pkg/src/PTHREAD/lib cc -Wl,-rpath,/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/pkg/lib -L/lib -L/usr/lib -o miniperl miniperlmain.o opmini.o -L. -lperl -lm -lcrypt -lutil -lc -lposix
LD_LIBRARY_PATH=/usr/pkg/src/perl-5.8.8:/lib:/usr/lib:/usr/pkg/lpid 25563 (miniperl), uid 0: exited on signal 4 (core not dumped, err = 2)
ib:/usr/pkg/src/PTHREAD/lib ./miniperl -w -Ilib -MExporter -e '<?>' || make minitest
[1] Illegal instruction LD_LIBRARY_PATH=...
cp ext/re/re.pm lib/re.pm
LD_LIBRARY_PATH=/usr/pkg/src/perpid 8052 (miniperl), uid 0: exited on signal 4 (core not dumped, err = 2)
l-5.8.8:/lib:/usr/lib:/usr/pkg/lib:/usr/pkg/src/PTHREAD/lib ./miniperl -Ilib configpm --heavy=lib/Config_heavy.pl lib/Config.pm
[1] Illegal instruction LD_LIBRARY_PATH=...
*** Error code 132
Stop.
make: stopped in /upid 25595 (miniperl), uid 0: exited on signal 4 (core not dumped, err = 2)
sr/pkg/src/perl-5.8.8
*** Error code 1 (ignored)
You may see some irrelevant test failures if you have been unable
to build lib/Config.pm, lib/lib.pm or the Unicode data files.
cd t && (rm -f perl; /bin/ln -s ../miniperl perl) && LD_LIBRARY_PATH=/usr/pkg/src/perl-5.8.8:/lib:/usr/lib:/usr/pkg/lib:/usr/pkg/src/PTHREAD/lib ./perl TEST -minitest base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t </dev/tty
[1] Illegal instruction LD_LIBRARY_PATH=...
*** Error code 132 (ignored)
*** Error code 1 (ignored)
LD_LIBRARY_PATH=/usr/pkg/src/perpid 703 (miniperl), uid 0: exited on signal 4 (core not dumped, err = 2)
l-5.8.8:/lib:/usr/lib:/usr/pkg/lib:/usr/pkg/src/PTHREAD/lib ./miniperl -Ilib configpm --heavy=lib/Config_heavy.pl lib/Config.pm

Cannot compile MEX LAPACK example

Summary
I am trying to write some MEX files that use LAPACK, and I thought I'd start by looking through the examples provided by MathWorks.
However, I am having some trouble compiling them. After copying the matrixDivide.c example from [MATLAB root]/extern/examples/refbook into a working directory, I tried to build a mex file, but it failed with error undefined reference to `dgesv_' (where dgesv is the name of the LAPACK routine being called).
I was able to build a different mex example (timestwo.c) that doesn't use LAPACK.
So what's going on? What's the deal with the trailing underscore? What about this memcpy warning?
More info
I think this is fairly similar to the issues encountered by this user:
How can I use CLAPACK,BLAS or LAPACK in a mex file?
I've tried this with MATLAB R2013b and R2014b. I am running on 64-bit Linux (RHEL 6) and my compiler is gcc 4.4.7 (which is not the MathWorks recommended version, but is the newest version I can get).
Here are the relevant portions of the code I'm trying to compile:
1 /*=========================================================
2 * matrixDivide.c - Example for illustrating how to use
3 * LAPACK within a C MEX-file.
4 *
5 * X = matrixDivide(A,B) computes the solution to a
6 * system of linear equations A * X = B
7 * using LAPACK routine DGESV, where
8 * A is an N-by-N matrix
9 * X and B are N-by-1 matrices.
10 *
11 * This is a MEX-file for MATLAB.
12 * Copyright 2009-2010 The MathWorks, Inc.
13 *=======================================================*/
14 /* $Revision: 1.1.6.3 $ $Date: 2011/01/28 18:11:56 $ */
15
16 #if !defined(_WIN32)
17 #define dgesv dgesv_
18 #endif
19
20 #include "mex.h"
21 #include "lapack.h"
22
23 void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
24 {
[ snip ]
73 /* Call LAPACK */
74 dgesv(&m,&n,A2,&m,iPivot,B2,&p,&info);
75 /* plhs[0] now holds X */
76
77 mxDestroyArray(Awork);
78 mxDestroyArray(mxPivot);
79 }
Here is the output of the failed mex build:
>> mex -v -largeArrayDims matrixDivide.c
-> mexopts.sh sourced from directory (DIR = $MATLAB/bin)
FILE = /sw/matlab/R2013b/bin/mexopts.sh
----------------------------------------------------------------
-> MATLAB = /sw/matlab/R2013b
-> CC = gcc
-> CC flags:
CFLAGS = -ansi -D_GNU_SOURCE -fexceptions -fPIC -fno-omit-frame-pointer -pthread
CDEBUGFLAGS = -g
COPTIMFLAGS = -O -DNDEBUG
CLIBS = -Wl,-rpath-link,/sw/matlab/R2013b/bin/glnxa64 -L/sw/matlab/R2013b/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
arguments =
-> CXX = g++
-> CXX flags:
CXXFLAGS = -ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread
CXXDEBUGFLAGS = -g
CXXOPTIMFLAGS = -O -DNDEBUG
CXXLIBS = -Wl,-rpath-link,/sw/matlab/R2013b/bin/glnxa64 -L/sw/matlab/R2013b/bin/glnxa64 -lmx -lmex -lmat -lm
arguments =
-> FC = gfortran
-> FC flags:
FFLAGS = -fexceptions -fbackslash -fPIC -fno-omit-frame-pointer
FDEBUGFLAGS = -g
FOPTIMFLAGS = -O
FLIBS = -Wl,-rpath-link,/sw/matlab/R2013b/bin/glnxa64 -L/sw/matlab/R2013b/bin/glnxa64 -lmx -lmex -lmat -lm
arguments =
-> LD = gcc
-> Link flags:
LDFLAGS = -pthread -shared -Wl,--version-script,/sw/matlab/R2013b/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
LDEXTENSION = .mexa64
arguments =
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments =
----------------------------------------------------------------
-> gcc -c -I/sw/matlab/R2013b/extern/include -I/sw/matlab/R2013b/simulink/include -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fexceptions -fPIC -fno-omit-frame-pointer -pthread -O -DNDEBUG "matrixDivide.c"
In file included from matrixDivide.c:21:
/sw/matlab/R2013b/extern/include/lapack.h:6907:1: warning: "dgesv" redefined
matrixDivide.c:17:1: warning: this is the location of the previous definition
matrixDivide.c: In function `mexFunction':
matrixDivide.c:64: warning: incompatible implicit declaration of built-in function ?memcpy?
-> gcc -O -pthread -shared -Wl,--version-script,/sw/matlab/R2013b/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined -o "matrixDivide.mexa64" matrixDivide.o -Wl,-rpath-link,/sw/matlab/R2013b/bin/glnxa64 -L/sw/matlab/R2013b/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
matrixDivide.o: In function `mexFunction':
matrixDivide.c:(.text+0x1c6): undefined reference to `dgesv_'
collect2: ld returned 1 exit status
mex: link of ' "matrixDivide.mexa64"' failed.
After some more messing around, I figured out my (rather elementary) mistake.
You need to specify the -lmwlapack option (and/or -lmwblas, as appropriate) to the linker:
mex -largeArrayDims -lmwlapack matrixDivide.c
It even says so on the MathWorks page I was trying to follow along on. RTFM!

Compiling DBD::mysql on SunOS 5.10

everybody
I apologize for the massive length of this post.
I am having some issues compiling DBD::mysql on SunOS.
# /usr/perl5/bin/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) =
ldflags (mysql_config) = -R/usr/sfw/lib -R/usr/sfw/lib/mysql
libs (mysql_config) = -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 (guessed ) =
Checking if your kit is complete...
Looks good
Using DBI 1.58 (for perl 5.008004 on sun4-solaris-64int) installed in /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/auto/DBI/
Writing Makefile for DBD::mysql
# /usr/sfw/bin/gmake
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/vendor_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.022\" -DXS_VERSION=\"4.022\" -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/vendor_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 242
Warning: duplicate function definition 'rows' detected in mysql.xs, line 752
gcc -c -I/usr/perl5/vendor_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.022\" -DXS_VERSION=\"4.022\" -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 -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
gmake: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1
Probably relevant information:
mysql_config --cflags
-I/usr/sfw/include/mysql -xstrconst -mt
mysql_config --libs
-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
file `which perl`
/usr/bin/perl: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
# perl --version
This is perl, v5.8.4 built for sun4-solaris-64int
ldd /usr/sfw/bin/mysql
libcurses.so.1 => /lib/libcurses.so.1
libmysqlclient.so.12 => /usr/sfw/lib/libmysqlclient.so.12
libz.so.1 => /usr/lib/libz.so.1
librt.so.1 => /lib/librt.so.1
libcrypt_i.so.1 => /usr/lib/libcrypt_i.so.1
libgen.so.1 => /lib/libgen.so.1
libsocket.so.1 => /lib/libsocket.so.1
libnsl.so.1 => /lib/libnsl.so.1
libm.so.2 => /lib/libm.so.2
libCstd.so.1 => /usr/lib/libCstd.so.1
libCrun.so.1 => /usr/lib/libCrun.so.1
libw.so.1 => /lib/libw.so.1
libthread.so.1 => /lib/libthread.so.1
libc.so.1 => /lib/libc.so.1
libaio.so.1 => /lib/libaio.so.1
libmd.so.1 => /lib/libmd.so.1
libmp.so.2 => /lib/libmp.so.2
libscf.so.1 => /lib/libscf.so.1
libdoor.so.1 => /lib/libdoor.so.1
libuutil.so.1 => /lib/libuutil.so.1
/usr/lib/cpu/sparcv8plus/libCstd_isa.so.1
/platform/SUNW,SPARC-Enterprise-T5120/lib/libc_psr.so.1
/platform/SUNW,SPARC-Enterprise-T5120/lib/libmd_psr.so.1
# 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
6663288 Upgrade to CGI.pm 3.33
REGEXP0 - fix for UTF-8 recoding in regexps - CVE-2007-5116
6758953 Perl Sys::Syslog can log messages with wrong severity
Built under solaris
Compiled at May 21 2009 03:59:02
#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
.
isainfo -v
64-bit sparcv9 applications
asi_blk_init vis2 vis
32-bit sparc applications
asi_blk_init vis2 vis v8plus div32 mul32
Any tips as how I should proceed, if possible in a step-by-step (for dummies) manner?
Thanks!
Try using a Sun compiler, which presumably compiled your mysql. Others have had this problem, too.