Profiling newlib-nano’s memcpy | Interrupt

Newlib is a very popular libc targeting embedded systems. It’s the libc that ships with the GNU Arm Embedded Toolchain published by ARM.


This is a companion discussion topic for the original entry at https://interrupt.memfault.com/blog/memcpy-newlib-nano

Any idea what license governs the newlib implementation posted above? It looks like the source just provides a single file with every license used by the entire library

I believe it’s 3-clause BSD (or compatible, MIT).

Hi! To find out what I can do, say @discobot display help.

This post is useful for my project, I’m wondering though exactly why it does pick the byte copy. I didn’t see in your example that in enables __OPTIMIZE_SIZE__ only __OPTIMIZE__.

Apologies, that was a mistake! I’ve edited the article to correct that (thanks for pointing it out!).

I was using custom memcpy() (simply defined this function in one of my project file) and things were working fine , no need to define OPTIMIZE_SIZE as per this post.
But when i move to latest toolchain (14.2.rel1-x86_64-aarch64-none-elf) , linker is complaining about multiple definitions of memcpy (one coming from libc.a and other coming from my custom implementation) .
Any idea how to tell linker not to use libc.a’s memcpy and use my custom ?
Also , interested to know how older toolchain (12.3) works without any problem.