ARMCLANG: Selecting software floating-point option for AArch32
Information in this knowledgebase article applies to:
I'm working on an AArch32 based target device. In my project I only want to use software floating-point libraries for my floating-point operations, instead of using the hardware FPU on my device. How should I specify in compiler and linker options in command line to achieve this without using MDK µVision IDE?
When compiling for AArch32, by default, Arm Compiler uses floating-point hardware that is available on the target. To disable the use of floating-point hardware instructions, use the compiler -mfpu=none option, e.g.
armclang --target=arm-arm-none-eabi -march=armv7e-m -mfpu=none
On AArch32 targets, using -mfpu=none disables the hardware for both Advanced SIMD and floating-point arithmetic. If the compiler encounters floating-point types in the source code, it will use software-based floating-point library functions. This is similar to the -mfloat-abi=soft compiler option.
And for the Arm linker, the linker option --fpu=SoftVFP should be used, in order to tell the linker you don't want to use the floating-point hardware, so that a certain of floating-point initialization modules, such as _fp_init, won't be linked into your image. e.g.
Note that the Arm linker option --fpu=none should only be used when no floating-point code is used at all in your project.
Last Reviewed: Friday, June 28, 2019
of your data.