Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 20 Nov 2004 07:16:31 +0000 (07:16 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 20 Nov 2004 07:16:31 +0000 (07:16 +0000)
2004-11-20  Jakub Jelinek  <jakub@redhat.com>

* sysdeps/unix/sysv/linux/bits/socket.h (SCM_RIGHTS): Avoid
comma at the end of enum if __USE_BSD is not defined.

(calc_inveclosure, calc_eclosure): Skip OP_DELETED_SUBEXP nodes.

ChangeLog
nptl/ChangeLog
nptl/Makefile
nptl/allocatestack.c
nptl/init.c
nptl/pthreadP.h
nptl/pthread_create.c
nptl/sysdeps/pthread/createthread.c
nptl/vars.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/bits/socket.h

index a5cd019..8deeb98 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-20  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/unix/sysv/linux/bits/socket.h (SCM_RIGHTS): Avoid
+       comma at the end of enum if __USE_BSD is not defined.
+
 2004-11-19  Ulrich Drepper  <drepper@redhat.com>
 
        * malloc/malloc.c (_int_malloc): Check for corruption of chunk
@@ -22,8 +27,7 @@
        (re_compile_internal): Call it.
        (re_compile_pattern): Set preg->no_sub to 1 if RE_NO_SUB.
        (free_dfa_content): Free subexp_map.
-       (calc_inveclosure, calc_eclosure): Skip OP_DELETED_SUBEXP
-       nodes.
+       (calc_inveclosure, calc_eclosure): Skip OP_DELETED_SUBEXP nodes.
        * posix/regexec.c (re_search_internal): If subexp_map
        is not NULL, duplicate registers as needed.
        * posix/Makefile: Add rules to build and run tst-regex2.
index d1cb655..214e2ef 100644 (file)
@@ -1,3 +1,18 @@
+2004-11-20  Jakub Jelinek  <jakub@redhat.com>
+
+       * Makefile (libpthread-routines): Add vars.
+       * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
+       * init.c (__default_stacksize, __is_smp): Remove.
+       * vars.c: New file.
+       * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
+       and define a wrapper macro.
+       (PTHREAD_STATIC_FN_REQUIRE): Define.
+       * allocatestack.c (__find_thread_by_id): Undefine.
+       * pthread_create (__pthread_keys): Remove.
+       (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
+       pthread_key_create, pthread_setspecific, pthread_getspecific): Add
+       PTHREAD_STATIC_FN_REQUIRE.
+
 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
 
        * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
index 7b1759a..0c5043f 100644 (file)
@@ -30,7 +30,7 @@ install-lib-ldscripts := libpthread.so
 routines = alloca_cutoff forward libc-lowlevellock libc-cancellation
 shared-only-routines = forward
 
-libpthread-routines = init events version \
+libpthread-routines = init vars events version \
                      pthread_create pthread_exit pthread_detach \
                      pthread_join pthread_tryjoin pthread_timedjoin \
                      pthread_self pthread_equal pthread_yield \
index 6c2367c..89a034e 100644 (file)
@@ -771,6 +771,7 @@ __reclaim_stacks (void)
 
 
 #if HP_TIMING_AVAIL
+# undef __find_thread_by_id
 /* Find a thread given the thread ID.  */
 attribute_hidden
 struct pthread *
index aad2c90..a18078e 100644 (file)
 #endif
 
 
-/* Default stack size.  */
-size_t __default_stacksize attribute_hidden;
-
 /* Size and alignment of static TLS block.  */
 size_t __static_tls_size;
 size_t __static_tls_align_m1;
 
-/* Flag whether the machine is SMP or not.  */
-int __is_smp attribute_hidden;
-
 /* Version of the library, used in libthread_db to detect mismatches.  */
 static const char nptl_version[] __attribute_used__ = VERSION;
 
index f73c817..2416814 100644 (file)
@@ -278,7 +278,14 @@ extern int *__libc_multiple_threads_ptr attribute_hidden;
 #endif
 
 /* Find a thread given its TID.  */
-extern struct pthread *__find_thread_by_id (pid_t tid) attribute_hidden;
+extern struct pthread *__find_thread_by_id (pid_t tid) attribute_hidden
+#ifdef SHARED
+;
+#else
+weak_function;
+#define __find_thread_by_id(tid) \
+  (__find_thread_by_id ? (__find_thread_by_id) (tid) : (struct pthread *) NULL)
+#endif
 
 extern void __pthread_init_static_tls (struct link_map *) attribute_hidden;
 
@@ -450,4 +457,10 @@ extern void __nptl_deallocate_tsd (void) attribute_hidden;
 
 extern int __nptl_setxid (struct xid_command *cmdp) attribute_hidden;
 
+#ifdef SHARED
+# define PTHREAD_STATIC_FN_REQUIRE(name)
+#else
+# define PTHREAD_STATIC_FN_REQUIRE(name) __asm (".globl " #name);
+#endif
+
 #endif /* pthreadP.h */
index 82a3c68..fcfc5c6 100644 (file)
@@ -55,11 +55,6 @@ unsigned int __nptl_nthreads = 1;
 #include "createthread.c"
 
 
-/* Table of the key information.  */
-struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX]
-  __attribute__ ((nocommon));
-hidden_data_def (__pthread_keys)
-
 struct pthread *
 internal_function
 __find_in_stack_list (pd)
@@ -513,3 +508,14 @@ compat_symbol (libpthread, __pthread_create_2_0, pthread_create,
 /* Information for libthread_db.  */
 
 #include "../nptl_db/db_info.c"
+\f
+/* If pthread_create is present, libgcc_eh.a and libsupc++.a expects some other POSIX thread
+   functions to be present as well.  */
+PTHREAD_STATIC_FN_REQUIRE (pthread_mutex_lock)
+PTHREAD_STATIC_FN_REQUIRE (pthread_mutex_unlock)
+
+PTHREAD_STATIC_FN_REQUIRE (pthread_once)
+
+PTHREAD_STATIC_FN_REQUIRE (pthread_key_create)
+PTHREAD_STATIC_FN_REQUIRE (pthread_setspecific)
+PTHREAD_STATIC_FN_REQUIRE (pthread_getspecific)
index 25a2703..03a0f1a 100644 (file)
@@ -42,8 +42,6 @@
 
 
 #ifndef TLS_MULTIPLE_THREADS_IN_TCB
-/* Variable set to a nonzero value if more than one thread runs or ran.  */
-int __pthread_multiple_threads attribute_hidden;
 /* Pointer to the corresponding variable in libc.  */
 int *__libc_multiple_threads_ptr attribute_hidden;
 #endif
diff --git a/nptl/vars.c b/nptl/vars.c
new file mode 100644 (file)
index 0000000..1e1a3cf
--- /dev/null
@@ -0,0 +1,43 @@
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <pthreadP.h>
+#include <stdlib.h>
+#include <tls.h>
+#include <unistd.h>
+
+/* Default stack size.  */
+size_t __default_stacksize attribute_hidden
+#ifdef SHARED
+;
+#else
+  = PTHREAD_STACK_MIN;
+#endif
+
+/* Flag whether the machine is SMP or not.  */
+int __is_smp attribute_hidden;
+
+#ifndef TLS_MULTIPLE_THREADS_IN_TCB
+/* Variable set to a nonzero value if more than one thread runs or ran.  */
+int __pthread_multiple_threads attribute_hidden;
+#endif
+
+/* Table of the key information.  */
+struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX]
+  __attribute__ ((nocommon));
+hidden_data_def (__pthread_keys)
index 5335caf..77e9b83 100644 (file)
@@ -283,10 +283,10 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
    <linux/socket.h>.  */
 enum
   {
-    SCM_RIGHTS = 0x01,         /* Transfer file descriptors.  */
+    SCM_RIGHTS = 0x01          /* Transfer file descriptors.  */
 #define SCM_RIGHTS SCM_RIGHTS
 #ifdef __USE_BSD
-    SCM_CREDENTIALS = 0x02     /* Credentials passing.  */
+    , SCM_CREDENTIALS = 0x02   /* Credentials passing.  */
 # define SCM_CREDENTIALS SCM_CREDENTIALS
 #endif
   };