summaryrefslogtreecommitdiff
path: root/libpthread/nptl
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2010-04-16 16:29:46 +0300
committerAustin Foxley <austinf@cetoncorp.com>2010-04-16 10:13:14 -0700
commit0eadd98d30c51d26fde4062e6b8c48f3c9b5148d (patch)
treeabbb3367ac54b35b8d7198af729996fe1531dd95 /libpthread/nptl
parent837e8425ce9a0c1ad1c58a00cf3b9e949e7b17cd (diff)
libc: remove libc weak __pthreads_* wrappers
It is not possible to override for libpthread to override the weak libc definitions. This has never worked in uclibc, and does no longer work in glibc either (unless you use LD_DYNAMIC_WEAK). The proper thing to do is have weak prototypes in libc, and definitions in libpthread only. This way libc runs even if those functions are not defined, but just needs to protect against the NULL values (done by implementing __uclibc_maybe_call). This fix the problems if libc is linked before libpthread or if libpthread is pulled by a dependency library. Signed-off-by: Timo Teras <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libpthread/nptl')
-rw-r--r--libpthread/nptl/sysdeps/pthread/bits/libc-lock.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h b/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h
index 3268aa5f6..52627b418 100644
--- a/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h
+++ b/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h
@@ -20,6 +20,7 @@
#ifndef _BITS_LIBC_LOCK_H
#define _BITS_LIBC_LOCK_H 1
+#include <bits/initspin.h>
#include <pthread.h>
#define __need_NULL
#include <stddef.h>
@@ -429,7 +430,7 @@ extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer
/* Normal cleanup handling, based on C cleanup attribute. */
-__extern_inline void
+static inline void
__libc_cleanup_routine (struct __pthread_cleanup_frame *f)
{
if (f->__do_it)
@@ -460,7 +461,6 @@ __libc_cleanup_routine (struct __pthread_cleanup_frame *f)
#define __libc_setspecific(KEY, VALUE) \
__libc_ptf_call (__pthread_setspecific, (KEY, VALUE), 0)
-
/* Register handlers to execute before and after `fork'. Note that the
last parameter is NULL. The handlers registered by the libc are
never removed so this is OK. */
@@ -551,10 +551,8 @@ weak_extern (__pthread_getspecific)
weak_extern (__pthread_once)
//weak_extern (__pthread_initialize)
weak_extern (__pthread_atfork)
-#ifdef SHARED
weak_extern (_pthread_cleanup_push_defer)
weak_extern (_pthread_cleanup_pop_restore)
-#endif
weak_extern (pthread_setcancelstate)
# else
# pragma weak __pthread_mutex_init