+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.
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.
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)
{
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)
{
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)
{
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)
{
pthread_mutex_unlock(&once_masterlock);
return 0;
}
-weak_alias (__pthread_once, pthread_once)
+strong_alias (__pthread_once, pthread_once)
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)
{
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 */
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 */
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 */
/* 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)
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