[mc1322x] linking in math libraries?

Jon Smirl jonsmirl at gmail.com
Wed Apr 7 17:06:01 EDT 2010


On Wed, Apr 7, 2010 at 4:56 PM, Mariano Alvira <mar at devl.org> wrote:
> 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.

If you have lots of time to waste, you can try getting newlib to work.
http://sourceware.org/newlib/

It will work and fix this type of problem, but it is difficult to get
it building correctly.

>>
>> 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.
>
> _______________________________________________
> mc1322x mailing list
> mc1322x at devl.org
> http://devl.org/cgi-bin/mailman/listinfo/mc1322x
>



-- 
Jon Smirl
jonsmirl at gmail.com



More information about the mc1322x mailing list