This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Howto build production system with gcc-3.2.1


Hello!

What is stability of gcc-3.2.1?
I've tried to upgrade my system from gcc-2.95.3 to gcc-3.2.1
and got the strange results!
All problems were related with thread applications only
(Almost all single-thread apps works just fine)
First step: I've build gcc-3.2.1 with usig of gcc-2.95.3
as ./configure --prefix=/usr
make all CFLAGS="-march=athlon -O2 -fomit-frame-pointer -fschedule-insns2 -pipe -ffast-math"

Second step: I've rebuild gcc-3.2.1 with just compiled gcc-3.2.1:
./configure --prefix=/usr --enable-threads
make all CFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -fschedule-insns2 -pipe -ffast-math"

I've intentionally added --enable-threads flag to configure since it affects run-time libraries!

Third step: I've tried to recompile many applications and it seems that they became faster!

Well, I've tried to recompile glibc-2.2.5 as:
./configure --prefix=/ --exec-prefix=/ --enable-add-ons --disable-static --enable-shared --disable-profile --disable-debug --enable-kernel=2.4 --enable-omitfp
make all CFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -fschedule-insns2 -pipe -ffast-math"

After that every thread based application became unstable! :(
I've tried to compile simplest source:

#include <pthread.h>
void* func(void *arg) { return arg; }
int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }

and this code causes segfault!

According on gdb's ouput segfault happens after exit this program:
#0  0x40073c91 in __kill () at __kill:-1
-1      __kill: No such file or directory.
        in __kill
(gdb) bt
#0  0x40073c91 in __kill () at __kill:-1
#1  0x40073a86 in raise () from //lib/libc.so.6

Dump of assembler code from 0x40073c82 to 0x40073ca0:
0x40073c82 <__kill+2>:  mov    0x8(%esp,1),%ecx
0x40073c86 <__kill+6>:  mov    0x4(%esp,1),%ebx
0x40073c8a <__kill+10>: mov    $0x25,%eax
0x40073c8f <__kill+15>: int    $0x80                   <---------------- causes segfault 
0x40073c91 <__kill+17>: mov    %edx,%ebx
0x40073c93 <__kill+19>: cmp    $0xfffff001,%eax
0x40073c98 <__kill+24>: jae    0x40073c9f <__kill+31>
0x40073c9a <__kill+26>: ret
0x40073c9b <__kill+27>: mov    (%esp,1),%ebx
0x40073c9e <__kill+30>: ret
0x40073c9f <__kill+31>: push   %ebx

When I've restored the "good old" gcc-2.95.3 and recompiled glibc-2.2.5 again
then everything works just fine now!
What I have missed? Any ideas please!

WBR! Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]