This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Exceptions, Optimizations and AIX
- From: "Michael Veksler" <VEKSLER at il dot ibm dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Joerg dot Richter at pdv-FS dot de
- Date: Tue, 2 Sep 2003 18:52:17 +0300
- Subject: Re: Exceptions, Optimizations and AIX
- Sensitivity:
> A little supplement:
>
> I just tried building all my objects/libraries with -O1 and it works.
>
> So mixing different objects/libraries with different optimization levels
> doesn't work.
> This is not what i would expect. Can you please confirm that this should
> work?
I found that on some circumstances it may look it is a matter of
optimization flags when in fact one of the following happens:
1. You forgot to add a link flag: -Wl,-brtl
This will break many things, including static variables
of template classes.
2. When you created two different shared objects, you created
them in the following way:
gcc -shared first.o -o tmp.so && mv tmp.so first.so
gcc -shared second.o -o tmp.so && mv tmp.so second.so
This will break your global variable construction.
In all cases, when global variables get broken, it is possible
to have exceptions broken as well.
One annoying thing that I have noticed for AIX-4.3.3 and at least
gcc-3.2, is that exception handling information gets constructed
after global variables are. This means that 'catch' does not
work in constructors of global variable.
I have not checked that for newer gcc's yet.