egcs-1.0.1 problem on aix4.2
David Edelsohn
dje@watson.ibm.com
Fri Jan 9 16:41:00 GMT 1998
[I cannot send email directly to Craig for some reason, so I only am
emailing the entire list.]
>>>>> Craig J Copi writes:
>> I have encounted a problem compiling some c++ code that uses a few stl
>> containers. A short sample of that creates the problem is included below. I
>> haven't seen any comments on this so I'm concerned that I compiled/installed
>> egcs improperly. Any insight would be appreciated. I can send more
>> information if needed. The code I tested compiles find under aix4.2 with
>> egcs-1.0 and under solaris2.5.1 with egcs-1.0 and egcs-1.0.1.
>>>>> Joe Buck writes:
Joe> (two files, each of which instantiates vector<double> functions).
>> Here is the result of running g++ -v tmp.c++ tmp1.c++
>> [ on rs6000 / aix 4.2 ]
>> ld: 0711-224 WARNING: Duplicate symbol: __malloc_alloc_template<0>::__malloc_alloc_oom_handler
Joe> Hmm. The strategy of generating duplicate definitions and having the linker
Joe> eliminate all but one is intentional on at least some platforms. It seems
Joe> that the real problem is that the linker is issuing warnings about it
Joe> (perhaps meaning that this technique can't be used on aix4.2). I don't
Joe> understand why 1.0 and 1.0.1 are doing something different though.
First, this only is a warning; GCC frequently produces this type
of warning on AIX. The problem is exacerbated on AIX because collect2
tries to "export" every global symbol. Many other Unix vendors do this by
default, but AIX implemented explicit export lists for symbols to avoid
the dependency problem that Kenner discussed with the exception handling
API change. collect2 tries to make AIX behave like other Unix systems,
especially for shared libraries, and the AIX linker gets especially upset
when duplicate symbols are exported.
I do not know why or understand how this changed between egcs-1.0
and egcs-1.0.1 when the rs6000 AIX port of GCC did not change in any way
that would affect this. Andrey Slepuhin has performed a marvelous service
and completed a rewrite of collect2 support for AIX which should address
some of these problems. That should be included in egcs-1.1/gcc-2.9 when
I can finish validating it and some small details can be cleaned up.
David
More information about the Gcc
mailing list