From 0eadd98d30c51d26fde4062e6b8c48f3c9b5148d Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Fri, 16 Apr 2010 16:29:46 +0300 Subject: 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 Signed-off-by: Austin Foxley --- libpthread/nptl/sysdeps/pthread/bits/libc-lock.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libpthread/nptl/sysdeps/pthread') 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 #include #define __need_NULL #include @@ -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 -- cgit v1.2.3