Bug 21325 - Newlib needs to support C++11 thread_local destructor offloading?
Summary: Newlib needs to support C++11 thread_local destructor offloading?
Status: NEW
Alias: None
Product: newlib
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 minor
Target Milestone: ---
Assignee: Jeff Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-29 10:30 UTC by Jiong Wang
Modified: 2017-03-29 10:30 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiong Wang 2017-03-29 10:30:57 UTC
The origin of this issue is a test written to verify the destructor of thread_local variable in C++11 is executed correctly.  While that testcase failed on arm/aarch64 bare-metal toolchain which is using GCC emulated TLS and newlib.

On GCC side, a patch has been committed to XFAIL that testcase on newlib while GCC testcase maintainer also commented that a better approach might be to fix newlib as well which I agree.

The discussion and the testcase can be found at this thread:

  https://gcc.gnu.org/ml/gcc-patches/2017-03/msg00547.html

Quick search of glibc code shows glibc support is done by the following commit:

commit ba384f6ed9275f3966505f2375b56d169e3dc588
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Mon Feb 18 19:08:21 2013 +0530

    C++11 thread_local destructors support

We might need similar support in newlib.