Removing dependency to libgcc_s.so

Rich Felker dalias at aerifal.cx
Mon Jul 24 18:45:11 UTC 2006


On Mon, Jul 24, 2006 at 08:31:54PM +0200, Michael Hunold wrote:
> >> So it is more about getting rid of libgcc, even though it is needed. As
> >> suggested, this can either be done by directly replacing the functions
> >> (ie. __divdi3) or by providing substitutes (ie. div64()).
> > 
> > What you want is to get rid of libgcc_s.so, not the statically linked
> > libgcc.a.  Since the linker bug is biting you, I would suggest linking
> > with -static-libgcc instead of the contortions that you are using.
> 
> I'm confused now. Is 64bit division now part of libgcc_s.so or is gcc
> supposed to statically link in the stuff from libgcc.a even though the
> application is dynamically linked?

libgcc_s.so contains _only_ the functions that would cause abi
problems if different .so's linked together were using different
versions of them, i.e. the exception handling crap. Before gcc3
everything from libgcc was always static linked.

> Thanks for your suggestion, I'll try -static-libgcc tomorrow and see
> what the result is. If this works, everything else is probably not worth
> the effort.

It will definitely work.

> > Re-implementing the proven code in libgcc although fun, is not
> > particularly useful.  The time would be better spend fixing the linker.

It is useful because you can shrink the code size by 4-6k... But it's
an ugly hack and should not be enabled by default, IMO.

Rich




More information about the busybox mailing list