gcc -print-file-name and -mfpu option

Asked by Maximilian Pachl

Hello everyone,
I'm trying to compile an application for an ARM Cortex-M3. The application uses printf(). A fpu is specified with -mfpu=fpv4-sp-d16.
In order to find the correct libc the -print-file-name option is used as followed:
arm-none-eabi-gcc -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -print-file-name=libc.a

It points to the non-thumb version of libc:

When compiling the application with the same c flags thumb code is generated and is therefore not compatible with the libc.

When omitting the -mfpu=fpv4-sp-d16 parameter gcc points to the right library:
arm-none-eabi-gcc -mcpu=cortex-m4 -print-file-name=libc.a

What point do i miss?

Kind regards,
Maximilian Pachl

Question information

English Edit question
GNU Arm Embedded Toolchain Edit question
No assignee Edit question
Solved by:
Thomas Preud'homme
Last query:
Last reply:
Revision history for this message
Best Thomas Preud'homme (thomas-preudhomme) said :

Hi Maximilian,

The default floating-point ABI is the softfloat variant. Specifying an FPU with a softfloat variant is a contradiction that GCC does not understand so it falls back to give you the default multilib: the one for Armv4T in arm mode. If you add -mfloat-abi=softfp or -mfloat-abi=hard to your command line you'll get the expected results.

Best regards,


Revision history for this message
Maximilian Pachl (faryon93) said :

Thanks Thomas Preud'homme, that solved my question.

Revision history for this message
Maximilian Pachl (faryon93) said :

Hi Thomas,
thanks for your fast and detailed reply. You saved my day!

Best regards,