V3 static data in classes vs AIX

Jason Merrill jason_merrill@redhat.com
Tue Jun 5 08:06:00 GMT 2001


>>>>> "Mark" == Mark Mitchell <mark@codesourcery.com> writes:

> I'm proposing is that we not define *any* template static data
> members.  We already do not define ones that are explicitly
> initialized -- but we try to be clever and do define (using COMMON)
> variables that are defined, but not explicitly initialized.

> Even if it does not fix your problem, the change I'm suggesting
> *cannot* make the compiler more broken.

I disagree.  The bug here is that COMMON symbols are not combined between
shared libraries by default on AIX.  This will break anything that uses
COMMON, not just this use for templates.

Non-ELF targets that are not broken in this way can still benefit from
automatic instantiation of zero- or dynamically-initialized template
statics.

I think it would make sense to add a target macro for AIX to say that
COMMONs are not always combined, and conditionally disable the code in
question.

Of course, we can run into similar trouble on ELF with -Bsymbolic...

Jason



More information about the Libstdc++ mailing list