Hi
Friends
I am using the log4cxx in my application And want to install it on solaris 8 having sparcv9 & sparc.
while installing that i am specifying options as
env CPPFLAGS="-xarch=generic" ./configure --with- SMTP=libsmtp
So configuration is fine,But on make ,error occured at thread.cpp as
source='thread.cpp' object='thread.lo' libtool=yes \
depfile='.deps/thread.Plo' tmpdepfile='.deps/thread.TPlo' \
depmode=none /bin/bash ../depcomp \
/bin/bash ../libtool --mode=compile CC -DHAVE_CONFIG_H -I. -I. -I../include/log4cxx -I../include -I/opt/csw/include/libxml2 -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -xarch=generic -w -D_REENTRANT -g -c -o thread.lo thread.cpp
CC -DHAVE_CONFIG_H -I. -I. -I../include/log4cxx -I../include -I/opt/csw/include/libxml2 -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -xarch=generic -w -D_REENTRANT -g -c thread.cpp -KPIC -DPIC -o .libs/thread.o
"thread.cpp", line 94: Warning (Anachronism): Formal argument 3 of type extern "C" void*(*)(void*) in call to pthread_create(unsigned*, const _pthread_attr*, extern "C" void*(*)(void*), void*) is being passed void*(*)(void*).
1 Warning(s) detected.
"/tmp/yabeAAAZJaykN", line 2155: error: cannot use v8plus instructions in a non-v8plus target binary
Failure in /export/home/uxapps/workshop/SUNWspro/bin/../WS6U2/bin/fbe, status = 0x100
Fatal Error exec'ing /export/home/uxapps/workshop/SUNWspro/bin/../WS6U2/bin/fbe
*** Error code 1
make: Fatal error: Command failed for target `thread.lo'
Current working directory /home/it2005/Solaris/Packages/log4cxx-0.9.7/src
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Actually i found the statment creatting errors r
In thead.cpp there is a function
1 #if defined(sparc) && defined(__SUNPRO_CC)
2 extern "C" long sparc_atomic_add_32 (volatile long* p, long val);
3 static void asm_code()
4 {
5 asm(".align 8"); \
6 asm(".global sparc_atomic_add_32"); \
7 asm(".type sparc_atomic_add_32, #function"); \
8 asm("sparc_atomic_add_32:");
9 asm(" membar #Lookaside | #LoadLoad | #LoadStore | #StoreLoad");
10 asm(" ld [%o0], %l0"); // l0 = *p;
11 asm(" add %l0, %o1, %l2"); // l2 = l0 + val
12 asm(" cas [%o0], %l0, %l2"); // if (*p = l0) swap([o0], l2);
13 asm(" cmp %l0, %l2"); // does it match
14 asm(" bne sparc_atomic_add_32");// if not try again
15 asm(" nop"); // delay slot filler
16 asm(" add %l2, %o1, %o0"); // set return code
17 asm(" membar #Lookaside | #LoadLoad | #LoadStore | #StoreLoad");
18 asm("retl");
19 asm("nop");
20 }
21 #endif
And when i put statement 9 , 12 & 17 in comment so it compiled successfully, But probelm occuerd is that ,the final library fail to support any Dyanmic changes to config file and many more
That stament are
9 asm(" membar #Lookaside | #LoadLoad | #LoadStore | #StoreLoad");
12 asm(" cas [%o0], %l0, %l2"); // if (*p = l0) swap([o0], l2);
17 asm(" membar #Lookaside | #LoadLoad | #LoadStore | #StoreLoad");
So please somebody help me for this how can i replace these instruction to compile the log4cxx
Regards
Jayant