Precompiled Library using FPU - nRF52840

Hello,

I am trying to compile a mbed 5 project for nRF52840 using an external precompiled library which is for ARM Cortex M4F and getting following linker errors

/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: error: ./mbed-ZMOD4410-M4f/lib_iaq_2nd_gen.a(iaq_2nd_gen.c.o) uses VFP register arguments, ./BUILD/ADAFRUIT_NRF52840_FEATHER/GCC_ARM/mbed-feather-nRF52840-eval_application.elf does not
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file ./mbed-ZMOD4410-M4f/lib_iaq_2nd_gen.a(iaq_2nd_gen.c.o)

There seems to be a problem with missing FPU support (use of VFP register)

After adding compiler flags “-mfloat-abi=hard”, “-mfpu=fpv4-sp-d16” to debug.json/develop.json/release.json i am still getting this error.

Did i miss something?

Hello Wenzel,

I could be wrong but I think

error: ./mbed-ZMOD4410-M4f/lib_iaq_2nd_gen.a(iaq_2nd_gen.c.o) uses VFP register arguments

might mean that the external library was compiled in configuration to use the Virtual Floating Point (VFP) register i.e. to use soft floating point computation. Because you cannot change that you should try to adapt your project to the library. So try to use -mfloat-abi=softfp to make the project compatible with the library.