[Glibc-bsd-commits] r5215 - trunk/glibc-ports/patches

aurel32 at alioth.debian.org aurel32 at alioth.debian.org
Tue Dec 3 13:34:18 UTC 2013


Author: aurel32
Date: 2013-12-03 13:34:18 +0000 (Tue, 03 Dec 2013)
New Revision: 5215

Removed:
   trunk/glibc-ports/patches/linuxthreads-TLS-THREAD.diff
   trunk/glibc-ports/patches/linuxthreads-initfini.diff
   trunk/glibc-ports/patches/linuxthreads-signals.diff
   trunk/glibc-ports/patches/linuxthreads29.patch
Log:
Remove more linuxthreads code


Deleted: trunk/glibc-ports/patches/linuxthreads-TLS-THREAD.diff
===================================================================
--- trunk/glibc-ports/patches/linuxthreads-TLS-THREAD.diff	2013-12-03 13:28:18 UTC (rev 5214)
+++ trunk/glibc-ports/patches/linuxthreads-TLS-THREAD.diff	2013-12-03 13:34:18 UTC (rev 5215)
@@ -1,276 +0,0 @@
---- a/linuxthreads/libc-tls-loc.c
-+++ b/linuxthreads/libc-tls-loc.c
-@@ -19,10 +19,9 @@
- 
- #include <tls.h>
- 
--#if USE___THREAD
--# include <errno.h>
--# include <netdb.h>
--# include <resolv.h>
-+#include <errno.h>
-+#include <netdb.h>
-+#include <resolv.h>
- 
- /* These functions have identical definitions in libc.  But the versioned
-    dependencies in executables bind them to libpthread.so definitions,
-@@ -45,5 +44,3 @@
- {
-   return __resp;
- }
--
--#endif
---- a/linuxthreads/libc-tsd.c
-+++ b/linuxthreads/libc-tsd.c
-@@ -20,19 +20,6 @@
- #include <tls.h>
- #include <resolv.h>
- 
--#if ! USE___THREAD
--
--/* Special hack used to build link-time libc.so object for linking libpthread.
--   See Makefile comments near libc_pic_lite.os rule for what this is for.  */
--
--# undef _res
--
--int _errno;
--int _h_errno;
--struct __res_state _res;
--
--#endif
--
- int
- __res_maybe_init (res_state resp, int preinit)
- {
---- a/linuxthreads/pthread.c
-+++ b/linuxthreads/pthread.c
-@@ -317,53 +317,6 @@
-   /* Unlike in the dynamically linked case the dynamic linker has not
-      taken care of initializing the TLS data structures.  */
-   __libc_setup_tls (TLS_TCB_SIZE, TLS_TCB_ALIGN);
--# elif !USE___THREAD
--  if (__builtin_expect (GL(dl_tls_dtv_slotinfo_list) == NULL, 0))
--    {
--      tcbhead_t *tcbp;
--
--      /* There is no actual TLS being used, so the thread register
--	 was not initialized in the dynamic linker.  */
--
--      /* We need to install special hooks so that the malloc and memalign
--	 calls in _dl_tls_setup and _dl_allocate_tls won't cause full
--	 malloc initialization that will try to set up its thread state.  */
--
--      extern void __libc_malloc_pthread_startup (bool first_time);
--      __libc_malloc_pthread_startup (true);
--
--      if (__builtin_expect (_dl_tls_setup (), 0)
--	  || __builtin_expect ((tcbp = _dl_allocate_tls (NULL)) == NULL, 0))
--	{
--	  static const char msg[] = "\
--cannot allocate TLS data structures for initial thread\n";
--	  TEMP_FAILURE_RETRY (write_not_cancel (STDERR_FILENO,
--						msg, sizeof msg - 1));
--	  abort ();
--	}
--      const char *lossage = TLS_INIT_TP (tcbp, 0);
--      if (__builtin_expect (lossage != NULL, 0))
--	{
--	  static const char msg[] = "cannot set up thread-local storage: ";
--	  const char nl = '\n';
--	  TEMP_FAILURE_RETRY (write_not_cancel (STDERR_FILENO,
--						msg, sizeof msg - 1));
--	  TEMP_FAILURE_RETRY (write_not_cancel (STDERR_FILENO,
--						lossage, strlen (lossage)));
--	  TEMP_FAILURE_RETRY (write_not_cancel (STDERR_FILENO, &nl, 1));
--	}
--
--      /* Though it was allocated with libc's malloc, that was done without
--	 the user's __malloc_hook installed.  A later realloc that uses
--	 the hooks might not work with that block from the plain malloc.
--	 So we record this block as unfreeable just as the dynamic linker
--	 does when it allocates the DTV before the libc malloc exists.  */
--      GL(dl_initial_dtv) = GET_DTV (tcbp);
--
--      __libc_malloc_pthread_startup (false);
--    }
--# endif
--
-   self = THREAD_SELF;
- 
-   /* The memory for the thread descriptor was allocated elsewhere as
-@@ -464,17 +417,9 @@
- }
- 
- #ifdef SHARED
--# if USE___THREAD
- /* When using __thread for this, we do it in libc so as not
-    to give libpthread its own TLS segment just for this.  */
- extern void **__libc_dl_error_tsd (void) __attribute__ ((const));
--# else
--static void ** __attribute__ ((const))
--__libc_dl_error_tsd (void)
--{
--  return &thread_self ()->p_libc_specific[_LIBC_TSD_KEY_DL_ERROR];
--}
--# endif
- #endif
- 
- #ifdef USE_TLS
---- a/linuxthreads/sysdeps/i386/tls.h
-+++ b/linuxthreads/sysdeps/i386/tls.h
-@@ -70,8 +70,7 @@
-    But some of the code below can cause problems in building libpthread
-    (e.g. useldt.h will defined FLOATING_STACKS when it shouldn't).  */
- 
--#if defined HAVE_TLS_SUPPORT \
--    && (defined FLOATING_STACKS || !defined IS_IN_libpthread)
-+#if (defined FLOATING_STACKS || !defined IS_IN_libpthread)
- 
- /* Signal that TLS support is available.  */
- # define USE_TLS	1
-@@ -265,7 +264,7 @@
- #define THREAD_GSCOPE_WAIT() \
-   do { /* GL(dl_wait_lookup_done) () */ } while (0)
- 
--# endif	/* HAVE_TLS_SUPPORT && (FLOATING_STACKS || !IS_IN_libpthread) */
-+# endif	/* FLOATING_STACKS || !IS_IN_libpthread */
- #endif /* __ASSEMBLER__ */
- 
- #endif	/* tls.h */
---- a/linuxthreads/sysdeps/mips/tls.h
-+++ b/linuxthreads/sysdeps/mips/tls.h
-@@ -69,8 +69,7 @@
-    To avoid bothering with the TLS support code at all, use configure
-    --without-tls.  */
- 
--#if defined HAVE_TLS_SUPPORT \
--    && (defined FLOATING_STACKS || !defined IS_IN_libpthread)
-+#if defined FLOATING_STACKS || !defined IS_IN_libpthread
- 
- /* Signal that TLS support is available.  */
- # define USE_TLS	1
-@@ -168,6 +167,6 @@
- 
- # endif /* __ASSEMBLER__ */
- 
--#endif /* HAVE_TLS_SUPPORT */
-+#endif /* FLOATING_STACKS || !IS_IN_libpthread */
- 
- #endif	/* tls.h */
---- a/linuxthreads/sysdeps/pthread/errno-loc.c
-+++ b/linuxthreads/sysdeps/pthread/errno-loc.c
-@@ -23,24 +23,9 @@
- #include <linuxthreads/internals.h>
- #include <sysdep-cancel.h>
- 
--#if ! USE___THREAD && !RTLD_PRIVATE_ERRNO
--#undef errno
--extern int errno;
--#endif
--
- int *
--#if ! USE___THREAD
--weak_const_function
--#endif
- __errno_location (void)
- {
--#if ! USE___THREAD && !defined NOT_IN_libc
--  if (! SINGLE_THREAD_P)
--    {
--      pthread_descr self = thread_self();
--      return LIBC_THREAD_GETMEM (self, p_errnop);
--    }
--#endif
-   return &errno;
- }
- libc_hidden_def (__errno_location)
---- a/linuxthreads/sysdeps/pthread/herrno-loc.c
-+++ b/linuxthreads/sysdeps/pthread/herrno-loc.c
-@@ -21,23 +21,11 @@
- #include <linuxthreads/internals.h>
- #include <sysdep-cancel.h>
- 
--#if ! USE___THREAD
--# undef h_errno
--extern int h_errno;
--#endif
--
- /* When threaded, h_errno may be a per-thread variable.  */
- int *
- weak_const_function
- __h_errno_location (void)
- {
--#if ! USE___THREAD
--  if (! SINGLE_THREAD_P)
--    {
--      pthread_descr self = thread_self();
--      return LIBC_THREAD_GETMEM (self, p_h_errnop);
--    }
--#endif
-   return &h_errno;
- }
- libc_hidden_def (__h_errno_location)
---- a/linuxthreads/sysdeps/pthread/res-state.c
-+++ b/linuxthreads/sysdeps/pthread/res-state.c
-@@ -21,27 +21,10 @@
- #include <linuxthreads/internals.h>
- #include <sysdep-cancel.h>
- 
--#if ! USE___THREAD
--# undef _res
--extern struct __res_state _res;
--#endif
--
- /* When threaded, _res may be a per-thread variable.  */
- struct __res_state *
--#if ! USE___THREAD
--weak_const_function
--#endif
- __res_state (void)
- {
--#if ! USE___THREAD
--  if (! SINGLE_THREAD_P)
--    {
--      pthread_descr self = thread_self();
--      return LIBC_THREAD_GETMEM (self, p_resp);
--    }
--  return &_res;
--#else
-   return __resp;
--#endif
- }
- libc_hidden_def (__res_state)
---- a/linuxthreads/sysdeps/x86_64/tls.h	
-+++ b/linuxthreads/sysdeps/x86_64/tls.h
-@@ -61,7 +61,7 @@
- #endif
- 
- 
--#ifdef HAVE_TLS_SUPPORT
-+#if 1
- 
- /* Signal that TLS support is available.  */
- # define USE_TLS	1
---- a/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
-+++ b/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
-@@ -23,7 +23,7 @@
- #include <linuxthreads/descr.h>
- #include <tls.h>
- 
--#if USE_TLS && HAVE___THREAD
-+#if 1
- 
- /* When __thread works, the generic definition is what we want.  */
- # include_next <bits/libc-tsd.h>
---- a/linuxthreads/internals.h
-+++ b/linuxthreads/internals.h
-@@ -15,6 +15,9 @@
- #ifndef _INTERNALS_H
- #define _INTERNALS_H	1
- 
-+#define USE___THREAD 1
-+#define USE_TLS 1
-+
- /* Internal data structures */
- 
- /* Includes */

Deleted: trunk/glibc-ports/patches/linuxthreads-initfini.diff
===================================================================
--- trunk/glibc-ports/patches/linuxthreads-initfini.diff	2013-12-03 13:28:18 UTC (rev 5214)
+++ trunk/glibc-ports/patches/linuxthreads-initfini.diff	2013-12-03 13:34:18 UTC (rev 5215)
@@ -1,61 +0,0 @@
---- a/linuxthreads/Makefile
-+++ b/linuxthreads/Makefile
-@@ -97,12 +97,11 @@
- generated-dirs := $(firstword $(subst /, , $(multidir)))
- crti-objs += $(multidir)/crti.o
- crtn-objs += $(multidir)/crtn.o
--omit-deps += $(multidir)/crti $(multidir)/crtn
-+$(objpfx)$(multidir):
-+	mkdir -p $@
- endif
- extra-objs += $(crti-objs) $(crtn-objs)
--omit-deps += crti crtn
--
--CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time)
-+extra-objs += pt-crti.o
- endif
- 
- librt-tests = ex10 ex11 tst-clock1
-@@ -266,33 +265,6 @@
- endif
- 
- ifeq ($(build-shared),yes)
--vpath pt-initfini.c $(sysdirs)
--
--$(objpfx)pt-initfini.s: pt-initfini.c
--	$(compile.c) -S $(CFLAGS-pt-initfini.s) -finhibit-size-directive \
--		$(patsubst -f%,-fno-%,$(exceptions)) -o $@
--
--# We only have one kind of startup code files.  Static binaries and
--# shared libraries are build using the PIC version.
--$(objpfx)crti.S: $(objpfx)pt-initfini.s
--	sed -n -e '1,/@HEADER_ENDS/p' \
--	       -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
--	       -e '/@TRAILER_BEGINS/,$$p' $< > $@
--$(objpfx)crtn.S: $(objpfx)pt-initfini.s
--	sed -n -e '1,/@HEADER_ENDS/p' \
--	       -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
--	       -e '/@TRAILER_BEGINS/,$$p' $< > $@
--
--$(objpfx)defs.h: $(objpfx)pt-initfini.s
--	sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
--		$(AWK) -f ../csu/defs.awk > $@
--
--$(objpfx)crti.o: $(objpfx)crti.S $(objpfx)defs.h
--	$(compile.S) -g0 $(ASFLAGS-.os) -o $@
--
--$(objpfx)crtn.o: $(objpfx)crtn.S $(objpfx)defs.h
--	$(compile.S) -g0 $(ASFLAGS-.os) -o $@
--
- ifneq ($(multidir),.)
- $(objpfx)$(multidir):
- 	@mkdir -p $(objpfx)$(multidir)
-@@ -304,7 +275,7 @@
- 	ln -f $< $@
- endif
- 
--generated += crti.S crtn.S defs.h pt-initfini.s libpthread_nonshared.a
-+generated += libpthread_nonshared.a
- endif
- 
- ifeq (yes,$(build-static-nss))

Deleted: trunk/glibc-ports/patches/linuxthreads-signals.diff
===================================================================
--- trunk/glibc-ports/patches/linuxthreads-signals.diff	2013-12-03 13:28:18 UTC (rev 5214)
+++ trunk/glibc-ports/patches/linuxthreads-signals.diff	2013-12-03 13:34:18 UTC (rev 5215)
@@ -1,14 +0,0 @@
---- linuxthreads/signals.c~	2007-11-15 12:46:17.000000000 +0100
-+++ linuxthreads/signals.c	2007-11-15 12:46:17.000000000 +0100
-@@ -99,9 +99,11 @@
-       if (act->sa_handler != SIG_IGN && act->sa_handler != SIG_DFL
- 	  && sig > 0 && sig < NSIG)
- 	{
-+#if !defined(__FreeBSD_kernel__)
- 	  if (act->sa_flags & SA_SIGINFO)
- 	    newact.sa_handler = (__sighandler_t) __pthread_sighandler_rt;
- 	  else
-+#endif	  
- 	    newact.sa_handler = (__sighandler_t) __pthread_sighandler;
- 	  if (old == SIG_IGN || old == SIG_DFL || old == SIG_ERR)
- 	    __sighandler[sig].old = (arch_sighandler_t) act->sa_handler;

Deleted: trunk/glibc-ports/patches/linuxthreads29.patch
===================================================================
--- trunk/glibc-ports/patches/linuxthreads29.patch	2013-12-03 13:28:18 UTC (rev 5214)
+++ trunk/glibc-ports/patches/linuxthreads29.patch	2013-12-03 13:34:18 UTC (rev 5215)
@@ -1,101 +0,0 @@
-
-some of these hacks  should be solved properly by upstream ...
-
----
- linuxthreads/sysdeps/pthread/bits/libc-tsd.h  |   12 ++++++------
- linuxthreads/sysdeps/pthread/malloc-machine.h |    6 +++---
- nscd/connections.c                            |    4 ++++
- sysdeps/i386/tlsdesc.sym                      |    4 ++++
- sysdeps/x86_64/tlsdesc.sym                    |    5 ++++-
- 5 files changed, 21 insertions(+), 10 deletions(-)
-
---- a/nscd/connections.c
-+++ b/nscd/connections.c
-@@ -876,6 +876,7 @@
- 	  }
-       }
- 
-+#if defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK)
-   /* Create the socket.  */
- #ifndef __ASSUME_SOCK_CLOEXEC
-   sock = -1;
-@@ -888,6 +889,9 @@
- 	have_sock_cloexec = sock != -1 || errno != EINVAL ? 1 : -1;
- #endif
-     }
-+#else
-+have_sock_cloexec = -1;
-+#endif    
- #ifndef __ASSUME_SOCK_CLOEXEC
-   if (have_sock_cloexec < 0)
-     sock = socket (AF_UNIX, SOCK_STREAM, 0);
---- a/sysdeps/i386/tlsdesc.sym
-+++ b/sysdeps/i386/tlsdesc.sym
-@@ -8,7 +8,11 @@
- 
- -- Abuse tls.h macros to derive offsets relative to the thread register.
- 
-+#if 0
- DTV_OFFSET			offsetof(struct pthread, header.dtv)
-+#else
-+DTV_OFFSET                      offsetof(struct _pthread_descr_struct, p_header.data.dtvp)
-+#endif
- 
- TLSDESC_ARG			offsetof(struct tlsdesc, arg)
- 
---- a/sysdeps/x86_64/tlsdesc.sym
-+++ b/sysdeps/x86_64/tlsdesc.sym
-@@ -5,10 +5,13 @@
- #include <dl-tlsdesc.h>
- 
- --
-+#if 0
-+ DTV_OFFSET			offsetof(struct pthread, header.dtv) */
-+#endif
- 
- -- Abuse tls.h macros to derive offsets relative to the thread register.
- 
--DTV_OFFSET			offsetof(struct pthread, header.dtv)
-+DTV_OFFSET			offsetof(struct _pthread_descr_struct, p_header.data.dtvp)
- 
- TLSDESC_ARG			offsetof(struct tlsdesc, arg)
- 
---- a/linuxthreads/sysdeps/pthread/malloc-machine.h
-+++ b/linuxthreads/sysdeps/pthread/malloc-machine.h
-@@ -57,10 +57,10 @@
- #include <bits/libc-tsd.h>
- 
- typedef int tsd_key_t[1];	/* no key data structure, libc magic does it */
--__libc_tsd_define (static, MALLOC)	/* declaration/common definition */
-+__libc_tsd_define (static, void *, MALLOC)	/* declaration/common definition */
- #define tsd_key_create(key, destr)	((void) (key))
--#define tsd_setspecific(key, data)	__libc_tsd_set (MALLOC, (data))
--#define tsd_getspecific(key, vptr)	((vptr) = __libc_tsd_get (MALLOC))
-+#define tsd_setspecific(key, data)	__libc_tsd_set (void *, MALLOC, (data))
-+#define tsd_getspecific(key, vptr)	((vptr) = __libc_tsd_get (void *, MALLOC))
- 
- #include <sysdeps/generic/malloc-machine.h>
- 
---- a/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
-+++ b/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
-@@ -42,14 +42,14 @@
- weak_extern (__pthread_internal_tsd_set)
- # endif
- 
--#define __libc_tsd_define(CLASS, KEY)	CLASS void *__libc_tsd_##KEY##_data;
--#define __libc_tsd_address(KEY) \
--  __libc_maybe_call2 (pthread_internal_tsd_address,			\
-+#define __libc_tsd_define(CLASS, TYPE, KEY)	CLASS TYPE __libc_tsd_##KEY##_data;
-+#define __libc_tsd_address(TYPE, KEY) \
-+  (TYPE *) __libc_maybe_call2 (pthread_internal_tsd_address,			\
- 		      (_LIBC_TSD_KEY_##KEY), &__libc_tsd_##KEY##_data)
--#define __libc_tsd_get(KEY) \
--  __libc_maybe_call2 (pthread_internal_tsd_get,				\
-+#define __libc_tsd_get(TYPE, KEY) \
-+  (TYPE) __libc_maybe_call2 (pthread_internal_tsd_get,				\
- 		      (_LIBC_TSD_KEY_##KEY), __libc_tsd_##KEY##_data)
--#define __libc_tsd_set(KEY, VALUE) \
-+#define __libc_tsd_set(TYPE, KEY, VALUE) \
-   __libc_maybe_call2 (pthread_internal_tsd_set,				\
- 		      (_LIBC_TSD_KEY_##KEY, (VALUE)),			\
- 		       (__libc_tsd_##KEY##_data = (VALUE), 0))




More information about the Glibc-bsd-commits mailing list