[nano-]newlib libraries and cortex-m3, ldr problem

Asked by Martin Velek

Hello,

how is managed the -mfix-cortex-m3-ldrd in [nano-]newlib? As far as I know, the library is compiled for armv7-m (arm-none-eabi-gcc --print-multi-lib) but not with -mcpu=cortex-m3. Does it mean that when I compile my code with -mcpu=cortex-m3 and use the libary with ../arm-none-eabi/lib/armv7-m/libc.a I could get error in LDR? I suppose neither compiler nor linker will modify code in the library.

Martin

Question information

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

Hi Martin,

-march=armv7-m is actually equivalent to -mcpu=cortex-m3 and as you know this fix is enabled by default for cortex-m3. Therefore, newlib and newlib-nano for cortex-m3 are effectively built with the fix enabled and you will not get any error when using them.

Best regards,

Thomas

Revision history for this message
Martin Velek (martin-velek) said :
#2

Thanks Thomas Preud'homme, that solved my question.