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

libc.a picked from default instead of thumb fro ARM M0+

My project has 3 makefiles. The first building the application. The two internal makefiles are called from main makefile to build the libraries used in the main makefile. 

The CFLAGS(compiler options) passed on during compile time does not have any effect (especially the micro defination) during building of the libraries. They are required during main makefile. 

But for libraries they don't have any impact during compile time.

This causes the libraries when linked with the application to pick the default libc.a instead of the one defined in thumb versions. 

Which options are used to compile the libraries? And how can they be changed?

  • I compile for Cortex M3, using the arm-none-eabi toolchain.  I need -mcpu=cortex-m3 in both compiler rules, which I can achieve by adding that option to CFLAGS (I don't do it that way, but could).  I also need the -mcpu=cortex-m3 at link time, so could add to LDFLAGS (again, I choose to do it another way), but in  the end, the linker must see -mcpu=cortex-m3 on its command line.