AIX & shared libstdc++

Andrey Slepuhin pooh@msu.ru
Tue Oct 7 23:14:00 GMT 1997


David Edelsohn wrote:
>         I am somewhat surprised that -bexpall does not export all
> necessary symbols.  That is not the default because it can cause
> significant bloat and is not the way that XLC operates.  AIX linker
> performs garbage collection on symbols and removes any symbols which are
> not referenced or exported.  If -bexpall does not trivially work around
> the problem, one must use something like makeC++SharedLib.  Note: IBM's
> C++ compiler and G++ use different name mangling schemes, so assumptions
> about the internal structure of C++ symbols is incorrect.
Some times ago I experimented on building shared libs with GCC 2.7.2
and I had to hack makeC++SharedLib to do this. So, I was surprised that
I obtain export list without any problems. The only things I cannot
understand are the following:
1) I obtain many warnings about undefined symbols which are really class names
themselves (for example, range_error), so I remove these symbols from export
file.
2) When linking programs with shared libstdc++, I obtain warnings about
multiple defined symbols like __eh<something>. After removing these symbols
all my test programs linked and worked fine.
3) I am worried about shared libstdc++ size (2.3M instead of 3M static). This
can be caused differences in library structure (for example a large number of
separate modules in ar file), but I cannot check this.

> Andrey> PS: Passing option -unix to linker is incorrect on AIX, because AIX
> Andrey> linker
> Andrey> recognize it as option -u with a parameter "nix". As a result there
> Andrey> are
> Andrey> many linker warnings.
> 
>         Who is passing -unix option to linker?  That is not in the GCC
> specs.  Does libstdc++ assume that?

Yes. Jason Merrill said that this option is needed for gnu ld. Did you try
to build egcs configured with --with-gnu-ld option?

Andrey.



More information about the Gcc mailing list