"MyProj.axf uses VFP register arguments, MyLib/libmy.a(my_file.o) does not"; both set to hard FP ABI

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

"MyProj.axf uses VFP register arguments, MyLib/libmy.a(my_file.o) does not"; both set to hard FP ABI

ソリューションへジャンプ
6,516件の閲覧回数
Slaymaker
Contributor III

Context

  • MyProj targets the RT1040 MCU compiles and runs successfully
  • MyLib is a Static C Library configured to build for the RT1040, and is configured to use hard FP
    • This is lua-5.4.4, for reference (just building liblua.a, not the two executables)
  • Both are set (by default) to Cortex-M7 and FPv5-FP-D16 (Hard ABI).

Error

After adding MyLib as a reference for MyProj and configuring the include dirs, linker search path, and adding lua as a library to link, building MyProj results in:

c:/nxp/mcuxpressoide_11.7.0_9198/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.7.0.202209140929/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: error: MyProj.axf uses VFP register arguments, ../../lua-test/src/\liblua.a(lauxlib.o) does not
...

Both projects' compiler command lines include the options -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb

Is there anything else I need to configure, or check? Is there a better way to proceed?

Many thanks,

Barrie

0 件の賞賛
返信
1 解決策
6,367件の閲覧回数
Slaymaker
Contributor III

I checked MyLib's "MCU C Compiler" -> "Preprocessor" -> "Defined symbols" and found that the IDE had defined __REDLIB__ (IIRC) when creating this project.

Even though MyLib is a library project properly configured to use hard floating point (full 32 bit, no less!) and not linked against RedLib, this prevented the use of the VFP floating point parameter passing ABI.

No idea why, but replacing that preprocessor macro with __NEWLIB__ fixed MyProj's link errors.

元の投稿で解決策を見る

0 件の賞賛
返信
7 返答(返信)
6,368件の閲覧回数
Slaymaker
Contributor III

I checked MyLib's "MCU C Compiler" -> "Preprocessor" -> "Defined symbols" and found that the IDE had defined __REDLIB__ (IIRC) when creating this project.

Even though MyLib is a library project properly configured to use hard floating point (full 32 bit, no less!) and not linked against RedLib, this prevented the use of the VFP floating point parameter passing ABI.

No idea why, but replacing that preprocessor macro with __NEWLIB__ fixed MyProj's link errors.

0 件の賞賛
返信
6,480件の閲覧回数
Slaymaker
Contributor III

Alice, many thanks for the suggestion. I'm missing something (trying to learn this so I understand how to debug and configure these things)... how, precisely, would the Redlib library headers that MyLib #includes prevent MyLib from using the VFP register parameter ABI?

Shouldn't the header files be ABI neutral?

I appreciate your help on this, I really want to understand how these things interact.

0 件の賞賛
返信
6,373件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Slaymaker 

Sorry I'm not very clearly this, while I can share your some material, you can have a look at:

<MCUXpresso IDE User Guide> ->  "19.4 Hardware Floating Point Support ".

 

BR

Alice

0 件の賞賛
返信
6,356件の閲覧回数
Slaymaker
Contributor III

Alice,

Yes, I've read that, and many other things too.

None of that explains why the RedLib header files would prevent a library (MyLib) that is configured for hard FP from using the VFP (hard FP) parameter passing ABI. I could understand if it were not a library, i.e. if it linked against RedLib, but it doesn't.

If you ever find out, I'd love to know, thanks.

- Barrie

0 件の賞賛
返信
6,417件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Slaymaker 

 

You can share your projects, I can help to check on my side.

 

BR

Alice

6,402件の閲覧回数
Slaymaker
Contributor III
Thanks, Alice!

I'm trying to learn here, so I'm asking for the technical details so I can understand how the choice of library headers (in MyLib) causes non-VFP parameter passing?

Where can I look for details on this? As you can see above, the compiler is being called with hard FP in both projects, so something more subtle is going on...
0 件の賞賛
返信
6,476件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Slaymaker 

 

How about try to change C library ?

 

BR

Alice