diff options
author | Khem Raj <raj.khem@gmail.com> | 2010-02-17 14:28:38 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2010-02-17 14:28:38 -0800 |
commit | 94f3c30dc2d8193f977daf04414b1edd815ced83 (patch) | |
tree | 830538d15828aa76991332aae8aa3a894ffa1c5b /libpthread/nptl/sysdeps/pthread | |
parent | 5e6d4834e6b35c6b0017fcdaf246c505dec10452 (diff) |
Assorted fixed to get nptl compiling on ARM
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'libpthread/nptl/sysdeps/pthread')
-rw-r--r-- | libpthread/nptl/sysdeps/pthread/Makefile.in | 2 | ||||
-rw-r--r-- | libpthread/nptl/sysdeps/pthread/bits/libc-lock.h | 8 | ||||
-rw-r--r-- | libpthread/nptl/sysdeps/pthread/tpp.c | 2 | ||||
-rw-r--r-- | libpthread/nptl/sysdeps/pthread/uClibc-glue.h | 47 | ||||
-rw-r--r-- | libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c | 4 | ||||
-rw-r--r-- | libpthread/nptl/sysdeps/pthread/unwind-resume.c | 4 |
6 files changed, 63 insertions, 4 deletions
diff --git a/libpthread/nptl/sysdeps/pthread/Makefile.in b/libpthread/nptl/sysdeps/pthread/Makefile.in index 9497789ab..303b04f3f 100644 --- a/libpthread/nptl/sysdeps/pthread/Makefile.in +++ b/libpthread/nptl/sysdeps/pthread/Makefile.in @@ -63,7 +63,6 @@ endif CFLAGS-pt-common = -DNOT_IN_libc=1 $(SSP_ALL_CFLAGS) - CFLAGS-pthread_barrier_wait.c = -D_GNU_SOURCE $(CFLAGS-pt-common) \ -DIS_IN_libpthread=1 CFLAGS-pthread_cond_broadcast.c = $(CFLAGS-pt-common) -DIS_IN_libpthread=1 @@ -94,6 +93,7 @@ CFLAGS-librt-cancellation.c = -DIS_IN_librt=1 $(CFLAGS-pt-common) \ -fexceptions -fasynchronous-unwind-tables CFLAGS-rt-unwind-resume.c = -DIS_IN_librt=1 $(CFLAGS-pt-common) \ -fexceptions -fasynchronous-unwind-tables +CFLAGS-tpp.c = $(CFLAGS-pt-common) -DIS_IN_libpthread=1 #CFLAGS:=$(CFLAGS:-O1=-O2) diff --git a/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h b/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h index 70fe6762f..3268aa5f6 100644 --- a/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h +++ b/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h @@ -61,6 +61,10 @@ typedef struct __libc_rwlock_opaque__ __libc_rwlock_t; /* Type for key to thread-specific data. */ typedef pthread_key_t __libc_key_t; +# define __libc_freeres_fn_section \ + __attribute__ ((section ("__libc_freeres_fn"))) + + /* Define a lock variable NAME with storage class CLASS. The lock must be initialized with __libc_lock_init before it can be used (or define it with __libc_lock_define_initialized, below). Use `extern' for CLASS to @@ -545,7 +549,7 @@ weak_extern (__pthread_key_create) weak_extern (__pthread_setspecific) weak_extern (__pthread_getspecific) weak_extern (__pthread_once) -weak_extern (__pthread_initialize) +//weak_extern (__pthread_initialize) weak_extern (__pthread_atfork) #ifdef SHARED weak_extern (_pthread_cleanup_push_defer) @@ -571,7 +575,7 @@ weak_extern (pthread_setcancelstate) # pragma weak __pthread_setspecific # pragma weak __pthread_getspecific # pragma weak __pthread_once -# pragma weak __pthread_initialize +//# pragma weak __pthread_initialize # pragma weak __pthread_atfork # pragma weak _pthread_cleanup_push_defer # pragma weak _pthread_cleanup_pop_restore diff --git a/libpthread/nptl/sysdeps/pthread/tpp.c b/libpthread/nptl/sysdeps/pthread/tpp.c index 0325010b4..9adab791b 100644 --- a/libpthread/nptl/sysdeps/pthread/tpp.c +++ b/libpthread/nptl/sysdeps/pthread/tpp.c @@ -24,7 +24,7 @@ #include <pthreadP.h> #include <sched.h> #include <stdlib.h> - +#include "uClibc-glue.h" int __sched_fifo_min_prio = -1; int __sched_fifo_max_prio = -1; diff --git a/libpthread/nptl/sysdeps/pthread/uClibc-glue.h b/libpthread/nptl/sysdeps/pthread/uClibc-glue.h new file mode 100644 index 000000000..b957dedc9 --- /dev/null +++ b/libpthread/nptl/sysdeps/pthread/uClibc-glue.h @@ -0,0 +1,47 @@ +#ifndef _UCLIBC_GLUE_H +#define _UCLIBC_GLUE_H 1 + +#include <features.h> +#include <sys/cdefs.h> +#include <bits/uClibc_page.h> + +#ifdef IS_IN_libpthread +#include <bits/kernel-features.h> + +#ifndef __GLIBC_HAVE_LONG_LONG +# define __GLIBC_HAVE_LONG_LONG +#endif + +#define __getpagesize getpagesize +#define __sched_get_priority_max sched_get_priority_max +#define __sched_get_priority_min sched_get_priority_min +#define __sched_getscheduler sched_getscheduler +#define __sched_setscheduler sched_setscheduler +#define __sched_getparam sched_getparam +#define __getpid getpid +#define __gettimeofday gettimeofday +#define __poll poll +#define __sysctl sysctl +#define __open open +#define __read read +#define __close close +#define __on_exit on_exit +#define __libc_current_sigrtmin_private __libc_current_sigrtmin +#define __clone clone + +extern void *__libc_stack_end; +extern int __cxa_atexit (void (*func) (void *), void *arg, void *d); + +#endif /* IS_IN_libpthread */ + +#ifdef __UCLIBC_HAS_XLOCALE__ +# define __uselocale(x) uselocale(x) +#else +# define __uselocale(x) ((void)0) +#endif + +/* Use a funky version in a probably vein attempt at preventing gdb + * from dlopen()'ing glibc's libthread_db library... */ +#define VERSION __stringify(__UCLIBC_MAJOR__) "." __stringify(__UCLIBC_MINOR__) "." __stringify(__UCLIBC_SUBLEVEL__) + +#endif diff --git a/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c b/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c index e058604f3..273c8bb3f 100644 --- a/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c +++ b/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c @@ -24,6 +24,10 @@ #include <sysdep.h> #include <libgcc_s.h> +#define __libc_dlopen(x) dlopen(x, (RTLD_LOCAL | RTLD_LAZY)) +#define __libc_dlsym dlsym +#define __libc_dlclose dlclose + static void *libgcc_s_handle; static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); static _Unwind_Reason_Code (*libgcc_s_personality) diff --git a/libpthread/nptl/sysdeps/pthread/unwind-resume.c b/libpthread/nptl/sysdeps/pthread/unwind-resume.c index 3ca2fd8fc..94da075d1 100644 --- a/libpthread/nptl/sysdeps/pthread/unwind-resume.c +++ b/libpthread/nptl/sysdeps/pthread/unwind-resume.c @@ -23,6 +23,10 @@ #include <unwind.h> #include <libgcc_s.h> +#define __libc_dlopen(x) dlopen(x, (RTLD_LOCAL | RTLD_LAZY)) +#define __libc_dlsym dlsym +#define __libc_dlclose dlclose + static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); static _Unwind_Reason_Code (*libgcc_s_personality) (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *, |