[mc1322x] linking in math libraries?

Mariano Alvira mar at devl.org
Wed Apr 7 16:56:05 EDT 2010


On Wed, Apr 07, 2010 at 01:05:13PM -0700, Andrew Pullin wrote:
> I just got some RedBee hardware and am familiarizing myself with ARM
> programming. I've been using the libmc1322x project codebase, just because all
> the startup code is already there for the RedBee boards.
> 
> I've noticed that if I #include<math.h> , and add -lm to the makefile, it makes
> the executable really large, about 500K if sqrt() is used. I know it has to
> include a fair bit of code for software floating point support, but that seems
> like a lot. My only point of reference is for the MSP430, where including
> software floats is ~10K of compiled code from msp430libc.
> 
> Is there something I am just overlooking? I know that floating point math will
> be slow, and I should learn fixed pointed properly, but I'm still interested to
> figure this out.

see:  

http://devl.org/pipermail/mc1322x/2010-March/000206.html

from map2dot.pl (in tools), it looks like k_standard.o is pulling in
assert.o which is pulling in a huge glibc tree. Normally when that
happens I replace the functions that are pulling in the whole tree (so
replace whatever k_standard.o is using from assert.o).

-Mar.



More information about the mc1322x mailing list