cancel
Showing results for 
Search instead for 
Did you mean: 

FPU options between GCC and Keil - Link error

mfm
Associate II
Posted on May 22, 2014 at 14:13

Hi,

Using the STM32F407 discovery board, when trying to link with Keil (armlink) against a static library built with GCC, I encounter the following link error:

Object toto.o contains Build Attributes that are incompatible with the CPU attributes.

    Tag_ABI_HardFP_use = Permitted VFP use is implied by Tag_VFP_arch (=0)

The gcc options for building the library are:

-mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=hard -mfp16-format=ieee -mfpu=fpv4-sp-d16 -fsingle-precision-constant

In Keil options are:

for armcc: --littleend --fpu=fpv4-sp --fp16_format=ieee --thumb --wchar32 

for armlink: --remove --littleend --fpu=fpv4-sp

I can see the difference between an obj file in the lib and an obj file build with keil (extract with fromelf tool):

- built with gcc:

Tag_ABI_HardFP_use = SP and DP operations are permitted to use VFP instructions (=3)

- built with keil

Tag_ABI_HardFP_use = SP operations are permitted to use VFP instructions (=1)

To be noted that both files have the same: Tag_VFP_arch = VFPv4 instructions were permitted, but only citing registers D0-D15 (=6)

So I want to know how to solve that out?

Thanks.

#fpu-gcc-keil-link-error
0 REPLIES 0