In the case of compiling with newlib, _exit was not being resolved
from libc_stubs.c in the BSP. I believe this has to do with link
stage, and adding -specs=nosys.specs does the right thing: but I have
not tested this.
In general, we should probably look to trim down libc_stubs.c. With
this new compiler option, I can completely eliminate this file on the
NRF52DK BSP. Ironically, _exit is the only libc stub we actually
override with anything useful :-) But I’d be interested in folks
thoughts here, perhaps we want to keep libc_stubs around for when we
support other compilers.
I have tested that _exit gets properly resolved, and removed
libc_stubs.c from all of the BSPs. They now get libc stubs from GCC,
and _exit is defined in a new file, hal_common.c to call system_reset().
Sterling