sqrtf is linking the wrong libm.a library
Hi,
Using the windows compiler gcc-arm-
I'm compiling with these options:
-mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-
and linking with these options:
-mcpu=cortex-m4 -mthumb
I made those selections based on what is in the readme.txt which lists the architecture options.
From the map file I can see it has linked:
/arm-none-
When I run the code the function call to sqrtf() gets the wrong result:
x = sqrtf(y)
The function returns y unchanged and assigns it to x.
I expect the linker should have used the /fpu/libm.a library (not the no-floating point one). However, I can not get it to use the fpu directory. Note, the diss-assembly shows it using hardware fp instructions.
When I change the float-abi option to -mfloat-abi=softfp the sqrtf works and gives the right result. However, the map file shows the linker is still using the base ./libm.a and not the /softfp/libm.a
Hope you can help
David.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Terry Guo
- Solved:
- Last query:
- Last reply: