This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: shared c++ lib on powerpc-ibm-aix4.1.5.0. Done by hand!


Paul Maragakis wrote:
> Get a list of the exported symbols:
> 
> cd objdir/libraries/libstdc++/
> for i in `cat piclist`; do \
> nm -BChg $i | grep " D " | cut -c14- >> libnewstdc++.exp; \
> done
> 
> Link the shared object:
> 
> ld -o libnewstdc++.so `cat piclist` -bE:libnewstdc++.exp -bM:SRE \
> -lm -L [path to egcs gcc library ...gcc-lib/powerpc-ibm... ]
> -lgcc -lc
> 
> Put into an archive so that linking goes with normal procedures:
> 
> ar qv libnewstdc++.a libnewstdc++.so

You are not correct, because linking a shared C++ library needs 
additional code for global constructors/destructors calls. This
extra code is generated by collect2 routine, but current implementation
is not correct.

Andrey.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]