smaller ramsize for newlib-nano builds

Freddie Chopin freddie_chopin@op.pl
Fri Feb 9 19:35:00 GMT 2018


On Thu, 2018-02-08 at 12:05 +0100, Sebastian Huber wrote:
> with something like this:
> 
> thread_local int _errno;
> thread_local __FILE *_stdin;
> thread_local __FILE *_stdout;
> thread_local __FILE *_stderr;
> 
> So, if you only use errno, then you don't get the rest of struct
> _reent.

This would be a fantastic change, but most (all?) of "generic"
toolchains targeting microcontrollers (for example arm-none-eabi) don't
support thread_local and I don't think adding that is possible without
modifications in gcc source and toolchain recompilation. Code using
such variables calls __emutls_... and __gthread_... prefixed functions,
so these need to be implemented in gcc.

Additionally thread_local most likely requires some run-time support.
When I try now I see that there are calls to malloc() if this keyword
is used.

Regards,
FCh



More information about the Newlib mailing list