[RFC] libm replacement for Busybox

walter harms wharms at bfs.de
Fri Oct 10 17:07:52 UTC 2008



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 ?
We should add something like supplements/unsupported stuff to keep good idea
that are not incorporate for one reason or an other.

re,
 wh



More information about the busybox mailing list