[RFC] libm replacement for Busybox

Rob Landley rob at landley.net
Sun Oct 12 03:13:35 UTC 2008


On Friday 10 October 2008 12:07:52 walter harms wrote:
> Bernhard Reutner-Fischer schrieb:
> > On Fri, Oct 10, 2008 at 04:21:51PM +0200, Loïc Grenié wrote:
> >>     I've noticed that busybox uses few functions from libm.
> >
> > Actually, you can turn off ASH_MATH_SUPPORT_64 FEATURE_AWK_MATH and
> > you don't need libm at all.
> >
> >>  I've written some replacements for those functions. Right
> >>  now this is just the test program and I've not made the
> >>  effort of including them in Busybox. However I'd like to
> >>  have your opinion: would it be a good idea to include
> >>  them ?
> >
> > I don't think so (but perhaps vda likes it anyway). Just:
> > 1) turn off the abovementioned two features
> > or, if either of that is really needed desperately, you can
> > 2a) link busybox statically (very likely in the scenarios you mention
> >   below)
> > 2b) Use a trimmed libm which only contains those few functions that will
> >   be needed by your initramfs (usually 0, see #1 above).
> >
> >>    They are neither very fast nor very precise (the
> >>  trigonometric functions are awful, up to 16 bits are
> >>  false) but libm is rather large and usually a user of
> >>  Busybox on an initrd or embedded platform does not
> >>  need neither speed nor excellent precision. Otherwise
> >
> > I think that neither of them need ASH_MATH_SUPPORT_64 FEATURE_AWK_MATH,
> > so busybox wouldn't link against libm anyway.
>
> Hi Bernhard,
> you are right but the idea is nice and we do not have a lot of libm
> functions.
>
> Perhaps we can put these functions on the bb webpage ?

Well, considering uclibc.org is the same server as busybox, they sort of 
already are.

> We should add something like supplements/unsupported stuff to keep good
> idea that are not incorporate for one reason or an other.

Whatever happened to "simple"?  Small, simple, not having 8 gazillion #ifdefs 
like the gnu bloatware that takes all day to figure out what code connects to 
what and which of the conflicting implementations for any given chunk of 
functionality winds up being used...

I liked simple.

Rob



More information about the busybox mailing list