From ba384f6ed9275f3966505f2375b56d169e3dc588 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Mon, 18 Feb 2013 19:08:21 +0530 Subject: C++11 thread_local destructors support This feature is specifically for the C++ compiler to offload calling thread_local object destructors on thread program exit, to glibc. This is to overcome the possible complication of destructors of thread_local objects getting called after the DSO in which they're defined is unloaded by the dynamic linker. The DSO is marked as 'unloadable' if it has a constructed thread_local object and marked as 'unloadable' again when all the constructed thread_local objects defined in it are destroyed. --- stdlib/Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'stdlib/Makefile') diff --git a/stdlib/Makefile b/stdlib/Makefile index e2078f8877..6f98c71c64 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -34,7 +34,7 @@ routines := \ bsearch qsort msort \ getenv putenv setenv secure-getenv \ exit on_exit atexit cxa_atexit cxa_finalize old_atexit \ - quick_exit at_quick_exit cxa_at_quick_exit \ + quick_exit at_quick_exit cxa_at_quick_exit cxa_thread_atexit_impl \ abs labs llabs \ div ldiv lldiv \ mblen mbstowcs mbtowc wcstombs wctomb \ @@ -71,9 +71,11 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \ tst-makecontext2 tst-strtod6 tst-unsetenv1 \ tst-makecontext3 bug-getcontext bug-fmtmsg1 \ tst-secure-getenv tst-strtod-overflow tst-strtod-round \ - tst-tininess tst-strtod-underflow + tst-tininess tst-strtod-underflow tst-tls-atexit tests-static := tst-secure-getenv +modules-names = tst-tls-atexit-lib + include ../Makeconfig ifeq ($(build-shared),yes) @@ -155,3 +157,9 @@ $(objpfx)bug-getcontext: $(link-libm) $(objpfx)tst-strtod-round: $(link-libm) $(objpfx)tst-tininess: $(link-libm) $(objpfx)tst-strtod-underflow: $(link-libm) + +tst-tls-atexit-lib.so-no-z-defs = yes + +LDFLAGS-tst-tls-atexit = $(common-objpfx)nptl/libpthread.so \ + $(common-objpfx)dlfcn/libdl.so +$(objpfx)tst-tls-atexit.out: $(objpfx)tst-tls-atexit-lib.so -- cgit 1.4.1