This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: smaller ramsize for newlib-nano builds
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