Removing dependency to libgcc_s.so

Rich Felker dalias at aerifal.cx
Sat Jul 22 22:58:05 UTC 2006


On Sat, Jul 22, 2006 at 08:50:43AM -0700, David Daney wrote:
> Rich Felker wrote:
> >If a particular user wants to disable the dependency on libgcc_s, all
> >they need to do is tell gcc to use the static libgcc (in which case
> >only the needed functions will be linked) or add -lfoo to their
> >LDFLAGS (where libfoo.a is a library replacing the needed functions
> >from libgcc). There's no need for BB to do this for them and create
> >extra nasty layers of low-level hacks.
> >
> >  
> 
> libgcc is split into two parts libgcc.a and libgcc_s.so.1.  The 
> functions in question are all already supplied by libgcc.a (one function 
> per object) .  There is no need to do anything more.  They are already 
> supplied in the optimal form.

Optimal form? Are you sure? The optimal form of __udivdi3 is just a
few opcodes in almost all cases on x86. More bloat is needed to
support the general case (more than 32 bits in denominator) that never
gets used in practice, but certainly not all the bloat of libgcc.

> The default gcc behavior is to resolve 
> these symbols by statically linking to libgcc.a.  If you are *not* using 
> exception handling, the presence of a DT_NEEDED tag for libgcc_s 
> indicates a bug in the tool chain, not some maniacal  plot to bloat BB.  
> You don't have to specify -static-libgcc (although that would be an easy 
> work around for the case in question), it should just work.

I see. I don't approve but I see how they're doing it.

Rich




More information about the busybox mailing list