Removing dependency to libgcc_s.so

Rich Felker dalias at aerifal.cx
Sun Jul 23 02:18:22 UTC 2006


On Sat, Jul 22, 2006 at 06:58:05PM -0400, Rich Felker wrote:
> 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.

BTW, this brings up a point: one useful BB compiletime option would
be: omit support for division with 64 bit denominator. Or
alternatively use ultra-slow but tiny code for it (loop and subtract).
You can even write an efficient __udivdi3 in C if you don't care about
the 64 bit denominator case. The majority of the BB code only has one
denominator for 64 bit division: 10. The only place I can think that
would need other denominators is shell arithmetic and the like.

Rich




More information about the busybox mailing list