[RFC] libm replacement for Busybox

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Oct 10 15:13:42 UTC 2008


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.



More information about the busybox mailing list