diff options
author | deischen <deischen@FreeBSD.org> | 2006-03-13 00:59:51 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2006-03-13 00:59:51 +0000 |
commit | cc69a08fbfbd64dd13ebb80b18cc83824a3c8781 (patch) | |
tree | 0ff38bc0c45640883ff06a668902f099c9ff8641 /lib/libpthread | |
parent | 11cbb2f2752487f0605f14afcc37e520331c8dbc (diff) | |
download | FreeBSD-src-cc69a08fbfbd64dd13ebb80b18cc83824a3c8781.zip FreeBSD-src-cc69a08fbfbd64dd13ebb80b18cc83824a3c8781.tar.gz |
Add compatibility symbol maps. libpthread (.so.1 and .so.2)
used LIBTHREAD_1_0 as its version definition, but now needs
to define its symbols in the same namespace used by libc.
The compatibility hooks allows you to use libraries and
binaries built and linked to libpthread before libc was
built with symbol versioning. The shims can be removed if
libpthread is given a version bump.
Reviewed by: davidxu
Diffstat (limited to 'lib/libpthread')
104 files changed, 871 insertions, 16 deletions
diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile index aaa055f..ccb8493 100644 --- a/lib/libpthread/Makefile +++ b/lib/libpthread/Makefile @@ -31,10 +31,13 @@ CFLAGS+=-D_LOCK_DEBUG # however it is no longer strictly conformed to POSIX # CFLAGS+=-DSYSTEM_SCOPE_ONLY -LDFLAGS= -Wl,--version-script=${.CURDIR}/pthread.map +LDFLAGS= -Wl,--version-script=${.CURDIR}/pthread.map -Wl,-zmuldefs # enable extra internal consistancy checks CFLAGS+=-D_PTHREADS_INVARIANTS -Wall +.if defined(SYMVER_ENABLED) +CFLAGS+=-DSYMBOL_VERSIONING +.endif PRECIOUSLIB= diff --git a/lib/libpthread/pthread.map b/lib/libpthread/pthread.map index e13f4a0..914b41f 100644 --- a/lib/libpthread/pthread.map +++ b/lib/libpthread/pthread.map @@ -1,4 +1,14 @@ # $FreeBSD$ + +# +# Hack. libpthread had versioning before libc, but we need to +# reside in the same namespace as libc if we want to override +# libc functions. Use this so we don't break older applications +# that require symbols from "LIBTHREAD_1_0". +# +# From now on, use the same naming scheme as libc. +# +# LIBTHREAD_1_0 { global: ___creat; @@ -22,6 +32,9 @@ global: __readv; __select; __sigsuspend; + __sigtimedwait; + __sigwait; + __sigwaitinfo; __wait4; __write; __writev; @@ -39,7 +52,6 @@ global: _pthread_barrierattr_getpshared; _pthread_barrierattr_init; _pthread_barrierattr_setpshared; - _pthread_attr_default; _pthread_attr_destroy; _pthread_attr_get_np; _pthread_attr_getdetachstate; @@ -150,23 +162,17 @@ global: _pthread_yield; _raise; _sched_yield; - _sem_close; - _sem_destroy; - _sem_getvalue; _sem_init; - _sem_open; _sem_post; _sem_timedwait; - _sem_trywait; - _sem_unlink; _sem_wait; _sigaction; _sigaltstack; _sigpending; _sigprocmask; _sigsuspend; - _sigwait; _sigtimedwait; + _sigwait; _sigwaitinfo; _sleep; _spinlock; @@ -312,15 +318,9 @@ global: readv; sched_yield; select; - sem_close; - sem_destroy; - sem_getvalue; sem_init; - sem_open; sem_post; sem_timedwait; - sem_trywait; - sem_unlink; sem_wait; sigaction; sigaltstack; @@ -335,11 +335,376 @@ global: tcdrain; usleep; vfork; + wait4; wait; + waitpid; + write; + writev; + + # Debugger needs these. + _libkse_debug; + _thread_activated; + _thread_active_threads; + _thread_keytable; + _thread_list; + _thread_max_keys; + _thread_off_attr_flags; + _thread_off_dtv; + _thread_off_linkmap; + _thread_off_next; + _thread_off_tcb; + _thread_off_tmbx; + _thread_off_key_allocated; + _thread_off_key_destructor; + _thread_off_kse; + _thread_off_kse_locklevel; + _thread_off_state; + _thread_off_thr_locklevel; + _thread_off_tlsindex; + _thread_size_key; + _thread_state_running; + _thread_state_zoombie; + +local: + *; +}; + +# +# Use the same naming scheme as libc. +# +FBSD_1.0 { +global: + __error; + accept; + aio_suspend; + close; + connect; + creat; + execve; + fcntl; + fork; + fsync; + msync; + nanosleep; + open; + pause; + poll; + pselect; + pthread_atfork; + pthread_barrier_destroy; + pthread_barrier_init; + pthread_barrier_wait; + pthread_barrierattr_destroy; + pthread_barrierattr_getpshared; + pthread_barrierattr_init; + pthread_barrierattr_setpshared; + pthread_attr_destroy; + pthread_attr_get_np; + pthread_attr_getdetachstate; + pthread_attr_getguardsize; + pthread_attr_getinheritsched; + pthread_attr_getschedparam; + pthread_attr_getschedpolicy; + pthread_attr_getscope; + pthread_attr_getstack; + pthread_attr_getstackaddr; + pthread_attr_getstacksize; + pthread_attr_init; + pthread_attr_setcreatesuspend_np; + pthread_attr_setdetachstate; + pthread_attr_setguardsize; + pthread_attr_setinheritsched; + pthread_attr_setschedparam; + pthread_attr_setschedpolicy; + pthread_attr_setscope; + pthread_attr_setstack; + pthread_attr_setstackaddr; + pthread_attr_setstacksize; + pthread_cancel; + pthread_cleanup_pop; + pthread_cleanup_push; + pthread_cond_broadcast; + pthread_cond_destroy; + pthread_cond_init; + pthread_cond_signal; + pthread_cond_timedwait; + pthread_cond_wait; + pthread_condattr_destroy; + pthread_condattr_init; + pthread_create; + pthread_detach; + pthread_equal; + pthread_exit; + pthread_getconcurrency; + pthread_getprio; + pthread_getschedparam; + pthread_getspecific; + pthread_join; + pthread_key_create; + pthread_key_delete; + pthread_kill; + pthread_main_np; + pthread_multi_np; + pthread_mutex_destroy; + pthread_mutex_getprioceiling; + pthread_mutex_init; + pthread_mutex_lock; + pthread_mutex_setprioceiling; + pthread_mutex_timedlock; + pthread_mutex_trylock; + pthread_mutex_unlock; + pthread_mutexattr_destroy; + pthread_mutexattr_getkind_np; + pthread_mutexattr_getprioceiling; + pthread_mutexattr_getprotocol; + pthread_mutexattr_gettype; + pthread_mutexattr_init; + pthread_mutexattr_setkind_np; + pthread_mutexattr_setprioceiling; + pthread_mutexattr_setprotocol; + pthread_mutexattr_settype; + pthread_once; + pthread_resume_all_np; + pthread_resume_np; + pthread_rwlock_destroy; + pthread_rwlock_init; + pthread_rwlock_rdlock; + pthread_rwlock_timedrdlock; + pthread_rwlock_timedwrlock; + pthread_rwlock_tryrdlock; + pthread_rwlock_trywrlock; + pthread_rwlock_unlock; + pthread_rwlock_wrlock; + pthread_rwlockattr_destroy; + pthread_rwlockattr_getpshared; + pthread_rwlockattr_init; + pthread_rwlockattr_setpshared; + pthread_self; + pthread_set_name_np; + pthread_setcancelstate; + pthread_setcanceltype; + pthread_setconcurrency; + pthread_setprio; + pthread_setschedparam; + pthread_setspecific; + pthread_sigmask; + pthread_single_np; + pthread_spin_destroy; + pthread_spin_init; + pthread_spin_lock; + pthread_spin_trylock; + pthread_spin_unlock; + pthread_suspend_all_np; + pthread_suspend_np; + pthread_switch_add_np; + pthread_switch_delete_np; + pthread_testcancel; + pthread_yield; + raise; + read; + readv; + sched_yield; + select; + sem_init; + sem_post; + sem_timedwait; + sem_wait; + sigaction; + sigaltstack; + sigpending; + sigprocmask; + sigsuspend; + sigwait; + sigwaitinfo; + sigtimedwait; + sleep; + system; + tcdrain; + usleep; + vfork; wait4; + wait; waitpid; write; writev; +local: + *; +}; + +# +# List the private interfaces reserved for use in FreeBSD libraries. +# These are not part of our application ABI. +# +FBSDprivate { +global: + ___creat; + __accept; + __close; + __connect; + __fcntl; + __fsync; + __msync; + __nanosleep; + __open; + __poll; + __pthread_cond_timedwait; + __pthread_cond_wait; + __pthread_mutex_init; + __pthread_mutex_lock; + __pthread_mutex_trylock; + __pthread_mutex_timedlock; + __read; + __readv; + __select; + __sigsuspend; + __sigtimedwait; + __sigwait; + __sigwaitinfo; + __wait4; + __write; + __writev; + _aio_suspend; + _execve; + _fork; + _nanosleep; + _pause; + _pselect; + _pthread_atfork; + _pthread_barrier_destroy; + _pthread_barrier_init; + _pthread_barrier_wait; + _pthread_barrierattr_destroy; + _pthread_barrierattr_getpshared; + _pthread_barrierattr_init; + _pthread_barrierattr_setpshared; + _pthread_attr_destroy; + _pthread_attr_get_np; + _pthread_attr_getdetachstate; + _pthread_attr_getguardsize; + _pthread_attr_getinheritsched; + _pthread_attr_getschedparam; + _pthread_attr_getschedpolicy; + _pthread_attr_getscope; + _pthread_attr_getstack; + _pthread_attr_getstackaddr; + _pthread_attr_getstacksize; + _pthread_attr_init; + _pthread_attr_setcreatesuspend_np; + _pthread_attr_setdetachstate; + _pthread_attr_setguardsize; + _pthread_attr_setinheritsched; + _pthread_attr_setschedparam; + _pthread_attr_setschedpolicy; + _pthread_attr_setscope; + _pthread_attr_setstack; + _pthread_attr_setstackaddr; + _pthread_attr_setstacksize; + _pthread_cancel; + _pthread_cleanup_pop; + _pthread_cleanup_push; + _pthread_cond_broadcast; + _pthread_cond_destroy; + _pthread_cond_init; + _pthread_cond_signal; + _pthread_cond_timedwait; + _pthread_cond_wait; + _pthread_condattr_default; + _pthread_condattr_destroy; + _pthread_condattr_init; + _pthread_create; + _pthread_detach; + _pthread_equal; + _pthread_exit; + _pthread_getconcurrency; + _pthread_getprio; + _pthread_getschedparam; + _pthread_getspecific; + _pthread_join; + _pthread_key_create; + _pthread_key_delete; + _pthread_kill; + _pthread_main_np; + _pthread_multi_np; + _pthread_mutex_destroy; + _pthread_mutex_getprioceiling; + _pthread_mutex_init; + _pthread_mutex_lock; + _pthread_mutex_setprioceiling; + _pthread_mutex_timedlock; + _pthread_mutex_trylock; + _pthread_mutex_unlock; + _pthread_mutexattr_default; + _pthread_mutexattr_destroy; + _pthread_mutexattr_getkind_np; + _pthread_mutexattr_getprioceiling; + _pthread_mutexattr_getprotocol; + _pthread_mutexattr_gettype; + _pthread_mutexattr_init; + _pthread_mutexattr_setkind_np; + _pthread_mutexattr_setprioceiling; + _pthread_mutexattr_setprotocol; + _pthread_mutexattr_settype; + _pthread_once; + _pthread_resume_all_np; + _pthread_resume_np; + _pthread_rwlock_destroy; + _pthread_rwlock_init; + _pthread_rwlock_rdlock; + _pthread_rwlock_timedrdlock; + _pthread_rwlock_timedwrlock; + _pthread_rwlock_tryrdlock; + _pthread_rwlock_trywrlock; + _pthread_rwlock_unlock; + _pthread_rwlock_wrlock; + _pthread_rwlockattr_destroy; + _pthread_rwlockattr_getpshared; + _pthread_rwlockattr_init; + _pthread_rwlockattr_setpshared; + _pthread_self; + _pthread_set_name_np; + _pthread_setcancelstate; + _pthread_setcanceltype; + _pthread_setconcurrency; + _pthread_setprio; + _pthread_setschedparam; + _pthread_setspecific; + _pthread_sigmask; + _pthread_single_np; + _pthread_spin_destroy; + _pthread_spin_init; + _pthread_spin_lock; + _pthread_spin_trylock; + _pthread_spin_unlock; + _pthread_suspend_all_np; + _pthread_suspend_np; + _pthread_switch_add_np; + _pthread_switch_delete_np; + _pthread_testcancel; + _pthread_yield; + _raise; + _sched_yield; + _sem_init; + _sem_post; + _sem_timedwait; + _sem_wait; + _sigaction; + _sigaltstack; + _sigpending; + _sigprocmask; + _sigsuspend; + _sigtimedwait; + _sigwait; + _sigwaitinfo; + _sleep; + _spinlock; + _spinlock_debug; + _spinunlock; + _system; + _tcdrain; + _usleep; + _vfork; + _wait; + _waitpid; # Debugger needs these. _libkse_debug; @@ -364,6 +729,7 @@ global: _thread_size_key; _thread_state_running; _thread_state_zoombie; + local: *; }; diff --git a/lib/libpthread/sys/thr_error.c b/lib/libpthread/sys/thr_error.c index 72e1927..0ba34e0 100644 --- a/lib/libpthread/sys/thr_error.c +++ b/lib/libpthread/sys/thr_error.c @@ -40,6 +40,8 @@ #undef errno extern int errno; +LT10_COMPAT_DEFAULT(__error); + int * __error(void) { diff --git a/lib/libpthread/thread/thr_accept.c b/lib/libpthread/thread/thr_accept.c index 0131bc8..fc60fb4 100644 --- a/lib/libpthread/thread/thr_accept.c +++ b/lib/libpthread/thread/thr_accept.c @@ -32,6 +32,9 @@ __FBSDID("$FreeBSD$"); #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__accept); +LT10_COMPAT_DEFAULT(accept); + __weak_reference(__accept, accept); int diff --git a/lib/libpthread/thread/thr_aio_suspend.c b/lib/libpthread/thread/thr_aio_suspend.c index 5b8a6dc..43a2414 100644 --- a/lib/libpthread/thread/thr_aio_suspend.c +++ b/lib/libpthread/thread/thr_aio_suspend.c @@ -33,6 +33,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_aio_suspend); +LT10_COMPAT_DEFAULT(aio_suspend); + __weak_reference(_aio_suspend, aio_suspend); int diff --git a/lib/libpthread/thread/thr_atfork.c b/lib/libpthread/thread/thr_atfork.c index 0487a36..a741329 100644 --- a/lib/libpthread/thread/thr_atfork.c +++ b/lib/libpthread/thread/thr_atfork.c @@ -31,6 +31,9 @@ #include <sys/queue.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_atfork); +LT10_COMPAT_DEFAULT(pthread_atfork); + __weak_reference(_pthread_atfork, pthread_atfork); int diff --git a/lib/libpthread/thread/thr_attr_destroy.c b/lib/libpthread/thread/thr_attr_destroy.c index e239a1d..4442584 100644 --- a/lib/libpthread/thread/thr_attr_destroy.c +++ b/lib/libpthread/thread/thr_attr_destroy.c @@ -36,6 +36,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_destroy); +LT10_COMPAT_DEFAULT(pthread_attr_destroy); + __weak_reference(_pthread_attr_destroy, pthread_attr_destroy); int diff --git a/lib/libpthread/thread/thr_attr_get_np.c b/lib/libpthread/thread/thr_attr_get_np.c index e844acb..a63088f 100644 --- a/lib/libpthread/thread/thr_attr_get_np.c +++ b/lib/libpthread/thread/thr_attr_get_np.c @@ -31,6 +31,9 @@ #include <pthread_np.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_get_np); +LT10_COMPAT_DEFAULT(pthread_attr_get_np); + __weak_reference(_pthread_attr_get_np, pthread_attr_get_np); int diff --git a/lib/libpthread/thread/thr_attr_getdetachstate.c b/lib/libpthread/thread/thr_attr_getdetachstate.c index d994548..e2ff6bd 100644 --- a/lib/libpthread/thread/thr_attr_getdetachstate.c +++ b/lib/libpthread/thread/thr_attr_getdetachstate.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_getdetachstate); +LT10_COMPAT_DEFAULT(pthread_attr_getdetachstate); + __weak_reference(_pthread_attr_getdetachstate, pthread_attr_getdetachstate); int diff --git a/lib/libpthread/thread/thr_attr_getguardsize.c b/lib/libpthread/thread/thr_attr_getguardsize.c index b32015a..351015c 100644 --- a/lib/libpthread/thread/thr_attr_getguardsize.c +++ b/lib/libpthread/thread/thr_attr_getguardsize.c @@ -33,6 +33,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_getguardsize); +LT10_COMPAT_DEFAULT(pthread_attr_getguardsize); + __weak_reference(_pthread_attr_getguardsize, pthread_attr_getguardsize); int diff --git a/lib/libpthread/thread/thr_attr_getinheritsched.c b/lib/libpthread/thread/thr_attr_getinheritsched.c index 26ae9e4..eab19e3 100644 --- a/lib/libpthread/thread/thr_attr_getinheritsched.c +++ b/lib/libpthread/thread/thr_attr_getinheritsched.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_getinheritsched); +LT10_COMPAT_DEFAULT(pthread_attr_getinheritsched); + __weak_reference(_pthread_attr_getinheritsched, pthread_attr_getinheritsched); int diff --git a/lib/libpthread/thread/thr_attr_getschedparam.c b/lib/libpthread/thread/thr_attr_getschedparam.c index 79911f4..ca2eed3 100644 --- a/lib/libpthread/thread/thr_attr_getschedparam.c +++ b/lib/libpthread/thread/thr_attr_getschedparam.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_getschedparam); +LT10_COMPAT_DEFAULT(pthread_attr_getschedparam); + __weak_reference(_pthread_attr_getschedparam, pthread_attr_getschedparam); int diff --git a/lib/libpthread/thread/thr_attr_getschedpolicy.c b/lib/libpthread/thread/thr_attr_getschedpolicy.c index 1234b7d..dc952bd 100644 --- a/lib/libpthread/thread/thr_attr_getschedpolicy.c +++ b/lib/libpthread/thread/thr_attr_getschedpolicy.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_getschedpolicy); +LT10_COMPAT_DEFAULT(pthread_attr_getschedpolicy); + __weak_reference(_pthread_attr_getschedpolicy, pthread_attr_getschedpolicy); int diff --git a/lib/libpthread/thread/thr_attr_getscope.c b/lib/libpthread/thread/thr_attr_getscope.c index fefe6cf..ceb198f 100644 --- a/lib/libpthread/thread/thr_attr_getscope.c +++ b/lib/libpthread/thread/thr_attr_getscope.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_getscope); +LT10_COMPAT_DEFAULT(pthread_attr_getscope); + __weak_reference(_pthread_attr_getscope, pthread_attr_getscope); int diff --git a/lib/libpthread/thread/thr_attr_getstack.c b/lib/libpthread/thread/thr_attr_getstack.c index 8c0f87f..79a92cb 100644 --- a/lib/libpthread/thread/thr_attr_getstack.c +++ b/lib/libpthread/thread/thr_attr_getstack.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_getstack); +LT10_COMPAT_DEFAULT(pthread_attr_getstack); + __weak_reference(_pthread_attr_getstack, pthread_attr_getstack); int diff --git a/lib/libpthread/thread/thr_attr_getstackaddr.c b/lib/libpthread/thread/thr_attr_getstackaddr.c index d082248..0d5c87c 100644 --- a/lib/libpthread/thread/thr_attr_getstackaddr.c +++ b/lib/libpthread/thread/thr_attr_getstackaddr.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_getstackaddr); +LT10_COMPAT_DEFAULT(pthread_attr_getstackaddr); + __weak_reference(_pthread_attr_getstackaddr, pthread_attr_getstackaddr); int diff --git a/lib/libpthread/thread/thr_attr_getstacksize.c b/lib/libpthread/thread/thr_attr_getstacksize.c index ec1a9be..2636e97 100644 --- a/lib/libpthread/thread/thr_attr_getstacksize.c +++ b/lib/libpthread/thread/thr_attr_getstacksize.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_getstacksize); +LT10_COMPAT_DEFAULT(pthread_attr_getstacksize); + __weak_reference(_pthread_attr_getstacksize, pthread_attr_getstacksize); int diff --git a/lib/libpthread/thread/thr_attr_init.c b/lib/libpthread/thread/thr_attr_init.c index 604a1aa..77f3f24 100644 --- a/lib/libpthread/thread/thr_attr_init.c +++ b/lib/libpthread/thread/thr_attr_init.c @@ -37,6 +37,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_init); +LT10_COMPAT_DEFAULT(pthread_attr_init); + __weak_reference(_pthread_attr_init, pthread_attr_init); int diff --git a/lib/libpthread/thread/thr_attr_setcreatesuspend_np.c b/lib/libpthread/thread/thr_attr_setcreatesuspend_np.c index d844d62..aa5f878 100644 --- a/lib/libpthread/thread/thr_attr_setcreatesuspend_np.c +++ b/lib/libpthread/thread/thr_attr_setcreatesuspend_np.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_setcreatesuspend_np); +LT10_COMPAT_DEFAULT(pthread_attr_setcreatesuspend_np); + __weak_reference(_pthread_attr_setcreatesuspend_np, pthread_attr_setcreatesuspend_np); int diff --git a/lib/libpthread/thread/thr_attr_setdetachstate.c b/lib/libpthread/thread/thr_attr_setdetachstate.c index 4d517f2..b17680b 100644 --- a/lib/libpthread/thread/thr_attr_setdetachstate.c +++ b/lib/libpthread/thread/thr_attr_setdetachstate.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_setdetachstate); +LT10_COMPAT_DEFAULT(pthread_attr_setdetachstate); + __weak_reference(_pthread_attr_setdetachstate, pthread_attr_setdetachstate); int diff --git a/lib/libpthread/thread/thr_attr_setguardsize.c b/lib/libpthread/thread/thr_attr_setguardsize.c index d56b254..dedee8b 100644 --- a/lib/libpthread/thread/thr_attr_setguardsize.c +++ b/lib/libpthread/thread/thr_attr_setguardsize.c @@ -34,6 +34,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_setguardsize); +LT10_COMPAT_DEFAULT(pthread_attr_setguardsize); + __weak_reference(_pthread_attr_setguardsize, pthread_attr_setguardsize); int diff --git a/lib/libpthread/thread/thr_attr_setinheritsched.c b/lib/libpthread/thread/thr_attr_setinheritsched.c index e91b214..5182b7d 100644 --- a/lib/libpthread/thread/thr_attr_setinheritsched.c +++ b/lib/libpthread/thread/thr_attr_setinheritsched.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_setinheritsched); +LT10_COMPAT_DEFAULT(pthread_attr_setinheritsched); + __weak_reference(_pthread_attr_setinheritsched, pthread_attr_setinheritsched); int diff --git a/lib/libpthread/thread/thr_attr_setschedparam.c b/lib/libpthread/thread/thr_attr_setschedparam.c index bbb4b1e..61d741d 100644 --- a/lib/libpthread/thread/thr_attr_setschedparam.c +++ b/lib/libpthread/thread/thr_attr_setschedparam.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_setschedparam); +LT10_COMPAT_DEFAULT(pthread_attr_setschedparam); + __weak_reference(_pthread_attr_setschedparam, pthread_attr_setschedparam); int diff --git a/lib/libpthread/thread/thr_attr_setschedpolicy.c b/lib/libpthread/thread/thr_attr_setschedpolicy.c index ddb0921..fb24cb1 100644 --- a/lib/libpthread/thread/thr_attr_setschedpolicy.c +++ b/lib/libpthread/thread/thr_attr_setschedpolicy.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_setschedpolicy); +LT10_COMPAT_DEFAULT(pthread_attr_setschedpolicy); + __weak_reference(_pthread_attr_setschedpolicy, pthread_attr_setschedpolicy); int diff --git a/lib/libpthread/thread/thr_attr_setscope.c b/lib/libpthread/thread/thr_attr_setscope.c index dcf179e..3cc7f16 100644 --- a/lib/libpthread/thread/thr_attr_setscope.c +++ b/lib/libpthread/thread/thr_attr_setscope.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_setscope); +LT10_COMPAT_DEFAULT(pthread_attr_setscope); + __weak_reference(_pthread_attr_setscope, pthread_attr_setscope); int diff --git a/lib/libpthread/thread/thr_attr_setstack.c b/lib/libpthread/thread/thr_attr_setstack.c index feeb713..bdccfd8 100644 --- a/lib/libpthread/thread/thr_attr_setstack.c +++ b/lib/libpthread/thread/thr_attr_setstack.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_setstack); +LT10_COMPAT_DEFAULT(pthread_attr_setstack); + __weak_reference(_pthread_attr_setstack, pthread_attr_setstack); int diff --git a/lib/libpthread/thread/thr_attr_setstackaddr.c b/lib/libpthread/thread/thr_attr_setstackaddr.c index 87837f1..5f0a903 100644 --- a/lib/libpthread/thread/thr_attr_setstackaddr.c +++ b/lib/libpthread/thread/thr_attr_setstackaddr.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_setstackaddr); +LT10_COMPAT_DEFAULT(pthread_attr_setstackaddr); + __weak_reference(_pthread_attr_setstackaddr, pthread_attr_setstackaddr); int diff --git a/lib/libpthread/thread/thr_attr_setstacksize.c b/lib/libpthread/thread/thr_attr_setstacksize.c index e26ab7d..6fa9760 100644 --- a/lib/libpthread/thread/thr_attr_setstacksize.c +++ b/lib/libpthread/thread/thr_attr_setstacksize.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_attr_setstacksize); +LT10_COMPAT_DEFAULT(pthread_attr_setstacksize); + __weak_reference(_pthread_attr_setstacksize, pthread_attr_setstacksize); int diff --git a/lib/libpthread/thread/thr_barrier.c b/lib/libpthread/thread/thr_barrier.c index 612acb1..ed54a99 100644 --- a/lib/libpthread/thread/thr_barrier.c +++ b/lib/libpthread/thread/thr_barrier.c @@ -33,6 +33,13 @@ #include "un-namespace.h" #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_barrier_init); +LT10_COMPAT_DEFAULT(pthread_barrier_init); +LT10_COMPAT_PRIVATE(_pthread_barrier_wait); +LT10_COMPAT_DEFAULT(pthread_barrier_wait); +LT10_COMPAT_PRIVATE(_pthread_barrier_destroy); +LT10_COMPAT_DEFAULT(pthread_barrier_destroy); + __weak_reference(_pthread_barrier_init, pthread_barrier_init); __weak_reference(_pthread_barrier_wait, pthread_barrier_wait); __weak_reference(_pthread_barrier_destroy, pthread_barrier_destroy); diff --git a/lib/libpthread/thread/thr_barrierattr.c b/lib/libpthread/thread/thr_barrierattr.c index f71c0dd..3384aee 100644 --- a/lib/libpthread/thread/thr_barrierattr.c +++ b/lib/libpthread/thread/thr_barrierattr.c @@ -33,6 +33,15 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_barrierattr_destroy); +LT10_COMPAT_DEFAULT(pthread_barrierattr_destroy); +LT10_COMPAT_PRIVATE(_pthread_barrierattr_init); +LT10_COMPAT_DEFAULT(pthread_barrierattr_init); +LT10_COMPAT_PRIVATE(_pthread_barrierattr_setpshared); +LT10_COMPAT_DEFAULT(pthread_barrierattr_setpshared); +LT10_COMPAT_PRIVATE(_pthread_barrierattr_getpshared); +LT10_COMPAT_DEFAULT(pthread_barrierattr_getpshared); + __weak_reference(_pthread_barrierattr_destroy, pthread_barrierattr_destroy); __weak_reference(_pthread_barrierattr_init, pthread_barrierattr_init); __weak_reference(_pthread_barrierattr_setpshared, diff --git a/lib/libpthread/thread/thr_cancel.c b/lib/libpthread/thread/thr_cancel.c index a6a32b8..bbf6fdf 100644 --- a/lib/libpthread/thread/thr_cancel.c +++ b/lib/libpthread/thread/thr_cancel.c @@ -6,6 +6,15 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_cancel); +LT10_COMPAT_DEFAULT(pthread_cancel); +LT10_COMPAT_PRIVATE(_pthread_setcancelstate); +LT10_COMPAT_DEFAULT(pthread_setcancelstate); +LT10_COMPAT_PRIVATE(_pthread_setcanceltype); +LT10_COMPAT_DEFAULT(pthread_setcanceltype); +LT10_COMPAT_PRIVATE(_pthread_testcancel); +LT10_COMPAT_DEFAULT(pthread_testcancel); + __weak_reference(_pthread_cancel, pthread_cancel); __weak_reference(_pthread_setcancelstate, pthread_setcancelstate); __weak_reference(_pthread_setcanceltype, pthread_setcanceltype); diff --git a/lib/libpthread/thread/thr_clean.c b/lib/libpthread/thread/thr_clean.c index 1da8a6b..4db5c93 100644 --- a/lib/libpthread/thread/thr_clean.c +++ b/lib/libpthread/thread/thr_clean.c @@ -37,6 +37,11 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_cleanup_push); +LT10_COMPAT_DEFAULT(pthread_cleanup_push); +LT10_COMPAT_PRIVATE(_pthread_cleanup_pop); +LT10_COMPAT_DEFAULT(pthread_cleanup_pop); + __weak_reference(_pthread_cleanup_push, pthread_cleanup_push); __weak_reference(_pthread_cleanup_pop, pthread_cleanup_pop); diff --git a/lib/libpthread/thread/thr_close.c b/lib/libpthread/thread/thr_close.c index 263d4a6..7b4fe72 100644 --- a/lib/libpthread/thread/thr_close.c +++ b/lib/libpthread/thread/thr_close.c @@ -39,6 +39,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__close); +LT10_COMPAT_DEFAULT(close); + __weak_reference(__close, close); int diff --git a/lib/libpthread/thread/thr_concurrency.c b/lib/libpthread/thread/thr_concurrency.c index daea56c..74e0e11 100644 --- a/lib/libpthread/thread/thr_concurrency.c +++ b/lib/libpthread/thread/thr_concurrency.c @@ -33,6 +33,11 @@ #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_getconcurrency); +LT10_COMPAT_DEFAULT(pthread_getconcurrency); +LT10_COMPAT_PRIVATE(_pthread_setconcurrency); +LT10_COMPAT_DEFAULT(pthread_setconcurrency); + /*#define DEBUG_CONCURRENCY */ #ifdef DEBUG_CONCURRENCY #define DBG_MSG stdout_debug diff --git a/lib/libpthread/thread/thr_cond.c b/lib/libpthread/thread/thr_cond.c index a50a690..fc86378 100644 --- a/lib/libpthread/thread/thr_cond.c +++ b/lib/libpthread/thread/thr_cond.c @@ -37,6 +37,21 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__pthread_cond_wait); +LT10_COMPAT_PRIVATE(_pthread_cond_wait); +LT10_COMPAT_DEFAULT(pthread_cond_wait); +LT10_COMPAT_PRIVATE(__pthread_cond_timedwait); +LT10_COMPAT_PRIVATE(_pthread_cond_timedwait); +LT10_COMPAT_DEFAULT(pthread_cond_timedwait); +LT10_COMPAT_PRIVATE(_pthread_cond_init); +LT10_COMPAT_DEFAULT(pthread_cond_init); +LT10_COMPAT_PRIVATE(_pthread_cond_destroy); +LT10_COMPAT_DEFAULT(pthread_cond_destroy); +LT10_COMPAT_PRIVATE(_pthread_cond_signal); +LT10_COMPAT_DEFAULT(pthread_cond_signal); +LT10_COMPAT_PRIVATE(_pthread_cond_broadcast); +LT10_COMPAT_DEFAULT(pthread_cond_broadcast); + #define THR_IN_CONDQ(thr) (((thr)->sflags & THR_FLAGS_IN_SYNCQ) != 0) #define THR_CONDQ_SET(thr) (thr)->sflags |= THR_FLAGS_IN_SYNCQ #define THR_CONDQ_CLEAR(thr) (thr)->sflags &= ~THR_FLAGS_IN_SYNCQ diff --git a/lib/libpthread/thread/thr_condattr_destroy.c b/lib/libpthread/thread/thr_condattr_destroy.c index e0ade00..4e2c337 100644 --- a/lib/libpthread/thread/thr_condattr_destroy.c +++ b/lib/libpthread/thread/thr_condattr_destroy.c @@ -36,6 +36,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_condattr_destroy); +LT10_COMPAT_DEFAULT(pthread_condattr_destroy); + __weak_reference(_pthread_condattr_destroy, pthread_condattr_destroy); int diff --git a/lib/libpthread/thread/thr_condattr_init.c b/lib/libpthread/thread/thr_condattr_init.c index 7cf4c9e..e553839 100644 --- a/lib/libpthread/thread/thr_condattr_init.c +++ b/lib/libpthread/thread/thr_condattr_init.c @@ -37,6 +37,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_condattr_init); +LT10_COMPAT_DEFAULT(pthread_condattr_init); + __weak_reference(_pthread_condattr_init, pthread_condattr_init); int diff --git a/lib/libpthread/thread/thr_connect.c b/lib/libpthread/thread/thr_connect.c index 2d5614b..225d8b9 100644 --- a/lib/libpthread/thread/thr_connect.c +++ b/lib/libpthread/thread/thr_connect.c @@ -32,6 +32,9 @@ __FBSDID("$FreeBSD$"); #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__connect); +LT10_COMPAT_DEFAULT(connect); + __weak_reference(__connect, connect); int diff --git a/lib/libpthread/thread/thr_creat.c b/lib/libpthread/thread/thr_creat.c index d2a91bf..7528f0b 100644 --- a/lib/libpthread/thread/thr_creat.c +++ b/lib/libpthread/thread/thr_creat.c @@ -33,6 +33,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(___creat); +LT10_COMPAT_DEFAULT(creat); + extern int __creat(const char *, mode_t); __weak_reference(___creat, creat); diff --git a/lib/libpthread/thread/thr_create.c b/lib/libpthread/thread/thr_create.c index 08b2c47..98edb71 100644 --- a/lib/libpthread/thread/thr_create.c +++ b/lib/libpthread/thread/thr_create.c @@ -44,6 +44,9 @@ #include "thr_private.h" #include "libc_private.h" +LT10_COMPAT_PRIVATE(_pthread_create); +LT10_COMPAT_DEFAULT(pthread_create); + static void free_thread(struct pthread *curthread, struct pthread *thread); static int create_stack(struct pthread_attr *pattr); static void free_stack(struct pthread_attr *pattr); diff --git a/lib/libpthread/thread/thr_detach.c b/lib/libpthread/thread/thr_detach.c index 0159e53..2ae95df 100644 --- a/lib/libpthread/thread/thr_detach.c +++ b/lib/libpthread/thread/thr_detach.c @@ -37,6 +37,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_detach); +LT10_COMPAT_DEFAULT(pthread_detach); + __weak_reference(_pthread_detach, pthread_detach); int diff --git a/lib/libpthread/thread/thr_equal.c b/lib/libpthread/thread/thr_equal.c index f8882f5..95a3b65 100644 --- a/lib/libpthread/thread/thr_equal.c +++ b/lib/libpthread/thread/thr_equal.c @@ -34,6 +34,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_equal); +LT10_COMPAT_DEFAULT(pthread_equal); + __weak_reference(_pthread_equal, pthread_equal); int diff --git a/lib/libpthread/thread/thr_execve.c b/lib/libpthread/thread/thr_execve.c index ab1a9e98..b902981 100644 --- a/lib/libpthread/thread/thr_execve.c +++ b/lib/libpthread/thread/thr_execve.c @@ -34,6 +34,9 @@ #include <unistd.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_execve); +LT10_COMPAT_DEFAULT(execve); + __weak_reference(_execve, execve); int diff --git a/lib/libpthread/thread/thr_exit.c b/lib/libpthread/thread/thr_exit.c index 456b81d..1b2f84e 100644 --- a/lib/libpthread/thread/thr_exit.c +++ b/lib/libpthread/thread/thr_exit.c @@ -40,6 +40,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_exit); +LT10_COMPAT_DEFAULT(pthread_exit); + void _pthread_exit(void *status); __weak_reference(_pthread_exit, pthread_exit); diff --git a/lib/libpthread/thread/thr_fcntl.c b/lib/libpthread/thread/thr_fcntl.c index 947bc11..d59dfd7 100644 --- a/lib/libpthread/thread/thr_fcntl.c +++ b/lib/libpthread/thread/thr_fcntl.c @@ -38,6 +38,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__fcntl); +LT10_COMPAT_DEFAULT(fcntl); + __weak_reference(__fcntl, fcntl); int diff --git a/lib/libpthread/thread/thr_fork.c b/lib/libpthread/thread/thr_fork.c index 5445483..4dfa487 100644 --- a/lib/libpthread/thread/thr_fork.c +++ b/lib/libpthread/thread/thr_fork.c @@ -43,6 +43,9 @@ #include "libc_private.h" #include "thr_private.h" +LT10_COMPAT_PRIVATE(_fork); +LT10_COMPAT_DEFAULT(fork); + __weak_reference(_fork, fork); pid_t diff --git a/lib/libpthread/thread/thr_fsync.c b/lib/libpthread/thread/thr_fsync.c index 15fe31a..fc6360a 100644 --- a/lib/libpthread/thread/thr_fsync.c +++ b/lib/libpthread/thread/thr_fsync.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__fsync); +LT10_COMPAT_DEFAULT(fsync); + __weak_reference(__fsync, fsync); int diff --git a/lib/libpthread/thread/thr_getprio.c b/lib/libpthread/thread/thr_getprio.c index fa95ef9..07c1b0b 100644 --- a/lib/libpthread/thread/thr_getprio.c +++ b/lib/libpthread/thread/thr_getprio.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_getprio); +LT10_COMPAT_DEFAULT(pthread_getprio); + __weak_reference(_pthread_getprio, pthread_getprio); int diff --git a/lib/libpthread/thread/thr_getschedparam.c b/lib/libpthread/thread/thr_getschedparam.c index ad8486c..dca342f 100644 --- a/lib/libpthread/thread/thr_getschedparam.c +++ b/lib/libpthread/thread/thr_getschedparam.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_getschedparam); +LT10_COMPAT_DEFAULT(pthread_getschedparam); + __weak_reference(_pthread_getschedparam, pthread_getschedparam); int diff --git a/lib/libpthread/thread/thr_info.c b/lib/libpthread/thread/thr_info.c index 6081381..ab5320f 100644 --- a/lib/libpthread/thread/thr_info.c +++ b/lib/libpthread/thread/thr_info.c @@ -44,6 +44,9 @@ #define NELEMENTS(arr) (sizeof(arr) / sizeof(arr[0])) #endif +LT10_COMPAT_PRIVATE(_pthread_set_name_np); +LT10_COMPAT_DEFAULT(pthread_set_name_np); + static void dump_thread(int fd, pthread_t pthread, int long_version); __weak_reference(_pthread_set_name_np, pthread_set_name_np); diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c index ac04336..35c4ee3 100644 --- a/lib/libpthread/thread/thr_init.c +++ b/lib/libpthread/thread/thr_init.c @@ -69,6 +69,11 @@ #include "libc_private.h" #include "thr_private.h" +LT10_COMPAT_PRIVATE(_libkse_debug); +LT10_COMPAT_PRIVATE(_thread_activated); +LT10_COMPAT_PRIVATE(_thread_active_threads); +LT10_COMPAT_PRIVATE(_thread_list); + int __pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); int __pthread_mutex_lock(pthread_mutex_t *); int __pthread_mutex_trylock(pthread_mutex_t *); diff --git a/lib/libpthread/thread/thr_join.c b/lib/libpthread/thread/thr_join.c index 9f940da..1a3452e 100644 --- a/lib/libpthread/thread/thr_join.c +++ b/lib/libpthread/thread/thr_join.c @@ -35,6 +35,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_join); +LT10_COMPAT_DEFAULT(pthread_join); + __weak_reference(_pthread_join, pthread_join); int diff --git a/lib/libpthread/thread/thr_kill.c b/lib/libpthread/thread/thr_kill.c index 226cb86..a03ec38 100644 --- a/lib/libpthread/thread/thr_kill.c +++ b/lib/libpthread/thread/thr_kill.c @@ -36,6 +36,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_kill); +LT10_COMPAT_DEFAULT(pthread_kill); + __weak_reference(_pthread_kill, pthread_kill); int diff --git a/lib/libpthread/thread/thr_main_np.c b/lib/libpthread/thread/thr_main_np.c index 0dacd48..50fb9c8 100644 --- a/lib/libpthread/thread/thr_main_np.c +++ b/lib/libpthread/thread/thr_main_np.c @@ -31,6 +31,9 @@ #include <pthread_np.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_main_np); +LT10_COMPAT_DEFAULT(pthread_main_np); + __weak_reference(_pthread_main_np, pthread_main_np); /* diff --git a/lib/libpthread/thread/thr_mattr_init.c b/lib/libpthread/thread/thr_mattr_init.c index d5a7a18..b273bab 100644 --- a/lib/libpthread/thread/thr_mattr_init.c +++ b/lib/libpthread/thread/thr_mattr_init.c @@ -37,6 +37,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_mutexattr_init); +LT10_COMPAT_DEFAULT(pthread_mutexattr_init); + __weak_reference(_pthread_mutexattr_init, pthread_mutexattr_init); int diff --git a/lib/libpthread/thread/thr_mattr_kind_np.c b/lib/libpthread/thread/thr_mattr_kind_np.c index 2e9f333..12cd775 100644 --- a/lib/libpthread/thread/thr_mattr_kind_np.c +++ b/lib/libpthread/thread/thr_mattr_kind_np.c @@ -35,6 +35,15 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_mutexattr_setkind_np); +LT10_COMPAT_DEFAULT(pthread_mutexattr_setkind_np); +LT10_COMPAT_PRIVATE(_pthread_mutexattr_getkind_np); +LT10_COMPAT_DEFAULT(pthread_mutexattr_getkind_np); +LT10_COMPAT_PRIVATE(_pthread_mutexattr_gettype); +LT10_COMPAT_DEFAULT(pthread_mutexattr_gettype); +LT10_COMPAT_PRIVATE(_pthread_mutexattr_settype); +LT10_COMPAT_DEFAULT(pthread_mutexattr_settype); + __weak_reference(_pthread_mutexattr_setkind_np, pthread_mutexattr_setkind_np); __weak_reference(_pthread_mutexattr_getkind_np, pthread_mutexattr_getkind_np); __weak_reference(_pthread_mutexattr_gettype, pthread_mutexattr_gettype); diff --git a/lib/libpthread/thread/thr_msync.c b/lib/libpthread/thread/thr_msync.c index c2e3433..66e88c5 100644 --- a/lib/libpthread/thread/thr_msync.c +++ b/lib/libpthread/thread/thr_msync.c @@ -11,6 +11,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__msync); +LT10_COMPAT_DEFAULT(msync); + __weak_reference(__msync, msync); int diff --git a/lib/libpthread/thread/thr_multi_np.c b/lib/libpthread/thread/thr_multi_np.c index bd42365..54ce22c 100644 --- a/lib/libpthread/thread/thr_multi_np.c +++ b/lib/libpthread/thread/thr_multi_np.c @@ -34,6 +34,11 @@ #include <pthread.h> #include <pthread_np.h> +#include "thr_private.h" + +LT10_COMPAT_PRIVATE(_pthread_multi_np); +LT10_COMPAT_DEFAULT(pthread_multi_np); + __weak_reference(_pthread_multi_np, pthread_multi_np); int diff --git a/lib/libpthread/thread/thr_mutex.c b/lib/libpthread/thread/thr_mutex.c index 0f56069..39e36ff 100644 --- a/lib/libpthread/thread/thr_mutex.c +++ b/lib/libpthread/thread/thr_mutex.c @@ -91,6 +91,23 @@ static struct pthread_mutex_attr static_mutex_attr = PTHREAD_MUTEXATTR_STATIC_INITIALIZER; static pthread_mutexattr_t static_mattr = &static_mutex_attr; +LT10_COMPAT_PRIVATE(__pthread_mutex_init); +LT10_COMPAT_PRIVATE(_pthread_mutex_init); +LT10_COMPAT_DEFAULT(pthread_mutex_init); +LT10_COMPAT_PRIVATE(__pthread_mutex_lock); +LT10_COMPAT_PRIVATE(_pthread_mutex_lock); +LT10_COMPAT_DEFAULT(pthread_mutex_lock); +LT10_COMPAT_PRIVATE(__pthread_mutex_timedlock); +LT10_COMPAT_PRIVATE(_pthread_mutex_timedlock); +LT10_COMPAT_DEFAULT(pthread_mutex_timedlock); +LT10_COMPAT_PRIVATE(__pthread_mutex_trylock); +LT10_COMPAT_PRIVATE(_pthread_mutex_trylock); +LT10_COMPAT_DEFAULT(pthread_mutex_trylock); +LT10_COMPAT_PRIVATE(_pthread_mutex_destroy); +LT10_COMPAT_DEFAULT(pthread_mutex_destroy); +LT10_COMPAT_PRIVATE(_pthread_mutex_unlock); +LT10_COMPAT_DEFAULT(pthread_mutex_unlock); + /* Single underscore versions provided for libc internal usage: */ __weak_reference(__pthread_mutex_init, pthread_mutex_init); __weak_reference(__pthread_mutex_lock, pthread_mutex_lock); diff --git a/lib/libpthread/thread/thr_mutex_prioceiling.c b/lib/libpthread/thread/thr_mutex_prioceiling.c index c65270a..f254346 100644 --- a/lib/libpthread/thread/thr_mutex_prioceiling.c +++ b/lib/libpthread/thread/thr_mutex_prioceiling.c @@ -37,6 +37,15 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_mutexattr_getprioceiling); +LT10_COMPAT_DEFAULT(pthread_mutexattr_getprioceiling); +LT10_COMPAT_PRIVATE(_pthread_mutexattr_setprioceiling); +LT10_COMPAT_DEFAULT(pthread_mutexattr_setprioceiling); +LT10_COMPAT_PRIVATE(_pthread_mutex_getprioceiling); +LT10_COMPAT_DEFAULT(pthread_mutex_getprioceiling); +LT10_COMPAT_PRIVATE(_pthread_mutex_setprioceiling); +LT10_COMPAT_DEFAULT(pthread_mutex_setprioceiling); + __weak_reference(_pthread_mutexattr_getprioceiling, pthread_mutexattr_getprioceiling); __weak_reference(_pthread_mutexattr_setprioceiling, pthread_mutexattr_setprioceiling); __weak_reference(_pthread_mutex_getprioceiling, pthread_mutex_getprioceiling); diff --git a/lib/libpthread/thread/thr_mutex_protocol.c b/lib/libpthread/thread/thr_mutex_protocol.c index 9f0f262..9e3e46b 100644 --- a/lib/libpthread/thread/thr_mutex_protocol.c +++ b/lib/libpthread/thread/thr_mutex_protocol.c @@ -37,6 +37,11 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_mutexattr_getprotocol); +LT10_COMPAT_DEFAULT(pthread_mutexattr_getprotocol); +LT10_COMPAT_PRIVATE(_pthread_mutexattr_setprotocol); +LT10_COMPAT_DEFAULT(pthread_mutexattr_setprotocol); + __weak_reference(_pthread_mutexattr_getprotocol, pthread_mutexattr_getprotocol); __weak_reference(_pthread_mutexattr_setprotocol, pthread_mutexattr_setprotocol); diff --git a/lib/libpthread/thread/thr_mutexattr_destroy.c b/lib/libpthread/thread/thr_mutexattr_destroy.c index b9852b5..2ae34a8 100644 --- a/lib/libpthread/thread/thr_mutexattr_destroy.c +++ b/lib/libpthread/thread/thr_mutexattr_destroy.c @@ -36,6 +36,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_mutexattr_destroy); +LT10_COMPAT_DEFAULT(pthread_mutexattr_destroy); + __weak_reference(_pthread_mutexattr_destroy, pthread_mutexattr_destroy); int diff --git a/lib/libpthread/thread/thr_nanosleep.c b/lib/libpthread/thread/thr_nanosleep.c index 5eba37d..72f85b2 100644 --- a/lib/libpthread/thread/thr_nanosleep.c +++ b/lib/libpthread/thread/thr_nanosleep.c @@ -36,6 +36,10 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__nanosleep); +LT10_COMPAT_PRIVATE(_nanosleep); +LT10_COMPAT_DEFAULT(nanosleep); + __weak_reference(__nanosleep, nanosleep); int diff --git a/lib/libpthread/thread/thr_once.c b/lib/libpthread/thread/thr_once.c index 40344bd..f93800f 100644 --- a/lib/libpthread/thread/thr_once.c +++ b/lib/libpthread/thread/thr_once.c @@ -36,6 +36,9 @@ #include "un-namespace.h" #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_once); +LT10_COMPAT_DEFAULT(pthread_once); + __weak_reference(_pthread_once, pthread_once); #define ONCE_NEVER_DONE PTHREAD_NEEDS_INIT diff --git a/lib/libpthread/thread/thr_open.c b/lib/libpthread/thread/thr_open.c index 8ac625d..63b5f4a 100644 --- a/lib/libpthread/thread/thr_open.c +++ b/lib/libpthread/thread/thr_open.c @@ -40,6 +40,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__open); +LT10_COMPAT_DEFAULT(open); + __weak_reference(__open, open); int diff --git a/lib/libpthread/thread/thr_pause.c b/lib/libpthread/thread/thr_pause.c index 391b5a0..b3f0fe5 100644 --- a/lib/libpthread/thread/thr_pause.c +++ b/lib/libpthread/thread/thr_pause.c @@ -35,6 +35,9 @@ extern int __pause(void); +LT10_COMPAT_PRIVATE(_pause); +LT10_COMPAT_DEFAULT(pause); + __weak_reference(_pause, pause); int diff --git a/lib/libpthread/thread/thr_poll.c b/lib/libpthread/thread/thr_poll.c index 1b16598..5e3890b 100644 --- a/lib/libpthread/thread/thr_poll.c +++ b/lib/libpthread/thread/thr_poll.c @@ -41,6 +41,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__poll); +LT10_COMPAT_DEFAULT(poll); + __weak_reference(__poll, poll); int diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h index 9d8ee63..9d58078 100644 --- a/lib/libpthread/thread/thr_private.h +++ b/lib/libpthread/thread/thr_private.h @@ -60,6 +60,40 @@ #endif /* + * Unfortunately, libpthread had symbol versioning before libc. + * But now libc has symbol versioning, we need to occupy the + * same version namespace in order to override some libc functions. + * So in order to avoid breaking binaries requiring symbols from + * LIBTHREAD_1_0, we need to provide a compatible interface for + * those symbols. + */ +#if defined(SYMBOL_VERSIONING) && defined(PIC) +#define SYM_LT10(sym) __CONCAT(sym, _lt10) +#define SYM_FB10(sym) __CONCAT(sym, _fb10) +#define SYM_FBP10(sym) __CONCAT(sym, _fbp10) +#define WEAK_REF(sym, alias) __weak_reference(sym, alias) +#define SYM_COMPAT(sym, impl, ver) __sym_compat(sym, impl, ver) +#define SYM_DEFAULT(sym, impl, ver) __sym_default(sym, impl, ver) + +#define LT10_COMPAT(sym) \ + WEAK_REF(sym, SYM_LT10(sym)); \ + SYM_COMPAT(sym, SYM_LT10(sym), LIBTHREAD_1_0) + +#define LT10_COMPAT_DEFAULT(sym) \ + LT10_COMPAT(sym); \ + WEAK_REF(sym, SYM_FB10(sym)); \ + SYM_DEFAULT(sym, SYM_FB10(sym), FBSD_1.0) + +#define LT10_COMPAT_PRIVATE(sym) \ + LT10_COMPAT(sym); \ + WEAK_REF(sym, SYM_FBP10(sym)); \ + SYM_DEFAULT(sym, SYM_FBP10(sym), FBSDprivate) +#else +#define LT10_COMPAT_DEFAULT(sym) +#define LT10_COMPAT_PRIVATE(sym) +#endif + +/* * Evaluate the storage class specifier. */ #ifdef GLOBAL_PTHREAD_PRIVATE diff --git a/lib/libpthread/thread/thr_pselect.c b/lib/libpthread/thread/thr_pselect.c index ce7a530..a0e9410 100644 --- a/lib/libpthread/thread/thr_pselect.c +++ b/lib/libpthread/thread/thr_pselect.c @@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$"); extern int __pselect(int count, fd_set *rfds, fd_set *wfds, fd_set *efds, const struct timespec *timo, const sigset_t *mask); +LT10_COMPAT_PRIVATE(_pselect); +LT10_COMPAT_DEFAULT(pselect); + __weak_reference(_pselect, pselect); int diff --git a/lib/libpthread/thread/thr_pspinlock.c b/lib/libpthread/thread/thr_pspinlock.c index de555bf..5836fde 100644 --- a/lib/libpthread/thread/thr_pspinlock.c +++ b/lib/libpthread/thread/thr_pspinlock.c @@ -37,6 +37,17 @@ #define SPIN_COUNT 10000 +LT10_COMPAT_PRIVATE(_pthread_spin_init); +LT10_COMPAT_DEFAULT(pthread_spin_init); +LT10_COMPAT_PRIVATE(_pthread_spin_destroy); +LT10_COMPAT_DEFAULT(pthread_spin_destroy); +LT10_COMPAT_PRIVATE(_pthread_spin_trylock); +LT10_COMPAT_DEFAULT(pthread_spin_trylock); +LT10_COMPAT_PRIVATE(_pthread_spin_lock); +LT10_COMPAT_DEFAULT(pthread_spin_lock); +LT10_COMPAT_PRIVATE(_pthread_spin_unlock); +LT10_COMPAT_DEFAULT(pthread_spin_unlock); + __weak_reference(_pthread_spin_init, pthread_spin_init); __weak_reference(_pthread_spin_destroy, pthread_spin_destroy); __weak_reference(_pthread_spin_trylock, pthread_spin_trylock); diff --git a/lib/libpthread/thread/thr_raise.c b/lib/libpthread/thread/thr_raise.c index 0554fa4..ad4aa39 100644 --- a/lib/libpthread/thread/thr_raise.c +++ b/lib/libpthread/thread/thr_raise.c @@ -33,6 +33,9 @@ #include <errno.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_raise); +LT10_COMPAT_DEFAULT(raise); + __weak_reference(_raise, raise); int diff --git a/lib/libpthread/thread/thr_read.c b/lib/libpthread/thread/thr_read.c index c0391c5..dc29d1b 100644 --- a/lib/libpthread/thread/thr_read.c +++ b/lib/libpthread/thread/thr_read.c @@ -40,6 +40,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__read); +LT10_COMPAT_DEFAULT(read); + __weak_reference(__read, read); ssize_t diff --git a/lib/libpthread/thread/thr_readv.c b/lib/libpthread/thread/thr_readv.c index eb0e54a..c2d9360 100644 --- a/lib/libpthread/thread/thr_readv.c +++ b/lib/libpthread/thread/thr_readv.c @@ -40,6 +40,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__readv); +LT10_COMPAT_DEFAULT(readv); + __weak_reference(__readv, readv); ssize_t diff --git a/lib/libpthread/thread/thr_resume_np.c b/lib/libpthread/thread/thr_resume_np.c index ba9b911..70c5f17 100644 --- a/lib/libpthread/thread/thr_resume_np.c +++ b/lib/libpthread/thread/thr_resume_np.c @@ -37,6 +37,11 @@ static struct kse_mailbox *resume_common(struct pthread *); +LT10_COMPAT_PRIVATE(_pthread_resume_np); +LT10_COMPAT_DEFAULT(pthread_resume_np); +LT10_COMPAT_PRIVATE(_pthread_resume_all_np); +LT10_COMPAT_DEFAULT(pthread_resume_all_np); + __weak_reference(_pthread_resume_np, pthread_resume_np); __weak_reference(_pthread_resume_all_np, pthread_resume_all_np); diff --git a/lib/libpthread/thread/thr_rwlock.c b/lib/libpthread/thread/thr_rwlock.c index ca8a081..a0b36de 100644 --- a/lib/libpthread/thread/thr_rwlock.c +++ b/lib/libpthread/thread/thr_rwlock.c @@ -38,6 +38,25 @@ /* maximum number of times a read lock may be obtained */ #define MAX_READ_LOCKS (INT_MAX - 1) +LT10_COMPAT_PRIVATE(_pthread_rwlock_destroy); +LT10_COMPAT_DEFAULT(pthread_rwlock_destroy); +LT10_COMPAT_PRIVATE(_pthread_rwlock_init); +LT10_COMPAT_DEFAULT(pthread_rwlock_init); +LT10_COMPAT_PRIVATE(_pthread_rwlock_rdlock); +LT10_COMPAT_DEFAULT(pthread_rwlock_rdlock); +LT10_COMPAT_PRIVATE(_pthread_rwlock_timedrdlock); +LT10_COMPAT_DEFAULT(pthread_rwlock_timedrdlock); +LT10_COMPAT_PRIVATE(_pthread_rwlock_tryrdlock); +LT10_COMPAT_DEFAULT(pthread_rwlock_tryrdlock); +LT10_COMPAT_PRIVATE(_pthread_rwlock_trywrlock); +LT10_COMPAT_DEFAULT(pthread_rwlock_trywrlock); +LT10_COMPAT_PRIVATE(_pthread_rwlock_unlock); +LT10_COMPAT_DEFAULT(pthread_rwlock_unlock); +LT10_COMPAT_PRIVATE(_pthread_rwlock_wrlock); +LT10_COMPAT_DEFAULT(pthread_rwlock_wrlock); +LT10_COMPAT_PRIVATE(_pthread_rwlock_timedwrlock); +LT10_COMPAT_DEFAULT(pthread_rwlock_timedwrlock); + __weak_reference(_pthread_rwlock_destroy, pthread_rwlock_destroy); __weak_reference(_pthread_rwlock_init, pthread_rwlock_init); __weak_reference(_pthread_rwlock_rdlock, pthread_rwlock_rdlock); diff --git a/lib/libpthread/thread/thr_rwlockattr.c b/lib/libpthread/thread/thr_rwlockattr.c index 8c0697b..174b28f 100644 --- a/lib/libpthread/thread/thr_rwlockattr.c +++ b/lib/libpthread/thread/thr_rwlockattr.c @@ -32,6 +32,15 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_rwlockattr_destroy); +LT10_COMPAT_DEFAULT(pthread_rwlockattr_destroy); +LT10_COMPAT_PRIVATE(_pthread_rwlockattr_getpshared); +LT10_COMPAT_DEFAULT(pthread_rwlockattr_getpshared); +LT10_COMPAT_PRIVATE(_pthread_rwlockattr_init); +LT10_COMPAT_DEFAULT(pthread_rwlockattr_init); +LT10_COMPAT_PRIVATE(_pthread_rwlockattr_setpshared); +LT10_COMPAT_DEFAULT(pthread_rwlockattr_setpshared); + __weak_reference(_pthread_rwlockattr_destroy, pthread_rwlockattr_destroy); __weak_reference(_pthread_rwlockattr_getpshared, pthread_rwlockattr_getpshared); __weak_reference(_pthread_rwlockattr_init, pthread_rwlockattr_init); diff --git a/lib/libpthread/thread/thr_select.c b/lib/libpthread/thread/thr_select.c index 792ff09..97bcc37 100644 --- a/lib/libpthread/thread/thr_select.c +++ b/lib/libpthread/thread/thr_select.c @@ -43,6 +43,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__select); +LT10_COMPAT_DEFAULT(select); + __weak_reference(__select, select); int diff --git a/lib/libpthread/thread/thr_self.c b/lib/libpthread/thread/thr_self.c index 0c702a6..28ac613 100644 --- a/lib/libpthread/thread/thr_self.c +++ b/lib/libpthread/thread/thr_self.c @@ -34,6 +34,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_self); +LT10_COMPAT_DEFAULT(pthread_self); + __weak_reference(_pthread_self, pthread_self); pthread_t diff --git a/lib/libpthread/thread/thr_sem.c b/lib/libpthread/thread/thr_sem.c index 8312a87..1a01805 100644 --- a/lib/libpthread/thread/thr_sem.c +++ b/lib/libpthread/thread/thr_sem.c @@ -43,6 +43,14 @@ #include "libc_private.h" #include "thr_private.h" +LT10_COMPAT_PRIVATE(_sem_init); +LT10_COMPAT_DEFAULT(sem_init); +LT10_COMPAT_PRIVATE(_sem_wait); +LT10_COMPAT_DEFAULT(sem_wait); +LT10_COMPAT_PRIVATE(_sem_timedwait); +LT10_COMPAT_DEFAULT(sem_timedwait); +LT10_COMPAT_PRIVATE(_sem_post); +LT10_COMPAT_DEFAULT(sem_post); extern int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); extern int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *, diff --git a/lib/libpthread/thread/thr_setprio.c b/lib/libpthread/thread/thr_setprio.c index c5a9506..3b7796a 100644 --- a/lib/libpthread/thread/thr_setprio.c +++ b/lib/libpthread/thread/thr_setprio.c @@ -34,6 +34,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_setprio); +LT10_COMPAT_DEFAULT(pthread_setprio); + __weak_reference(_pthread_setprio, pthread_setprio); int diff --git a/lib/libpthread/thread/thr_setschedparam.c b/lib/libpthread/thread/thr_setschedparam.c index 63cd073..8f5154c 100644 --- a/lib/libpthread/thread/thr_setschedparam.c +++ b/lib/libpthread/thread/thr_setschedparam.c @@ -36,6 +36,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_setschedparam); +LT10_COMPAT_DEFAULT(pthread_setschedparam); + __weak_reference(_pthread_setschedparam, pthread_setschedparam); int diff --git a/lib/libpthread/thread/thr_sigaction.c b/lib/libpthread/thread/thr_sigaction.c index 694f37e..7ee0ce6 100644 --- a/lib/libpthread/thread/thr_sigaction.c +++ b/lib/libpthread/thread/thr_sigaction.c @@ -36,6 +36,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_sigaction); +LT10_COMPAT_DEFAULT(sigaction); + __weak_reference(_sigaction, sigaction); int diff --git a/lib/libpthread/thread/thr_sigaltstack.c b/lib/libpthread/thread/thr_sigaltstack.c index 3153ebd..8ebbdee 100644 --- a/lib/libpthread/thread/thr_sigaltstack.c +++ b/lib/libpthread/thread/thr_sigaltstack.c @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include <signal.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_sigaltstack); +LT10_COMPAT_DEFAULT(sigaltstack); + __weak_reference(_sigaltstack, sigaltstack); int diff --git a/lib/libpthread/thread/thr_sigmask.c b/lib/libpthread/thread/thr_sigmask.c index 70463a5..05f5ae1 100644 --- a/lib/libpthread/thread/thr_sigmask.c +++ b/lib/libpthread/thread/thr_sigmask.c @@ -40,6 +40,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_sigmask); +LT10_COMPAT_DEFAULT(pthread_sigmask); + __weak_reference(_pthread_sigmask, pthread_sigmask); int diff --git a/lib/libpthread/thread/thr_sigpending.c b/lib/libpthread/thread/thr_sigpending.c index 7a0a76d..5c666bf 100644 --- a/lib/libpthread/thread/thr_sigpending.c +++ b/lib/libpthread/thread/thr_sigpending.c @@ -39,6 +39,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_sigpending); +LT10_COMPAT_DEFAULT(sigpending); + __weak_reference(_sigpending, sigpending); int diff --git a/lib/libpthread/thread/thr_sigprocmask.c b/lib/libpthread/thread/thr_sigprocmask.c index d87df58..d2a20dd 100644 --- a/lib/libpthread/thread/thr_sigprocmask.c +++ b/lib/libpthread/thread/thr_sigprocmask.c @@ -39,6 +39,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_sigprocmask); +LT10_COMPAT_DEFAULT(sigprocmask); + __weak_reference(_sigprocmask, sigprocmask); int diff --git a/lib/libpthread/thread/thr_sigsuspend.c b/lib/libpthread/thread/thr_sigsuspend.c index 6452af1..2f3ed5d 100644 --- a/lib/libpthread/thread/thr_sigsuspend.c +++ b/lib/libpthread/thread/thr_sigsuspend.c @@ -41,6 +41,10 @@ #include "thr_private.h" +LT10_COMPAT_PRIVATE(__sigsuspend); +LT10_COMPAT_PRIVATE(_sigsuspend); +LT10_COMPAT_DEFAULT(sigsuspend); + __weak_reference(__sigsuspend, sigsuspend); int diff --git a/lib/libpthread/thread/thr_sigwait.c b/lib/libpthread/thread/thr_sigwait.c index 6f60653..cd7ac22 100644 --- a/lib/libpthread/thread/thr_sigwait.c +++ b/lib/libpthread/thread/thr_sigwait.c @@ -39,6 +39,16 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__sigwait); +LT10_COMPAT_PRIVATE(_sigwait); +LT10_COMPAT_DEFAULT(sigwait); +LT10_COMPAT_PRIVATE(__sigtimedwait); +LT10_COMPAT_PRIVATE(_sigtimedwait); +LT10_COMPAT_DEFAULT(sigtimedwait); +LT10_COMPAT_PRIVATE(__sigwaitinfo); +LT10_COMPAT_PRIVATE(_sigwaitinfo); +LT10_COMPAT_DEFAULT(sigwaitinfo); + __weak_reference(__sigwait, sigwait); __weak_reference(__sigtimedwait, sigtimedwait); __weak_reference(__sigwaitinfo, sigwaitinfo); diff --git a/lib/libpthread/thread/thr_single_np.c b/lib/libpthread/thread/thr_single_np.c index 1ee5e79..882f6aa 100644 --- a/lib/libpthread/thread/thr_single_np.c +++ b/lib/libpthread/thread/thr_single_np.c @@ -34,6 +34,11 @@ #include <pthread.h> #include <pthread_np.h> +#include "thr_private.h" + +LT10_COMPAT_PRIVATE(_pthread_single_np); +LT10_COMPAT_DEFAULT(pthread_single_np); + __weak_reference(_pthread_single_np, pthread_single_np); int _pthread_single_np() diff --git a/lib/libpthread/thread/thr_sleep.c b/lib/libpthread/thread/thr_sleep.c index 682c764..0a11876 100644 --- a/lib/libpthread/thread/thr_sleep.c +++ b/lib/libpthread/thread/thr_sleep.c @@ -36,6 +36,11 @@ extern unsigned int __sleep(unsigned int); extern int __usleep(useconds_t); +LT10_COMPAT_PRIVATE(_sleep); +LT10_COMPAT_DEFAULT(sleep); +LT10_COMPAT_PRIVATE(_usleep); +LT10_COMPAT_DEFAULT(usleep); + __weak_reference(_sleep, sleep); __weak_reference(_usleep, usleep); diff --git a/lib/libpthread/thread/thr_spec.c b/lib/libpthread/thread/thr_spec.c index 6c2b636..f6e8861 100644 --- a/lib/libpthread/thread/thr_spec.c +++ b/lib/libpthread/thread/thr_spec.c @@ -36,11 +36,27 @@ #include <string.h> #include <errno.h> #include <pthread.h> + #include "thr_private.h" -/* Static variables: */ + struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; +/* + * XXX - This breaks the linker if LT10_COMPAT_DEFAULT doesn't + * also include a weak reference to the default symbol. + */ +LT10_COMPAT_PRIVATE(_thread_keytable); + +LT10_COMPAT_PRIVATE(_pthread_key_create); +LT10_COMPAT_DEFAULT(pthread_key_create); +LT10_COMPAT_PRIVATE(_pthread_key_delete); +LT10_COMPAT_DEFAULT(pthread_key_delete); +LT10_COMPAT_PRIVATE(_pthread_getspecific); +LT10_COMPAT_DEFAULT(pthread_getspecific); +LT10_COMPAT_PRIVATE(_pthread_setspecific); +LT10_COMPAT_DEFAULT(pthread_setspecific); + __weak_reference(_pthread_key_create, pthread_key_create); __weak_reference(_pthread_key_delete, pthread_key_delete); __weak_reference(_pthread_getspecific, pthread_getspecific); diff --git a/lib/libpthread/thread/thr_spinlock.c b/lib/libpthread/thread/thr_spinlock.c index 823c148..d187439 100644 --- a/lib/libpthread/thread/thr_spinlock.c +++ b/lib/libpthread/thread/thr_spinlock.c @@ -58,6 +58,10 @@ static struct spinlock_extra extra[MAX_SPINLOCKS]; static int spinlock_count = 0; static int initialized = 0; +LT10_COMPAT_PRIVATE(_spinlock); +LT10_COMPAT_PRIVATE(_spinlock_debug); +LT10_COMPAT_PRIVATE(_spinunlock); + /* * These are for compatability only. Spinlocks of this type * are deprecated. diff --git a/lib/libpthread/thread/thr_suspend_np.c b/lib/libpthread/thread/thr_suspend_np.c index 4813de1..16c129c 100644 --- a/lib/libpthread/thread/thr_suspend_np.c +++ b/lib/libpthread/thread/thr_suspend_np.c @@ -37,6 +37,11 @@ static void suspend_common(struct pthread *thread); +LT10_COMPAT_PRIVATE(_pthread_suspend_np); +LT10_COMPAT_DEFAULT(pthread_suspend_np); +LT10_COMPAT_PRIVATE(_pthread_suspend_all_np); +LT10_COMPAT_DEFAULT(pthread_suspend_all_np); + __weak_reference(_pthread_suspend_np, pthread_suspend_np); __weak_reference(_pthread_suspend_all_np, pthread_suspend_all_np); diff --git a/lib/libpthread/thread/thr_switch_np.c b/lib/libpthread/thread/thr_switch_np.c index b70ce70..247b879 100644 --- a/lib/libpthread/thread/thr_switch_np.c +++ b/lib/libpthread/thread/thr_switch_np.c @@ -36,6 +36,10 @@ #include <pthread_np.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_pthread_switch_add_np); +LT10_COMPAT_DEFAULT(pthread_switch_add_np); +LT10_COMPAT_PRIVATE(_pthread_switch_delete_np); +LT10_COMPAT_DEFAULT(pthread_switch_delete_np); __weak_reference(_pthread_switch_add_np, pthread_switch_add_np); __weak_reference(_pthread_switch_delete_np, pthread_switch_delete_np); diff --git a/lib/libpthread/thread/thr_symbols.c b/lib/libpthread/thread/thr_symbols.c index 10e9402..2072c96 100644 --- a/lib/libpthread/thread/thr_symbols.c +++ b/lib/libpthread/thread/thr_symbols.c @@ -39,6 +39,24 @@ #include "thr_private.h" +LT10_COMPAT_PRIVATE(_thread_off_tcb); +LT10_COMPAT_PRIVATE(_thread_off_tmbx); +LT10_COMPAT_PRIVATE(_thread_off_next); +LT10_COMPAT_PRIVATE(_thread_off_attr_flags); +LT10_COMPAT_PRIVATE(_thread_off_kse); +LT10_COMPAT_PRIVATE(_thread_off_kse_locklevel); +LT10_COMPAT_PRIVATE(_thread_off_thr_locklevel); +LT10_COMPAT_PRIVATE(_thread_off_linkmap); +LT10_COMPAT_PRIVATE(_thread_off_tlsindex); +LT10_COMPAT_PRIVATE(_thread_size_key); +LT10_COMPAT_PRIVATE(_thread_off_key_allocated); +LT10_COMPAT_PRIVATE(_thread_off_key_destructor); +LT10_COMPAT_PRIVATE(_thread_max_keys); +LT10_COMPAT_PRIVATE(_thread_off_dtv); +LT10_COMPAT_PRIVATE(_thread_off_state); +LT10_COMPAT_PRIVATE(_thread_state_running); +LT10_COMPAT_PRIVATE(_thread_state_zoombie); + /* A collection of symbols needed by debugger */ /* int _libkse_debug */ diff --git a/lib/libpthread/thread/thr_system.c b/lib/libpthread/thread/thr_system.c index 57c2199..5e4fe1c 100644 --- a/lib/libpthread/thread/thr_system.c +++ b/lib/libpthread/thread/thr_system.c @@ -35,6 +35,9 @@ extern int __system(const char *); +LT10_COMPAT_PRIVATE(_system); +LT10_COMPAT_DEFAULT(system); + __weak_reference(_system, system); int diff --git a/lib/libpthread/thread/thr_tcdrain.c b/lib/libpthread/thread/thr_tcdrain.c index d0d701b..e231d52 100644 --- a/lib/libpthread/thread/thr_tcdrain.c +++ b/lib/libpthread/thread/thr_tcdrain.c @@ -35,6 +35,9 @@ extern int __tcdrain(int); +LT10_COMPAT_PRIVATE(_tcdrain); +LT10_COMPAT_DEFAULT(tcdrain); + __weak_reference(_tcdrain, tcdrain); int diff --git a/lib/libpthread/thread/thr_vfork.c b/lib/libpthread/thread/thr_vfork.c index dbefc65..428c129 100644 --- a/lib/libpthread/thread/thr_vfork.c +++ b/lib/libpthread/thread/thr_vfork.c @@ -3,6 +3,11 @@ */ #include <unistd.h> +#include "thr_private.h" + +LT10_COMPAT_PRIVATE(_vfork); +LT10_COMPAT_DEFAULT(vfork); + __weak_reference(_vfork, vfork); int diff --git a/lib/libpthread/thread/thr_wait.c b/lib/libpthread/thread/thr_wait.c index 689f683..8f61a0c 100644 --- a/lib/libpthread/thread/thr_wait.c +++ b/lib/libpthread/thread/thr_wait.c @@ -34,6 +34,9 @@ extern int __wait(int *); +LT10_COMPAT_PRIVATE(_wait); +LT10_COMPAT_DEFAULT(wait); + __weak_reference(_wait, wait); pid_t diff --git a/lib/libpthread/thread/thr_wait4.c b/lib/libpthread/thread/thr_wait4.c index 12a1067..fae0fed 100644 --- a/lib/libpthread/thread/thr_wait4.c +++ b/lib/libpthread/thread/thr_wait4.c @@ -41,6 +41,9 @@ #include "thr_private.h" +LT10_COMPAT_PRIVATE(__wait4); +LT10_COMPAT_DEFAULT(wait4); + __weak_reference(__wait4, wait4); pid_t diff --git a/lib/libpthread/thread/thr_waitpid.c b/lib/libpthread/thread/thr_waitpid.c index 4edef3b..1244c12 100644 --- a/lib/libpthread/thread/thr_waitpid.c +++ b/lib/libpthread/thread/thr_waitpid.c @@ -34,6 +34,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_waitpid); +LT10_COMPAT_DEFAULT(waitpid); + extern int __waitpid(pid_t, int *, int); __weak_reference(_waitpid, waitpid); diff --git a/lib/libpthread/thread/thr_write.c b/lib/libpthread/thread/thr_write.c index 39d221c..00ad990 100644 --- a/lib/libpthread/thread/thr_write.c +++ b/lib/libpthread/thread/thr_write.c @@ -40,6 +40,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__write); +LT10_COMPAT_DEFAULT(write); + __weak_reference(__write, write); ssize_t diff --git a/lib/libpthread/thread/thr_writev.c b/lib/libpthread/thread/thr_writev.c index 81499d7..a05159f 100644 --- a/lib/libpthread/thread/thr_writev.c +++ b/lib/libpthread/thread/thr_writev.c @@ -42,6 +42,9 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(__writev); +LT10_COMPAT_DEFAULT(writev); + __weak_reference(__writev, writev); ssize_t diff --git a/lib/libpthread/thread/thr_yield.c b/lib/libpthread/thread/thr_yield.c index 5c24113..6ba77f8 100644 --- a/lib/libpthread/thread/thr_yield.c +++ b/lib/libpthread/thread/thr_yield.c @@ -34,6 +34,11 @@ #include <pthread.h> #include "thr_private.h" +LT10_COMPAT_PRIVATE(_sched_yield); +LT10_COMPAT_DEFAULT(sched_yield); +LT10_COMPAT_PRIVATE(_pthread_yield); +LT10_COMPAT_DEFAULT(pthread_yield); + __weak_reference(_sched_yield, sched_yield); __weak_reference(_pthread_yield, pthread_yield); |