The target is a PC104 pentium 266. I see the same problem on our server,a pentium 4 1.3Ghz.
Here is a sample test case I made. When executed, nothing will be catched but a SIGABRT will be raised and it will enter the SignalHandler function.
First the main program.
/main.cpp/
#include <stdio.h>
#include <stdlib.h>
#include <iostream.h>
#include <signal.h>
#include “mysharelib.hpp”
void SignalHandler( int sig_no)
{
cout << "signal catched! no " << sig_no << endl;
exit(0);
}
int main(int argc, char *argv)
{
signal(SIGABRT,SignalHandler);
try{
ThrowSomething();
}
catch(…){
cout << "Catch somethihg " << endl;
}
cout << “The end” << endl;
return 0;
}
The makefile does this to compile
QCC -O0 -DNDEBUG -w8 -Wc,-mcpu=pentium,-march=pentium,-fomit-frame-pointer,-freg-struct-return -fhonor-std -fno-builtin -fno-default-inline -I mysharelib -c -o obj/test.o ./test.cpp
QCC -O0 -DNDEBUG -w8 -Wc,-mcpu=pentium,-march=pentium,-fomit-frame-pointer,-freg-struct-return -fhonor-std -fno-builtin -fno-default-inline -o ./main obj/test.o -L mysharelib -l mysharelib
Then the sharelib
/* mysharelib.cpp*/
#include <stdio.h>
#include <stdlib.h>
#include <iostream.h>
#include “mysharelib.hpp”
void ThrowSomething(void)
{
throw(123);
return;
}
And the include
/* mysharelib.hpp */
void ThrowSomething(void);
The makefile for the share lib is
nice QCC -O0 -DNDEBUG -w8 -Wc,-mcpu=pentium,-march=pentium,-fomit-frame-pointer,-freg-struct-return -fhonor-std -fno-builtin -fno-default-inline -shared -fPIC -c -o obj/mysharelib.o ./mysharelib.cpp
echo Linking to ./libmysharelib.so
Linking to ./libmysharelib.so
rm -f ./libmysharelib.so
qcc -o ./libmysharelib.so -shared -W,-soname=./libmysharelib.so obj/mysharelib.o