This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Which instance of builtin library should I link with?

I'm using the ARM GNU toolchain 13.2 rel 1.  At higher levels of optimisation the compiler emits calls to memcpy, memset etc. which I cannot resolve.  

These routines are not provided by the runtime environment (this is a bare-metal embedded system).  However, I presume they're present in a (target dependent) library somewhere in this toolchain.  For example, there are many instances of libc_nano.a (and others) but I can't work out which (if any) to use.  My target is an iMXRT1062 which has a Cortex-M7 core, but I would like a generalised way to establish the correct library to link with.  

I guess there's a compiler option which prevents it from emitting these calls in the first place ( is it 'freestanding'?), but I assume this would result in less efficient code. 

Parents
  • So the general recommendation is to use the arm-none-eabi-gcc driver program to invoke the linking step. It knows where the libraries are placed and will figure out the correct library for you to use based on your command-line options.

    This means that if you use the arm-none-eabi-gcc binary for the linking step as: `arm-none-eabi-gcc -mcpu/-march <.o files>`, then the correct library will be pulled in automatically :)

Reply
  • So the general recommendation is to use the arm-none-eabi-gcc driver program to invoke the linking step. It knows where the libraries are placed and will figure out the correct library for you to use based on your command-line options.

    This means that if you use the arm-none-eabi-gcc binary for the linking step as: `arm-none-eabi-gcc -mcpu/-march <.o files>`, then the correct library will be pulled in automatically :)

Children