V3 problems
Mark Mitchell
mark@codesourcery.com
Mon Feb 5 10:51:00 GMT 2001
>>>>> "benjamin" == benjamin kosnik <bkoz@nabi.net> writes:
>> If you have time to look at this, that would be very good.
benjamin> ok I'll look at it today. Let me start my build...
See subsequent message. I think you're off the hook, sort -of.
In fact, David has just prodded me into figuring out what's up.
What's up is that we have undefined symbols in the V3 library.
This comes from code similar to this:
template <class T>
struct S {
template <class U>
void f();
void g();
};
template <class T>
template <class U>
void S<T>::f() {}
template <class T>
void S<T>::g() { f<double>(); }
template class S<int>;
Here, note that S<int>::g will be explicitly instantiated, and thus
externally visible on AIX. However, S<int>::f<double> will have
internal linkage, since it is implicitly instantiated and there are no
weak symbols.
Then, if in another file, you do:
template <class T>
struct S {
template <class U>
void f();
void g();
};
int main () {
S<int> si;
si.g();
si.f<double>();
}
you will find that you have unstatisfied externals on AIX.
This means that V3 is not explicitly instantiating enough stuff.
(Anything the library needs to "close" itself must be explicitly
instantiated on AIX.)
I will add the appropriate explicit instantiations; hopefully that
will fix one more round of problems.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
More information about the Gcc
mailing list