manuel.coutinho at edisoft.pt
Mon Aug 18 14:57:04 UTC 2008
We are trying to make possible a configuration (using the configure script)
where RTEMS does not have newlib (open, close, malloc, etc) and other things
so that a minimal footprint can be achieved.
At this stage, we are just checking how much effort is required to perform
this. I would suggest to place #ifdef inside the RTEMS source code so that
the unnecessary calls are not made. However, there is more work needed here.
I've tried to take out most of the calls to libc and other things that we
don't need from the RTEMS source code (e.g rtems_termios_init, etc) and the
footprint has been reduced from ~70 KiB to ~37KiB, but we need to go further
and remove all dead code. Since RTEMS itself makes calls to newlib or libc,
if the application does not make the extra calls it is not sufficient
because the code will still be present.
Now, we stumbled with the newlib source code that is very intertwined with
RTEMS (mainly to make malloc reentrant, from what I can tell). This will
need some detailed research to make sure everything works well.
> -----Original Message-----
> From: Joel Sherrill [mailto:joel.sherrill at oarcorp.com]
> Sent: Monday, August 18, 2008 3:38 PM
> To: xu ray
> Cc: Manuel Coutinho; rtems-users at rtems.com
> Subject: Re: disable newlib
> xu ray wrote:
> > You can disable it with patch YanMiao is working on.
> I don't see how you can disable the entire newlib library without
> special tool builds.
> You can dynamically configure where the per-task reentrancy support is
> disabled. That saves a fair amount of memory.
> > But after doing this, lots of API (e.g. Posix ) and (most) C library
> > can not be used.
> If you build without newlib at all, this is true. The .h files from
> RTEMS and
> newlib are intertwined for the C library and POSIX threading.
> > You can use this for small footprint MCU/CPU that has limited RAM on
> You can also just not call the services and not get code pulled in.
> I will reserve judgment until I see the patch. I tend to believe that you
> can build everything and just not call it in your application. If there
> pieces of RTEMS that are required that start to pull this in, then there
> a dependency issue.
> 95% of the time breaking dependencies is sufficient. Special conditional
> builds are seldom required.
> > 2008/8/18 Manuel Coutinho <manuel.coutinho at edisoft.pt
> > <mailto:manuel.coutinho at edisoft.pt>>
> > Hi
> > Just a quick question:
> > How can we disable newlib (I mean, undefine RTEMS_NEWLIB)? Can
> > this be done in the configuration phase?
> > Thanks
> > *Manuel Coutinho
> > *Software Engineer - Space
> > *EDISOFT, S.A.*
> > Rua Quinta dos Medronheiros - Lazarim
> > Apartado 382 Monte de Caparica
> > 2826-801 Caparica Portugal
> > _______________________________________________
> > rtems-users mailing list
> > rtems-users at rtems.com <mailto:rtems-users at rtems.com>
> > http://rtems.rtems.org/mailman/listinfo/rtems-users
> > --
> > Thanks & Best Regards!
> > Ray, Xu
> Joel Sherrill, Ph.D. Director of Research & Development
> joel.sherrill at OARcorp.com On-Line Applications Research
> Ask me about RTEMS: a free RTOS Huntsville AL 35805
> Support Available (256) 722-9985
More information about the users