r872 - glibc-package/trunk/debian/patches
Author: gotom
Date: 2005-04-09 01:20:11 +0000 (Sat, 09 Apr 2005)
New Revision: 872
Added:
glibc-package/trunk/debian/patches/linuxthreads-sizefix.dpatch
Log:
- debian/patches/linuxthreads-sizefix.dpatch: Fix ia64 TLS_PRE_TCB_SIZE
alignment where TLS_DTV_AT_TP is defined between linuxthreads and nptl.
It breaks evolution on ia64 linuxthreads ld.so + nptl environment.
(Closes: #292673)
Added: glibc-package/trunk/debian/patches/linuxthreads-sizefix.dpatch
===================================================================
--- glibc-package/trunk/debian/patches/linuxthreads-sizefix.dpatch 2005-04-09 01:13:26 UTC (rev 871)
+++ glibc-package/trunk/debian/patches/linuxthreads-sizefix.dpatch 2005-04-09 01:20:11 UTC (rev 872)
@@ -0,0 +1,183 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DP:' are a description of the patch.
+# DP: Description: Align TLS_PRE_TCB_SIZE between linuxthreads and nptl.
+# The patch is based on fedora-20031105.
+# DP: Related bugs: #292673
+# DP: Dpatch author: GOTO Masanori <gotom@debian.org>
+# DP: Patch author: Jakub Jelinek <jakub@redhat.com>
+# DP: Upstream status: Debian-Specific
+# DP: Status Details: Currently IA-64 part is applied.
+# DP: Date: 2005-04-09
+
+PATCHLEVEL=1
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p$PATCHLEVEL < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p$PATCHLEVEL < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+2003-09-02 Jakub Jelinek <jakub@redhat.com>
+
+ * 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-07-22 Jakub Jelinek <jakub@redhat.com>
+
+ * 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 <jakub@redhat.com>
+
+ * descr.h: Don't include lowlevellock.h, pthreaddef.h and dl-sysdep.h
+ if __need_struct_pthread_size, instead define lll_lock_t.
+
+
+--- glibc-2.3.2-net/linuxthreads/Makefile 4 Oct 2003 11:52:58 -0000 1.1.1.53
++++ glibc-2.3.2-redhat/linuxthreads/Makefile 4 Oct 2003 12:06:23 -0000 1.32
+@@ -244,15 +244,18 @@ $(addprefix $(objpfx), \
+ $(filter-out $(tests-static) $(tests-reverse) unload, \
+ $(tests) $(test-srcs))): $(objpfx)libpthread.so \
+ $(objpfx)libpthread_nonshared.a
+-# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,
++# $(objpfx)linklibc.so is used instead of $(common-objpfx)libc.so,
+ # since otherwise libpthread.so comes before libc.so when linking.
+ $(addprefix $(objpfx), $(tests-reverse)): \
+- $(objpfx)../libc.so $(objpfx)libpthread.so \
++ $(objpfx)linklibc.so $(objpfx)libpthread.so \
+ $(objpfx)libpthread_nonshared.a
+ $(objpfx)../libc.so: $(common-objpfx)libc.so ;
+ $(addprefix $(objpfx),$(librt-tests)): $(common-objpfx)rt/librt.so
+ $(objpfx)unload: $(common-objpfx)dlfcn/libdl.so
+ $(objpfx)unload.out: $(objpfx)libpthread.so $(objpfx)libpthread_nonshared.a
++$(objpfx)linklibc.so: $(common-objpfx)libc.so
++ ln -s ../libc.so $@
++generated += libclink.so
+ else
+ $(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a
+ $(addprefix $(objpfx),$(librt-tests)): $(common-objpfx)rt/librt.a
+--- glibc-2.3.2-net/linuxthreads/sysdeps/ia64/tls.h 31 Jul 2003 23:17:32 -0000 1.1.1.6
++++ glibc-2.3.2-redhat/linuxthreads/sysdeps/ia64/tls.h 31 Jul 2003 23:26:38 -0000 1.5
+@@ -59,7 +59,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 <nptl-struct-pthread.h>
++# 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-2.3.2-net/linuxthreads/sysdeps/pthread/Makefile 14 Aug 2003 13:32:49 -0000 1.1.1.6
++++ glibc-2.3.2-redhat/linuxthreads/sysdeps/pthread/Makefile 14 Aug 2003 14:10:45 -0000 1.8
+@@ -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-2.3.2-net/linuxthreads/sysdeps/pthread/nptl-struct-pthread.sym 1 Jan 1970 00:00:00 -0000
++++ glibc-2.3.2-redhat/linuxthreads/sysdeps/pthread/nptl-struct-pthread.sym 28 Jul 2003 10:42:00 -0000 1.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 <nptl/descr.h>
++#endif
++
++--
++
++#ifdef HAVE_TLS_SUPPORT
++NPTL_STRUCT_PTHREAD_SIZE sizeof (struct pthread)
++#endif
+--- glibc-2.3.2-net/nptl/Makefile 4 Oct 2003 11:53:45 -0000 1.1.1.67
++++ glibc-2.3.2-redhat/nptl/Makefile 4 Oct 2003 12:06:23 -0000 1.72
+@@ -465,15 +465,19 @@ $(addprefix $(objpfx), \
+ $(tests) $(test-srcs))): $(objpfx)libpthread.so \
+ $(objpfx)libpthread_nonshared.a
+ $(objpfx)tst-unload: $(common-objpfx)dlfcn/libdl.so
+-# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,
++# $(objpfx)linklibc.so is used instead of $(common-objpfx)libc.so,
+ # since otherwise libpthread.so comes before libc.so when linking.
+ $(addprefix $(objpfx), $(tests-reverse)): \
+- $(objpfx)../libc.so $(objpfx)libpthread.so \
++ $(objpfx)linklibc.so $(objpfx)libpthread.so \
+ $(objpfx)libpthread_nonshared.a
+ $(objpfx)../libc.so: $(common-objpfx)libc.so ;
+ $(addprefix $(objpfx),$(tests-static)): $(objpfx)libpthread.a
+
+ $(objpfx)tst-atfork2.out: $(objpfx)tst-atfork2mod.so
++
++$(objpfx)linklibc.so: $(common-objpfx)libc.so
++ ln -s ../libc.so $@
++generated += libclink.so
+ else
+ $(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a
+ endif
+--- glibc-2.3.2-net/nptl/descr.h 28 Jul 2003 10:05:59 -0000 1.1.1.16
++++ glibc-2.3.2-redhat/nptl/descr.h 28 Jul 2003 10:42:00 -0000 1.2
+@@ -27,9 +27,13 @@
+ #include <sys/types.h>
+ #include <hp-timing.h>
+ #include <list.h>
++#ifdef __need_struct_pthread_size
++#define lll_lock_t int
++#else
+ #include <lowlevellock.h>
+ #include <pthreaddef.h>
+ #include <dl-sysdep.h>
++#endif
+ #include "../nptl_db/thread_db.h"
+ #include <tls.h>
+ #ifdef HAVE_FORCED_UNWIND
Reply to: