This is the mail archive of the gcc@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]

Re: Problem with shared libraries, exceptions, and global constructors


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.


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