<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 19, 2021 at 3:54 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 19/05/2021 10:23, Chris Johns wrote:<br>
>> On 19 May 2021, at 5:28 pm, Sebastian Huber<<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>>  wrote:<br>
>><br>
>> 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.<br>
> Do you mean the _reent structure is expanded out into separate TLS elements?<br>
<br>
Yes, something like:<br>
<br>
thread_local int errno;<br></blockquote><div><br></div><div>On paper this would work but most architectures do not have TLS </div><div>support from RTEMS right now. On top of that, I honestly can't tell</div><div>in GCC how TLS is implemented on many architectures. If there is</div><div>a generic pattern, I'd be happy to be educated?</div><div><br></div><div>FWIW I looked into the MIPS and it uses a specific invalid instruction</div><div>as the TLS "get function". Personally, I'd prefer a way to tell GCC to</div><div>just call a real subroutine and avoid architecture specific magic unless</div><div>it is going to use a register. And document it.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
-- <br>
embedded brains GmbH<br>
Herr Sebastian HUBER<br>
Dornierstr. 4<br>
82178 Puchheim<br>
Germany<br>
email: <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
phone: +49-89-18 94 741 - 16<br>
fax:   +49-89-18 94 741 - 08<br>
<br>
Registergericht: Amtsgericht München<br>
Registernummer: HRB 157899<br>
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler<br>
Unsere Datenschutzerklärung finden Sie hier:<br>
<a href="https://embedded-brains.de/datenschutzerklaerung/" rel="noreferrer" target="_blank">https://embedded-brains.de/datenschutzerklaerung/</a><br>
</blockquote></div></div>