I have problem with linking libgcc.a in my project. I need to use sqrtf and log10f, so I have added libgcc.a in makefile by add linker flag "-lm", math.h as include in module and everything compile great but something went wrong in my opinion. When I looked more deeply into mapfile, simply use of sqrtf causes linking also function for double precision floating point handling, for example:
__aeabi_dadd, __aeabi_d2f, __aeabi_ddiv
and many more. I really don't know why single precision implementation of sqrtf or log10f, especially when FPU is on, links double precision functions. I looked into disassembly and I did not find uses of this function in my code. Only in library I found occurrences.
My toolchain is: arm-none-eabi version 6-2017-q2 Core: Cortex-M4F, FPU hardware enabled in linker
Does anyone have any idea why it is happening like this? Code size is really important for me in this case. Thanks for help in advance.
You need a version of the standard library (libc+libm) built for an ARM hardfloat (normally "armhf"/"arm-*-eabihf" ABI, although you could use the plain eabi still but with use of VFP instructions, i.e. gcc's "softfp" mode, enabled) target. Otherwise the simple fact that you're configuring hard float support at compile time is not going to change the fact that your libc/libm contain code that was compiled to reference soft-float libgcc functions.