--- glibc-20041208T1024/linuxthreads/ChangeLog 5 Dec 2004 09:39:04 -0000 1.831 +++ glibc-20041208T1024-fedora/linuxthreads/ChangeLog 7 Dec 2004 14:00:53 -0000 1.817.2.12 @@ -710,6 +726,12 @@ (pthread_barrierattr_setpshared): Return EINVAL if pshared is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED. +2003-09-02 Jakub Jelinek + + * sysdeps/sparc/tls.h (TLS_TCB_SIZE): If in ld.so and NPTL struct + pthread is bigger than struct _pthread_descr_struct, use NPTL struct + pthread size. + 2003-09-02 Ulrich Drepper * sysdeps/unix/sysv/linux/i386/dl-sysdep.h @@ -842,6 +864,34 @@ 2003-07-22 Jakub Jelinek + * sysdeps/alpha/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Change to 0. + (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Alignment of struct + _pthread_descr_struct. + (TLS_PRE_TCB_SIZE): Add sizeof (tcbhead_t) and pad to align. + If in ld.so and NPTL struct pthread is bigger than struct + _pthread_descr_struct, use NPTL struct pthread size. + (TLS_TCB_OFFSET): Define. + (INSTALL_DTV, INSTALL_NEW_DTV, GET_DTV, TLS_INIT_TP, THREAD_DTV, + THREAD_SELF, INIT_THREAD_SELF): Changed to match NPTL tls.h + definitions. + * sysdeps/i386/tls.h (TLS_TCB_SIZE): If in ld.so and NPTL struct + pthread is bigger than struct _pthread_descr_struct, use NPTL struct + pthread size. + * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Likewise. + * sysdeps/powerpc/tls.h (TLS_PRE_TCB_SIZE): Likewise. + * sysdeps/s390/tls.h (TLS_TCB_SIZE): Likewise. + * sysdeps/sh/tls.h (TLS_PRE_TCB_SIZE): Likewise. + * sysdeps/x86_64/tls.h (TLS_TCB_SIZE): Likewise. + * sysdeps/pthread/Makefile (gen-as-const-headers): Add + nptl-struct-pthread.sym if nptl tree is present. + (before-compile): Add $(common-objpfx)nptl-struct-pthread.h + if nptl tree is not present. + (common-generated): Add nptl-struct-pthread.h. + ($(common-objpfx)nptl-struct-pthread.h): New rule. + * sysdeps/pthread/nptl-struct-pthread.sym: New file. + +2003-07-22 Jakub Jelinek + * descr.h (struct _pthread_descr_struct): Provide p_res member even if USE_TLS && HAVE___THREAD. * sysdeps/pthread/res-state.c (__res_state): Return __resp --- glibc-20041208T1024/nptl/ChangeLog 7 Dec 2004 20:32:24 -0000 1.747 +++ glibc-20041208T1024-fedora/nptl/ChangeLog 8 Dec 2004 10:52:11 -0000 1.706.2.25 @@ -2470,6 +2491,11 @@ * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules). +2003-07-22 Jakub Jelinek + + * descr.h: Don't include lowlevellock.h, pthreaddef.h and dl-sysdep.h + if __need_struct_pthread_size, instead define lll_lock_t. + 2003-07-25 Jakub Jelinek * tst-cancel17.c (do_test): Check if aio_cancel failed. --- glibc-2.3.5/linuxthreads/sysdeps/alpha/tls.h.orig 2003-01-30 22:03:40.000000000 +0100 +++ glibc-2.3.5/linuxthreads/sysdeps/alpha/tls.h 2005-04-15 20:48:27.000000000 +0200 @@ -56,16 +56,23 @@ typedef struct # define TLS_INIT_TCB_SIZE sizeof (tcbhead_t) /* Alignment requirements for the initial TCB. */ -# define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) +# define TLS_INIT_TCB_ALIGN 16 /* This is the size of the TCB. */ # define TLS_TCB_SIZE sizeof (tcbhead_t) /* Alignment requirements for the TCB. */ -# define TLS_TCB_ALIGN __alignof__ (tcbhead_t) +# define TLS_TCB_ALIGN 16 /* This is the size we need before TCB. */ +# ifndef IS_IN_rtld # define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_PRE_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* The DTV is allocated at the TP; the TCB is placed elsewhere. */ # define TLS_DTV_AT_TP 1 @@ -87,7 +94,7 @@ typedef struct special attention since 'errno' is not yet available and if the operation can cause a failure 'errno' must not be touched. */ # define TLS_INIT_TP(TCBP, SECONDCALL) \ - (__builtin_set_thread_pointer (TCBP), 0) + (__builtin_set_thread_pointer ((void*)(TCBP)), NULL) /* Return the address of the dtv for the current thread. */ # define THREAD_DTV() \ --- glibc-20041208T1024/linuxthreads/sysdeps/i386/tls.h 19 Oct 2004 05:12:58 -0000 1.37 +++ glibc-20041208T1024-fedora/linuxthreads/sysdeps/i386/tls.h 20 Oct 2004 10:47:17 -0000 1.35.2.4 @@ -81,7 +81,14 @@ typedef struct # define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) /* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) --- glibc-20041208T1024/linuxthreads/sysdeps/ia64/tls.h 8 Jul 2004 21:20:57 -0000 1.9 +++ glibc-20041208T1024-fedora/linuxthreads/sysdeps/ia64/tls.h 22 Sep 2004 21:20:55 -0000 1.9.2.1 @@ -60,7 +60,14 @@ typedef struct # define TLS_TCB_SIZE sizeof (tcbhead_t) /* This is the size we need before TCB. */ -# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_PRE_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) --- glibc-20041208T1024/linuxthreads/sysdeps/powerpc/tls.h 9 Apr 2004 19:09:42 -0000 1.8 +++ glibc-20041208T1024-fedora/linuxthreads/sysdeps/powerpc/tls.h 22 Sep 2004 21:20:55 -0000 1.8.2.1 @@ -64,11 +64,19 @@ typedef struct # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) /* This is the size we need before TCB. */ -# define TLS_PRE_TCB_SIZE \ +# ifndef IS_IN_rtld +# define TLS_PRE_TCB_SIZE \ (sizeof (struct _pthread_descr_struct) \ + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1))) +# else +# include +# define TLS_PRE_TCB_SIZE \ + ((sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) \ + + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1))) +# endif -/* The following assumes that TP (R2 or R13) is points to the end of the +/* The following assumes that TP (R2 or R13) points to the end of the TCB + 0x7000 (per the ABI). This implies that TCB address is TP - 0x7000. As we define TLS_DTV_AT_TP we can assume that the pthread_descr is allocated immediately ahead of the --- glibc-20041208T1024/linuxthreads/sysdeps/pthread/Makefile 14 Aug 2003 00:14:22 -0000 1.7 +++ glibc-20041208T1024-fedora/linuxthreads/sysdeps/pthread/Makefile 22 Sep 2004 21:20:56 -0000 1.7.2.1 @@ -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 --- glibc-20041208T1024/linuxthreads/sysdeps/pthread/nptl-struct-pthread.sym 1 Jan 1970 00:00:00 -0000 +++ glibc-20041208T1024-fedora/linuxthreads/sysdeps/pthread/nptl-struct-pthread.sym 22 Sep 2004 21:20:56 -0000 1.1.2.1 @@ -0,0 +1,13 @@ +#ifdef HAVE_TLS_SUPPORT +# ifndef HAVE_FORCED_UNWIND +# define HAVE_FORCED_UNWIND 1 +# endif +# define __need_struct_pthread_size +# include +#endif + +-- + +#ifdef HAVE_TLS_SUPPORT +NPTL_STRUCT_PTHREAD_SIZE sizeof (struct pthread) +#endif --- glibc-20041208T1024/linuxthreads/sysdeps/s390/tls.h 30 Jan 2003 18:34:11 -0000 1.3 +++ glibc-20041208T1024-fedora/linuxthreads/sysdeps/s390/tls.h 22 Sep 2004 21:20:56 -0000 1.3.2.1 @@ -72,7 +72,14 @@ typedef struct # define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) /* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) --- glibc-20041208T1024/linuxthreads/sysdeps/sh/tls.h 2 Mar 2003 11:44:20 -0000 1.9 +++ glibc-20041208T1024-fedora/linuxthreads/sysdeps/sh/tls.h 22 Sep 2004 21:20:57 -0000 1.9.2.1 @@ -64,7 +64,14 @@ typedef struct # define TLS_TCB_SIZE sizeof (tcbhead_t) /* This is the size we need before TCB. */ -# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_PRE_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) --- glibc-20041208T1024/linuxthreads/sysdeps/sparc/tls.h 4 Feb 2003 20:41:02 -0000 1.3 +++ glibc-20041208T1024-fedora/linuxthreads/sysdeps/sparc/tls.h 22 Sep 2004 21:20:57 -0000 1.3.2.1 @@ -64,7 +64,14 @@ typedef struct # define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) /* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) --- glibc-20041208T1024/linuxthreads/sysdeps/x86_64/tls.h 18 Apr 2004 02:32:25 -0000 1.6 +++ glibc-20041208T1024-fedora/linuxthreads/sysdeps/x86_64/tls.h 22 Sep 2004 21:20:57 -0000 1.6.2.1 @@ -66,7 +66,14 @@ typedef struct # define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) /* This is the size of the TCB. */ -# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# ifndef IS_IN_rtld +# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) +# else +# include +# define TLS_TCB_SIZE \ + (sizeof (struct _pthread_descr_struct) > NPTL_STRUCT_PTHREAD_SIZE \ + ? sizeof (struct _pthread_descr_struct) : NPTL_STRUCT_PTHREAD_SIZE) +# endif /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) --- glibc-20041208T1024/nptl/descr.h 12 Nov 2004 01:24:24 -0000 1.25 +++ glibc-20041208T1024-fedora/nptl/descr.h 12 Nov 2004 16:56:12 -0000 1.23.2.3 @@ -27,9 +27,13 @@ #include #include #include +#ifdef __need_struct_pthread_size +#define lll_lock_t int +#else #include #include #include +#endif #include "../nptl_db/thread_db.h" #include #ifdef HAVE_FORCED_UNWIND