From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Slepuhin To: David Edelsohn Cc: egcs@cygnus.com Subject: Re: AIX & shared libstdc++ Date: Tue, 07 Oct 1997 23:14:00 -0000 Message-id: <343A933D.207E8FD4@msu.ru> References: <9710071523.AA28892@rios1.watson.ibm.com> X-SW-Source: 1997-10/msg00309.html 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. 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.