You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by marko kiiskila <ma...@runtime.io> on 2015/12/01 20:26:42 UTC

baselibc

Hi,

I brought in baselibc as a replacement Libc implementation due to it’s
small footprint.

And it gives significantly better results at least code size-wise. However,
it’s use is not automatic. If you want your project to use it (instead of newlib
version included in compiler build), you must list as an egg dependency
in the project file.

I use it for bootloader and lua test project, so you can check what
it looks like (should be obvious; list libs/baselibc as dependency).

Again, let me know if you run into issues. And/or other commentary.

If the project uses libc routines which are not part of baselibc, you can
see this when running ‘newt target size’. It’ll show where code/data comes
from.

E.g.:
[marko@IsMyLaptop:~/src3/larva]$ newt target size lua_f3disc
Inspecting target lua_f3disc (project = luatest)
  FLASH  CCMRAM     RAM 
     88     512     915 *fill*
    124       0       0 crt0.o
    100       0      32 crtbegin.o
      4       0       4 crtend.o
      8       0       0 crti.o
     16       0       0 crtn.o
   3686       0      50 libbaselibc.a
     84       0       0 libcmsis-core.a
  58135       0      12 libelua_base.a
    833       0     184 libfull.a
   2764       0    2300 libg.a
   3092       0       0 libgcc.a
    440       0       0 libhal.a
  13303       0     490 libnffs.a
   4823       0     625 libos.a
    594       0     336 libshell.a
   1120       0      84 libstm32f3discovery.a
  17711       0     252 libstm32f3xx.a
    516       0       8 libutil.a
    339       0    4108 main.o

newlib is ‘libg.a’ in this output. As you can see, there’s quite a bit which
still comes from newlib. I haven’t investigated what lua is using from there.