about summary refs log tree commit diff
path: root/linuxthreads/sysdeps/pthread
diff options
context:
space:
mode:
Diffstat (limited to 'linuxthreads/sysdeps/pthread')
-rw-r--r--linuxthreads/sysdeps/pthread/Makefile12
-rw-r--r--linuxthreads/sysdeps/pthread/nptl-struct-pthread.sym13
2 files changed, 25 insertions, 0 deletions
diff --git a/linuxthreads/sysdeps/pthread/Makefile b/linuxthreads/sysdeps/pthread/Makefile
index f73f40e9d9..6f5a296e3c 100644
--- a/linuxthreads/sysdeps/pthread/Makefile
+++ b/linuxthreads/sysdeps/pthread/Makefile
@@ -12,3 +12,15 @@ endif
 ifeq ($(subdir),posix)
 CFLAGS-confstr.c += -DLIBPTHREAD_VERSION="\"$(shell sed 's/\(.*\) by .*/\1/' ../linuxthreads/Banner)\""
 endif
+
+ifeq ($(subdir),csu)
+# Find out the size of NPTL struct pthread
+ifneq (,$(wildcard $(..)nptl/descr.h))
+gen-as-const-headers += nptl-struct-pthread.sym
+else
+before-compile += $(common-objpfx)nptl-struct-pthread.h
+common-generated += nptl-struct-pthread.h
+$(common-objpfx)nptl-struct-pthread.h:
+	@echo '#define NPTL_STRUCT_PTHREAD_SIZE 0' > $@
+endif
+endif
diff --git a/linuxthreads/sysdeps/pthread/nptl-struct-pthread.sym b/linuxthreads/sysdeps/pthread/nptl-struct-pthread.sym
new file mode 100644
index 0000000000..8df995270e
--- /dev/null
+++ b/linuxthreads/sysdeps/pthread/nptl-struct-pthread.sym
@@ -0,0 +1,13 @@
+#ifdef HAVE_TLS_SUPPORT
+# ifndef HAVE_FORCED_UNWIND
+#  define HAVE_FORCED_UNWIND 1
+# endif
+# define __need_struct_pthread_size
+# include <nptl/descr.h>
+#endif
+
+--
+
+#ifdef HAVE_TLS_SUPPORT
+NPTL_STRUCT_PTHREAD_SIZE	sizeof (struct pthread)
+#endif