diff options
| author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-11-16 03:36:39 +0000 |
|---|---|---|
| committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-11-16 03:36:39 +0000 |
| commit | b823b17fa7dc5a15d822a4f31fe8ee846a65cfae (patch) | |
| tree | cbf84b1c8fc0682e74165cc48b9baf0d7b382533 /libpthread/nptl/sysdeps/pthread | |
| parent | 708121712921e39f6d81179c376e53d26ee817b4 (diff) | |
| download | uClibc-alpine-b823b17fa7dc5a15d822a4f31fe8ee846a65cfae.tar.bz2 uClibc-alpine-b823b17fa7dc5a15d822a4f31fe8ee846a65cfae.tar.xz | |
Sync with glibc reference tree and changes for uClibc thus far.
Diffstat (limited to 'libpthread/nptl/sysdeps/pthread')
| -rw-r--r-- | libpthread/nptl/sysdeps/pthread/Makefile | 47 | ||||
| -rw-r--r-- | libpthread/nptl/sysdeps/pthread/pthread.h | 31 | ||||
| -rw-r--r-- | libpthread/nptl/sysdeps/pthread/sigaction.c | 21 | ||||
| -rw-r--r-- | libpthread/nptl/sysdeps/pthread/sigfillset.c | 4 | ||||
| -rw-r--r-- | libpthread/nptl/sysdeps/pthread/sigprocmask.c | 5 |
5 files changed, 62 insertions, 46 deletions
diff --git a/libpthread/nptl/sysdeps/pthread/Makefile b/libpthread/nptl/sysdeps/pthread/Makefile index 280db89f1..0f03668e1 100644 --- a/libpthread/nptl/sysdeps/pthread/Makefile +++ b/libpthread/nptl/sysdeps/pthread/Makefile @@ -32,20 +32,26 @@ CSRC = pthread_barrier_wait.c pthread_cond_broadcast.c pthread_cond_signal.c \ pthread_rwlock_timedwrlock.c pthread_rwlock_unlock.c \ pthread_rwlock_wrlock.c pthread_sigmask.c pthread_spin_destroy.c \ pthread_spin_init.c pthread_spin_unlock.c sigaction.c \ - unwind-forcedunwind.c + sigfillset.c sigprocmask.c unwind-forcedunwind.c -# -# Needed to get pthread types. -# CFLAGS-pthread_barrier_wait.c = -D_GNU_SOURCE CFLAGS-pthread_spin_destroy.c = -D_GNU_SOURCE CFLAGS-pthread_spin_init.c = -D_GNU_SOURCE CFLAGS-pthread_spin_unlock.c = -D_GNU_SOURCE +CFLAGS-sigaction.c = -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH) \ + -I$(TOPDIR)libc/signal +CFLAGS-sigfillset.c = -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH) \ + -I$(TOPDIR)libc/signal +CFLAGS-sigprocmask.c = -I$(TOPDIR)libc/sysdeps/linux/common AR_LIBP_COBJS = $(patsubst %.c, %.o, $(CSRC)) SO_LIBP_COBJS = $(patsubst %.c, %.os, $(CSRC)) +ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) +all: $(AR_LIB_NAME) $(AR_SO_LIB_NAME) crti.o crtn.o +else all: $(AR_LIB_NAME) $(AR_SO_LIB_NAME) +endif $(AR_LIB_NAME): $(AR_LIBP_COBJS) ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y) @@ -64,12 +70,39 @@ endif $(AR) $(ARFLAGS) $(AR_SO_LIB_NAME) $(SO_LIBP_COBJS) $(AR_LIBP_COBJS): %.o : %.c - $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -c $< -o $@ + $(CC) $(CFLAGS-LIBP) $(CFLAGS-$<) -c $< -o $@ $(SO_LIBP_COBJS): %.os : %.c - $(CC) $(CFLAGS-$<) $(CFLAGS-LIBP) -DSHARED -c $< -o $@ + $(CC) $(CFLAGS-LIBP) $(CFLAGS-$<) -DSHARED -c $< -o $@ + +pt-initfini.s: pt-initfini.c + $(CC) -S $(CFLAGS-LIBP) -g0 -fPIC -fno-inline-functions \ + $(call check_gcc,-fno-unit-at-a-time,) \ + -finhibit-size-directive \ + $(patsubst -f%,-fno-%,$(call check_gcc,-fexceptions,)) \ + $< -o $@ + +crti.S: pt-initfini.s + sed -n -e '1,/@HEADER_ENDS/p' \ + -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \ + -e '/@TRAILER_BEGINS/,$$p' $< > $@ + +crtn.S: pt-initfini.s + sed -n -e '1,/@HEADER_ENDS/p' \ + -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \ + -e '/@TRAILER_BEGINS/,$$p' $< > $@ + +defs.h: pt-initfini.s defs.awk + sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \ + awk -f defs.awk > $@ + +crti.o: crti.S defs.h + $(CC) -g0 $(ASFLAGS-LIBC) -c $< -o $@ + +crtn.o: crtn.S defs.h + $(CC) -g0 $(ASFLAGS-LIBC) -c $< -o $@ clean: - $(RM) *.o *.os *~ core + $(RM) *.o *.os *.s crt* *~ core defs.h .PHONY: $(AR_LIB_NAME) $(AR_SO_LIB_NAME) diff --git a/libpthread/nptl/sysdeps/pthread/pthread.h b/libpthread/nptl/sysdeps/pthread/pthread.h index 7157e4718..e2601c609 100644 --- a/libpthread/nptl/sysdeps/pthread/pthread.h +++ b/libpthread/nptl/sysdeps/pthread/pthread.h @@ -26,11 +26,7 @@ #define __need_sigset_t #include <signal.h> #include <bits/pthreadtypes.h> -#ifdef __UCLIBC__ #include <setjmp.h> -#else -#include <bits/setjmp.h> -#endif #include <bits/wordsize.h> @@ -66,22 +62,22 @@ enum /* Mutex initializers. */ #define PTHREAD_MUTEX_INITIALIZER \ - { { 0, } } + { { 0, 0, 0, 0, 0, 0 } } #ifdef __USE_GNU # if __WORDSIZE == 64 # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ - { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } } + { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0 } } # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ - { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } } + { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0 } } # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ - { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } } + { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0 } } # else # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ - { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } } + { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, 0 } } # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ - { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } } + { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, 0 } } # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ - { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } } + { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, 0 } } # endif #endif @@ -97,8 +93,13 @@ enum }; /* Read-write lock initializers. */ -# define PTHREAD_RWLOCK_INITIALIZER \ - { { 0, } } +# if __WORDSIZE == 64 +# define PTHREAD_RWLOCK_INITIALIZER \ + { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } +# else +# define PTHREAD_RWLOCK_INITIALIZER \ + { { 0, 0, 0, 0, 0, 0, 0, 0 } } +# endif # ifdef __USE_GNU # if __WORDSIZE == 64 # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ @@ -106,7 +107,7 @@ enum PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } # else # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ - { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } + { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 0 } } # endif # endif #endif /* Unix98 or XOpen2K */ @@ -144,7 +145,7 @@ enum /* Conditional variable handling. */ -#define PTHREAD_COND_INITIALIZER { { 0, } } +#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } } /* Cleanup buffers */ diff --git a/libpthread/nptl/sysdeps/pthread/sigaction.c b/libpthread/nptl/sysdeps/pthread/sigaction.c index 62f9daa3c..6ec1153ba 100644 --- a/libpthread/nptl/sysdeps/pthread/sigaction.c +++ b/libpthread/nptl/sysdeps/pthread/sigaction.c @@ -22,32 +22,19 @@ exact file anyway. */ #ifndef LIBC_SIGACTION -#include <features.h> - -#ifdef __UCLIBC__ -#include <errno.h> -#include <signal.h> #include <pthreadP.h> -#else -#include <nptl/pthreadP.h> -#endif /* We use the libc implementation but we tell it to not allow SIGCANCEL or SIGTIMER to be handled. */ # define LIBC_SIGACTION 1 -#ifndef __UCLIBC__ -# include <nptl/sysdeps/pthread/sigaction.c> +# include_next <sigaction.c> int __sigaction (sig, act, oact) int sig; const struct sigaction *act; struct sigaction *oact; -#else -int -__sigaction (int sig, const struct sigaction *act, struct sigaction *oact) -#endif { if (__builtin_expect (sig == SIGCANCEL || sig == SIGSETXID, 0)) { @@ -55,16 +42,10 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact) return -1; } -#ifdef __UCLIBC__ - return sigaction (sig, act, oact); -#else return __libc_sigaction (sig, act, oact); -#endif } libc_hidden_weak (__sigaction) -#ifndef __UCLIBC__ weak_alias (__sigaction, sigaction) -#endif #else diff --git a/libpthread/nptl/sysdeps/pthread/sigfillset.c b/libpthread/nptl/sysdeps/pthread/sigfillset.c index fe58ccd53..c95847f65 100644 --- a/libpthread/nptl/sysdeps/pthread/sigfillset.c +++ b/libpthread/nptl/sysdeps/pthread/sigfillset.c @@ -16,6 +16,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <nptl/pthreadP.h> +#include <pthreadP.h> -#include <sysdeps/generic/sigfillset.c> +#include_next <sigfillset.c> diff --git a/libpthread/nptl/sysdeps/pthread/sigprocmask.c b/libpthread/nptl/sysdeps/pthread/sigprocmask.c index 855b43396..3c3209384 100644 --- a/libpthread/nptl/sysdeps/pthread/sigprocmask.c +++ b/libpthread/nptl/sysdeps/pthread/sigprocmask.c @@ -16,5 +16,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <nptl/pthreadP.h> -#include <sysdeps/unix/sysv/linux/sigprocmask.c> +#include <pthreadP.h> + +#include_next <sigprocmask.c> |
