[gcc] Enable TLS support for RTEMS in libstdc++

Chris Johns chrisj at rtems.org
Thu Jun 9 00:29:48 UTC 2022


On 9/6/2022 12:18 am, Sebastian Huber wrote:
> On 08/06/2022 16:11, Joel Sherrill wrote:
>> On Wed, Jun 8, 2022 at 8:47 AM Sebastian Huber
>> <sebastian.huber at embedded-brains.de
>> <mailto:sebastian.huber at embedded-brains.de>> wrote:
>> If we are to maintain a thread safe C Library, then we have to be
>> sure TLS is always supported or we have to have a fallback
>> method.
> 
> The fallback method for C++ is only thread safe if you have enough POSIX keys
> configured.

This is an important point. When I wrote the exit03 test it passed with the
confdefs config from exit01m iw no POSIX keys. After I added 2 POSIX keys the
test failed as I expected it to.

Currently there is no way to check or inform a user the POSIX key create as
failed. I think there is a gcc ticket on this topic I raised a while ago.

FWIW Jonathan Wakely has a fix for the issue I am seeing with the eh_globals
(used when there is no TLS) support but it does have a corner case when exit()
is called the POSIX key has been deleted so exceptions revert to single threaded.

Chris


More information about the devel mailing list