Having trouble linking maths libraries

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable
I found in the Yagarto toolchain there are several libm.a

lib/thumb/libm.a

lib/thumb/v7m/libm.a

lib/libm.a

I tried to link to all of these libraries. But they all seem to be built for thumb.

I dont see a folder such as lib/thumb2, which supposedly will hold thumb2 libraries.

Do you know if the Yagarto toolchain supports the thumb2 math library?

also, when i run option --print-multi-lib, i get the following output:

C:yagarto-20121222 in>arm-none-eabi-gcc.exe --print-multi-lib

.;

thumb;@mthumb

thumb/v7m;@mthumb@march=armv7

thumb/v6m;@mthumb@march=armv6-m

I dont see thumb2 being listed there. Or, maybe, thumb implies thumb2 in this output?
0 Likes
2 Replies
Anonymous
Not applicable
We did include "-mthumb -mcpu=cortex-m3 -mfpu=softvfp" as link flags in our test.

BTW, given a library such as libm.a, how can I know if its built for ARM or thumb2?
0 Likes
Anonymous
Not applicable
Hmmm, looks like we missed the step to re-generate the actual binary after linking with libm.a.

After re-generating the binary, both libm.a under lib/thumb works for STM32F2xx!

The lib/thumb/v7m/libm.a generates smaller code, which makes sense as Cortex-M3 is ARMv7m architecture.
0 Likes