Context
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
解決済! 解決策の投稿を見る。
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.
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.
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.
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
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