Heavy SysInit Dependency

Sebastian Huber sebastian.huber at embedded-brains.de
Wed May 19 14:05:07 UTC 2021

On 19/05/2021 15:09, Joel Sherrill wrote:
> On Wed, May 19, 2021 at 3:54 AM Sebastian Huber 
> <sebastian.huber at embedded-brains.de 
> <mailto:sebastian.huber at embedded-brains.de>> wrote:
>     On 19/05/2021 10:23, Chris Johns wrote:
>      >> On 19 May 2021, at 5:28 pm, Sebastian
>     Huber<sebastian.huber at embedded-brains.de
>     <mailto:sebastian.huber at embedded-brains.de>>  wrote:
>      >>
>      >> I am not sure how the dependency chain can be fixed with the
>     current struct _reent approach of Newlib. A modern approach would be
>     to replace this structure with individual thread-local objects. This
>     would be technically feasible, however, a lot of work.
>      > Do you mean the _reent structure is expanded out into separate
>     TLS elements?
>     Yes, something like:
>     thread_local int errno;
> On paper this would work but most architectures do not have TLS
> support from RTEMS right now. On top of that, I honestly can't tell
> in GCC how TLS is implemented on many architectures. If there is
> a generic pattern, I'd be happy to be educated?

The most relevant architectures have TLS support, at least: arm, 
powerpc, sparc, nios2, m68k.

The arm GCC target has a -mtp=soft option. This approach would work an 
any target. You just have to add the GCC/llvm support for this for all 
targets which need it.

embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:

More information about the devel mailing list