about summary refs log tree commit diff
path: root/stdlib/Makefile
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2013-02-18 19:08:21 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2013-02-18 19:08:21 +0530
commitba384f6ed9275f3966505f2375b56d169e3dc588 (patch)
treed832a5a24bab934c946089b8d2a9a16f1766470d /stdlib/Makefile
parentffaa74cf68a370e232279a9a9b0a02ade287cc99 (diff)
downloadglibc-ba384f6ed9275f3966505f2375b56d169e3dc588.tar.gz
glibc-ba384f6ed9275f3966505f2375b56d169e3dc588.tar.xz
glibc-ba384f6ed9275f3966505f2375b56d169e3dc588.zip
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.
Diffstat (limited to 'stdlib/Makefile')
-rw-r--r--stdlib/Makefile12
1 files changed, 10 insertions, 2 deletions
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