Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 18 Nov 1998 17:02:37 +0000 (17:02 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 18 Nov 1998 17:02:37 +0000 (17:02 +0000)
1998-11-18  Ulrich Drepper  <drepper@cygnus.com>

* Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
(CFLAGS-specific.c): Likewise.
(CFLAGS-pthread.c): Likewise.
(CFLAGS-ptfork.c): Likewise.
(CFLAGS-cancel.c): Likewise.
* sysdeps/pthread/bits/libc-lock.h: Don't mark __pthread_* functions
as weak references if __NO_WEAK_PTHREAD_ALIASES is defined.

* mutex.c (pthread_mutex_init): Define as strong symbol.
(pthread_mutex_destroy): Likewise.
(pthread_mutex_trylock): Likewise.
(pthread_mutex_lock): Likewise.
(pthread_mutex_unlock): Likewise.
(pthread_mutexattr_init): Likewise.
(pthread_mutexattr_destroy): Likewise.
(pthread_once): Likewise.
* ptfork.c (pthread_atfork): Likewise.
* specific.c (pthread_key_create): Likewise.
(pthread_setspecific): Likewise.
(pthread_getspecific): Likewise.

linuxthreads/ChangeLog
linuxthreads/Makefile
linuxthreads/mutex.c
linuxthreads/ptfork.c
linuxthreads/specific.c
linuxthreads/sysdeps/pthread/bits/libc-lock.h

index a0790ce..3448666 100644 (file)
@@ -1,3 +1,26 @@
+1998-11-18  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
+       (CFLAGS-specific.c): Likewise.
+       (CFLAGS-pthread.c): Likewise.
+       (CFLAGS-ptfork.c): Likewise.
+       (CFLAGS-cancel.c): Likewise.
+       * sysdeps/pthread/bits/libc-lock.h: Don't mark __pthread_* functions
+       as weak references if __NO_WEAK_PTHREAD_ALIASES is defined.
+
+       * mutex.c (pthread_mutex_init): Define as strong symbol.
+       (pthread_mutex_destroy): Likewise.
+       (pthread_mutex_trylock): Likewise.
+       (pthread_mutex_lock): Likewise.
+       (pthread_mutex_unlock): Likewise.
+       (pthread_mutexattr_init): Likewise.
+       (pthread_mutexattr_destroy): Likewise.
+       (pthread_once): Likewise.
+       * ptfork.c (pthread_atfork): Likewise.
+       * specific.c (pthread_key_create): Likewise.
+       (pthread_setspecific): Likewise.
+       (pthread_getspecific): Likewise.
+
 1998-11-15  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
 
        * linuxthreads.texi: Fix punctuation after xref.
index c8da948..aad7106 100644 (file)
@@ -41,6 +41,12 @@ tests = ex1 ex2 ex3 ex4 ex5 ex6
 
 include ../Rules
 
+CFLAGS-mutex.c += -D__NO_WEAK_PTHREAD_ALIASES
+CFLAGS-specific.c += -D__NO_WEAK_PTHREAD_ALIASES
+CFLAGS-pthread.c += -D__NO_WEAK_PTHREAD_ALIASES
+CFLAGS-ptfork.c += -D__NO_WEAK_PTHREAD_ALIASES
+CFLAGS-cancel.c += -D__NO_WEAK_PTHREAD_ALIASES
+
 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
 # This ensures they will load libc.so for needed symbols if loaded by
 # a statically-linked program that hasn't already loaded it.
index 7e5271b..cd7ace2 100644 (file)
@@ -33,14 +33,14 @@ int __pthread_mutex_init(pthread_mutex_t * mutex,
   mutex->__m_owner = NULL;
   return 0;
 }
-weak_alias (__pthread_mutex_init, pthread_mutex_init)
+strong_alias (__pthread_mutex_init, pthread_mutex_init)
 
 int __pthread_mutex_destroy(pthread_mutex_t * mutex)
 {
   if (mutex->__m_lock.__status != 0) return EBUSY;
   return 0;
 }
-weak_alias (__pthread_mutex_destroy, pthread_mutex_destroy)
+strong_alias (__pthread_mutex_destroy, pthread_mutex_destroy)
 
 int __pthread_mutex_trylock(pthread_mutex_t * mutex)
 {
@@ -73,7 +73,7 @@ int __pthread_mutex_trylock(pthread_mutex_t * mutex)
     return EINVAL;
   }
 }
-weak_alias (__pthread_mutex_trylock, pthread_mutex_trylock)
+strong_alias (__pthread_mutex_trylock, pthread_mutex_trylock)
 
 int __pthread_mutex_lock(pthread_mutex_t * mutex)
 {
@@ -103,7 +103,7 @@ int __pthread_mutex_lock(pthread_mutex_t * mutex)
     return EINVAL;
   }
 }
-weak_alias (__pthread_mutex_lock, pthread_mutex_lock)
+strong_alias (__pthread_mutex_lock, pthread_mutex_lock)
 
 int __pthread_mutex_unlock(pthread_mutex_t * mutex)
 {
@@ -129,20 +129,20 @@ int __pthread_mutex_unlock(pthread_mutex_t * mutex)
     return EINVAL;
   }
 }
-weak_alias (__pthread_mutex_unlock, pthread_mutex_unlock)
+strong_alias (__pthread_mutex_unlock, pthread_mutex_unlock)
 
 int __pthread_mutexattr_init(pthread_mutexattr_t *attr)
 {
   attr->__mutexkind = PTHREAD_MUTEX_FAST_NP;
   return 0;
 }
-weak_alias (__pthread_mutexattr_init, pthread_mutexattr_init)
+strong_alias (__pthread_mutexattr_init, pthread_mutexattr_init)
 
 int __pthread_mutexattr_destroy(pthread_mutexattr_t *attr)
 {
   return 0;
 }
-weak_alias (__pthread_mutexattr_destroy, pthread_mutexattr_destroy)
+strong_alias (__pthread_mutexattr_destroy, pthread_mutexattr_destroy)
 
 int __pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind)
 {
@@ -196,4 +196,4 @@ int __pthread_once(pthread_once_t * once_control, void (*init_routine)(void))
   pthread_mutex_unlock(&once_masterlock);
   return 0;
 }
-weak_alias (__pthread_once, pthread_once)
+strong_alias (__pthread_once, pthread_once)
index 32b1d26..2245407 100644 (file)
@@ -66,7 +66,7 @@ int __pthread_atfork(void (*prepare)(void),
   pthread_mutex_unlock(&pthread_atfork_lock);
   return 0;
 }
-weak_alias (__pthread_atfork, pthread_atfork)
+strong_alias (__pthread_atfork, pthread_atfork)
 
 static inline void pthread_call_handlers(struct handler_list * list)
 {
index 2df477a..a86b1a0 100644 (file)
@@ -56,7 +56,7 @@ int __pthread_key_create(pthread_key_t * key, destr_function destr)
   pthread_mutex_unlock(&pthread_keys_mutex);
   return EAGAIN;
 }
-weak_alias (__pthread_key_create, pthread_key_create)
+strong_alias (__pthread_key_create, pthread_key_create)
 
 /* Delete a key */
 
@@ -108,7 +108,7 @@ int __pthread_setspecific(pthread_key_t key, const void * pointer)
   THREAD_GETMEM_NC(self, p_specific[idx1st])[idx2nd] = (void *) pointer;
   return 0;
 }
-weak_alias (__pthread_setspecific, pthread_setspecific)
+strong_alias (__pthread_setspecific, pthread_setspecific)
 
 /* Get the value of a key */
 
@@ -126,7 +126,7 @@ void * __pthread_getspecific(pthread_key_t key)
     return NULL;
   return THREAD_GETMEM_NC(self, p_specific[idx1st])[idx2nd];
 }
-weak_alias (__pthread_getspecific, pthread_getspecific)
+strong_alias (__pthread_getspecific, pthread_getspecific)
 
 /* Call the destruction routines on all keys */
 
index 820d65a..1763a42 100644 (file)
@@ -170,7 +170,8 @@ extern int __libc_internal_tsd_set __P ((enum __libc_tsd_key_t,
 
 /* Make the pthread functions weak so that we can elide them from
    single-threaded processes.  */
-#ifdef weak_extern
+#ifndef __NO_WEAK_PTHREAD_ALIASES
+# ifdef weak_extern
 weak_extern (__pthread_mutex_init)
 weak_extern (__pthread_mutex_destroy)
 weak_extern (__pthread_mutex_lock)
@@ -189,25 +190,26 @@ weak_extern (__pthread_initialize)
 weak_extern (__pthread_atfork)
 weak_extern (_pthread_cleanup_push_defer)
 weak_extern (_pthread_cleanup_pop_restore)
-#else
-# pragma weak __pthread_mutex_init
-# pragma weak __pthread_mutex_destroy
-# pragma weak __pthread_mutex_lock
-# pragma weak __pthread_mutex_trylock
-# pragma weak __pthread_mutex_unlock
-# pragma weak __pthread_mutexattr_init
-# pragma weak __pthread_mutexattr_destroy
-# pragma weak __pthread_mutexattr_settype
-# pragma weak __pthread_key_create
-# pragma weak __pthread_setspecific
-# pragma weak __pthread_getspecific
-# pragma weak __libc_internal_tsd_get
-# pragma weak __libc_internal_tsd_set
-# pragma weak __pthread_once
-# pragma weak __pthread_initialize
-# pragma weak __pthread_atfork
-# pragma weak _pthread_cleanup_push_defer
-# pragma weak _pthread_cleanup_pop_restore
+# else
+#  pragma weak __pthread_mutex_init
+#  pragma weak __pthread_mutex_destroy
+#  pragma weak __pthread_mutex_lock
+#  pragma weak __pthread_mutex_trylock
+#  pragma weak __pthread_mutex_unlock
+#  pragma weak __pthread_mutexattr_init
+#  pragma weak __pthread_mutexattr_destroy
+#  pragma weak __pthread_mutexattr_settype
+#  pragma weak __pthread_key_create
+#  pragma weak __pthread_setspecific
+#  pragma weak __pthread_getspecific
+#  pragma weak __libc_internal_tsd_get
+#  pragma weak __libc_internal_tsd_set
+#  pragma weak __pthread_once
+#  pragma weak __pthread_initialize
+#  pragma weak __pthread_atfork
+#  pragma weak _pthread_cleanup_push_defer
+#  pragma weak _pthread_cleanup_pop_restore
+# endif
 #endif
 
 /* We need portable names for some functions.  E.g., when they are