This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with shared libraries, exceptions, and global constructors
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: David Edelsohn <dje at watson dot ibm dot com>, Richard Henderson <rth at redhat dot com>, Bernd Schmidt <bernds at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 19 Aug 2003 10:30:19 +1000
- Subject: Re: Problem with shared libraries, exceptions, and global constructors
- References: <gdr@integrable-solutions.net> <200308181841.OAA29606@makai.watson.ibm.com> <jm4r0efrmc.fsf@desire.geoffk.org>
On 18-Aug-2003, Geoff Keating <geoffk@geoffk.org> wrote:
> David Edelsohn <dje@watson.ibm.com> writes:
>
> > [Sorry for the previous reply.]
> >
> > >>>>> Gabriel Dos Reis writes:
> >
> > Gaby> Pardon the question: It is a feature? I'm pretty sure I'm seen many
> > Gaby> bug reports where the symptoms described by Bernd were reported.
> > Gaby> What I'm saying is that, in the small your advice it quite
> > Gaby> straightforward to follow. For a large project however, I think that
> > Gaby> quickly gets out of hand. Isn't there anything that can be done?
> >
> > I am aware of some projects that explicitly do not link with all
> > dependent libraries due to circular dependencies.
>
> That's not really a reason, because you can always create stub
> libraries for bootstrapping purposes, and so long as you're careful
> about the order you link everything you can get a predictable startup
> sequence.
But having a predicatable startup sequence won't necessarily solve the
problem. Predictably wrong is still wrong! Consider the following two
translation units:
/* bug1.cc */
extern int bar();
int foo ()
{
try { throw 1; } catch (...) {}
return 0;
}
int x = bar();
/* bug2.cc */
extern int foo ();
int bar () {
try { throw 1; } catch (...) {}
return 0;
}
int z = foo ();
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.