Browse Source

s/IS_IN_linuxthreads/IS_IN_libpthread/, some prototypes, correct Makefile.in, disable __res_state, unavailable in resolv.h

Peter S. Mazinger 18 years ago
parent
commit
8c2b377d28

+ 19 - 9
libpthread/linuxthreads/Makefile.in

@@ -1,13 +1,12 @@
 # Makefile for uClibc
 #
 # Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
-# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
 #
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-CFLAGS-linuxthreads := -DNOT_IN_libc $(SSP_ALL_CFLAGS)
-CFLAGS-linuxthreads += -DIS_IN_linuxthreads=1 -D_GNU_SOURCE
+CFLAGS-linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS)
 
 CFLAGS-libpthread/linuxthreads/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads)
 CFLAGS-libpthread/linuxthreads/sysdeps/unix/sysv/linux/ := $(CFLAGS-linuxthreads)
@@ -69,8 +68,8 @@ libpthread_libc_OBJ  := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_
 libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
 libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
 
-libpthread-static-y += $(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_SPEC_SRC))
-libpthread-shared-y += $(patsubst %.c,$(libpthread_OUT)/%.oS,$(libpthread_SPEC_SRC))
+libpthread-static-y += $(patsubst %,$(libpthread_OUT)/%.o,$(libpthread_static_SRC))
+libpthread-shared-y += $(patsubst %,$(libpthread_OUT)/%.oS,$(libpthread_shared_SRC))
 
 ifeq ($(DOPIC),y)
 libpthread-a-y  += $(libpthread_OBJ:.o=.os) $(libpthread-static-y:.o=.os)
@@ -79,17 +78,19 @@ libpthread-a-y  += $(libpthread_OBJ) $(libpthread-static-y)
 endif
 libpthread-so-y += $(libpthread_OBJ:.o=.os) $(libpthread-shared-y)
 
-libpthread-multi-y += $(libpthread_SRC)
-libpthread-nomulti-y += $(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_NO_MULTI))
-
 lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
 lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
 objclean-y += libpthread_clean
 headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
 headers_clean-y += linuxthreads_headers_clean
 
+ifeq ($(DOMULTI),n)
 $(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc)
 	$(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
+else
+$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS $(libc)
+	$(call linkm.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
+endif
 
 $(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
 	$(Q)$(RM) $@
@@ -100,6 +101,15 @@ else
 endif
 	$(do_ar)
 
+$(libpthread_OUT)/libpthread.oS: $(libpthread_SRC) $(patsubst %,$(libpthread_DIR)/%.c,$(libpthread_shared_SRC))
+	$(Q)$(RM) $@
+	$(compile-m)
+ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
+	$(do_t_strip:-x=-X --strip-debug)
+else
+	$(do_t_strip)
+endif
+
 $(top_builddir)lib/libpthread.a: $(libpthread-a-y)
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
@@ -121,4 +131,4 @@ linuxthreads_headers_clean:
 		$(top_builddir)include/bits/pthreadtypes.h
 
 libpthread_clean:
-	$(RM) $(libpthread_OUT)/{,*/,*/*/,*/*/*/,*/*/*/*/}*.{o,os,a}
+	$(RM) $(libpthread_OUT)/{,*/,*/*/,*/*/*/,*/*/*/*/}*.{o,os,oS,a}

+ 2 - 0
libpthread/linuxthreads/errno.c

@@ -36,6 +36,7 @@ __h_errno_location (void)
   return THREAD_GETMEM (self, p_h_errnop);
 }
 
+#if 0
 /* Return thread specific resolver state.  */
 struct __res_state *
 __res_state (void)
@@ -44,3 +45,4 @@ __res_state (void)
   return THREAD_GETMEM (self, p_resp);
 }
 #endif
+#endif

+ 4 - 4
libpthread/linuxthreads/forward.c

@@ -116,16 +116,16 @@ FORWARD (pthread_mutex_destroy, (pthread_mutex_t *mutex), (mutex), 0)
 FORWARD (pthread_mutex_init,
 	 (pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr),
 	 (mutex, mutexattr), 0)
-hidden_strong_alias(pthread_mutex_init, __pthread_mutex_init)
+strong_alias(pthread_mutex_init, __pthread_mutex_init)
 
 FORWARD (pthread_mutex_lock, (pthread_mutex_t *mutex), (mutex), 0)
-hidden_strong_alias(pthread_mutex_lock, __pthread_mutex_lock)
+strong_alias(pthread_mutex_lock, __pthread_mutex_lock)
 
 FORWARD (pthread_mutex_trylock, (pthread_mutex_t *mutex), (mutex), 0)
-hidden_strong_alias(pthread_mutex_trylock, __pthread_mutex_trylock)
+strong_alias(pthread_mutex_trylock, __pthread_mutex_trylock)
 
 FORWARD (pthread_mutex_unlock, (pthread_mutex_t *mutex), (mutex), 0)
-hidden_strong_alias(pthread_mutex_unlock, __pthread_mutex_unlock)
+strong_alias(pthread_mutex_unlock, __pthread_mutex_unlock)
 
 
 FORWARD2 (pthread_self, pthread_t, (void), (), return 0)

+ 6 - 4
libpthread/linuxthreads/internals.h

@@ -372,7 +372,7 @@ extern pthread_t __pthread_self (void);
 extern pthread_descr __pthread_thread_self (void);
 extern pthread_descr __pthread_self_stack (void) attribute_hidden;
 extern int __pthread_equal (pthread_t thread1, pthread_t thread2);
-extern void __pthread_exit (void *retval);
+extern void __pthread_exit (void *retval) attribute_noreturn;
 extern int __pthread_getschedparam (pthread_t thread, int *policy,
 				    struct sched_param *param);
 extern int __pthread_setschedparam (pthread_t thread, int policy,
@@ -382,11 +382,11 @@ extern int __pthread_setcanceltype (int type, int * oldtype);
 
 extern void __pthread_restart_old(pthread_descr th);
 extern void __pthread_suspend_old(pthread_descr self);
-extern int __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abs);
+extern int __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abstime);
 
 extern void __pthread_restart_new(pthread_descr th);
 extern void __pthread_suspend_new(pthread_descr self);
-extern int __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abs);
+extern int __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abstime);
 
 extern void __pthread_wait_for_restart_signal(pthread_descr self);
 
@@ -528,7 +528,9 @@ weak_extern (__pthread_thread_self)
 # define __manager_thread __pthread_manager_threadp
 #endif
 
-extern inline __attribute__((always_inline)) pthread_descr
+extern __always_inline pthread_descr
+check_thread_self (void);
+extern __always_inline pthread_descr
 check_thread_self (void)
 {
   pthread_descr self = thread_self ();

+ 0 - 1
libpthread/linuxthreads/ptcleanup.c

@@ -20,7 +20,6 @@
 #include <setjmp.h>
 #include "pthread.h"
 #include "internals.h"
-#include <sysdep.h>
 #ifndef NO_PTR_DEMANGLE
 #include <jmpbuf-unwind.h>
 #define __JMPBUF_UNWINDS(a,b,c) _JMPBUF_UNWINDS(a,b,c)

+ 1 - 2
libpthread/linuxthreads/pthread.c

@@ -40,8 +40,7 @@
 #endif
 
 /* mods for uClibc: __libc_sigaction is not in any standard headers */
-extern int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact);
-extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
+extern __typeof(sigaction) __libc_sigaction;
 
 #if !(USE_TLS && HAVE___THREAD)
 /* These variables are used by the setup code.  */

+ 1 - 0
libpthread/linuxthreads/pthread_setegid.c

@@ -20,6 +20,7 @@
 #include <unistd.h>
 
 
+int pthread_setegid_np (gid_t gid);
 int
 pthread_setegid_np (gid_t gid)
 {

+ 1 - 0
libpthread/linuxthreads/pthread_seteuid.c

@@ -20,6 +20,7 @@
 #include <unistd.h>
 
 
+int pthread_seteuid_np (uid_t uid);
 int
 pthread_seteuid_np (uid_t uid)
 {

+ 1 - 0
libpthread/linuxthreads/pthread_setgid.c

@@ -20,6 +20,7 @@
 #include <unistd.h>
 
 
+int pthread_setgid_np (gid_t gid);
 int
 pthread_setgid_np (gid_t gid)
 {

+ 1 - 0
libpthread/linuxthreads/pthread_setregid.c

@@ -20,6 +20,7 @@
 #include <unistd.h>
 
 
+int pthread_setregid_np (gid_t rgid, gid_t egid);
 int
 pthread_setregid_np (gid_t rgid, gid_t egid)
 {

+ 1 - 0
libpthread/linuxthreads/pthread_setresgid.c

@@ -20,6 +20,7 @@
 #include <unistd.h>
 
 
+int pthread_setresgid_np (gid_t rgid, gid_t egid, gid_t sgid);
 int
 pthread_setresgid_np (gid_t rgid, gid_t egid, gid_t sgid)
 {

+ 1 - 0
libpthread/linuxthreads/pthread_setresuid.c

@@ -20,6 +20,7 @@
 #include <unistd.h>
 
 
+int pthread_setresuid_np (uid_t ruid, uid_t euid, uid_t suid);
 int
 pthread_setresuid_np (uid_t ruid, uid_t euid, uid_t suid)
 {

+ 1 - 0
libpthread/linuxthreads/pthread_setreuid.c

@@ -20,6 +20,7 @@
 #include <unistd.h>
 
 
+int pthread_setreuid_np (uid_t ruid, uid_t euid);
 int
 pthread_setreuid_np (uid_t ruid, uid_t euid)
 {

+ 1 - 0
libpthread/linuxthreads/pthread_setuid.c

@@ -20,6 +20,7 @@
 #include <unistd.h>
 
 
+int pthread_setuid_np (uid_t uid);
 int
 pthread_setuid_np (uid_t uid)
 {

+ 1 - 1
libpthread/linuxthreads/signals.c

@@ -22,7 +22,7 @@
 #include <ucontext.h>
 
 /* mods for uClibc: __libc_sigaction is not in any standard headers */
-extern int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact);
+extern __typeof(sigaction) __libc_sigaction;
 
 int pthread_sigmask(int how, const sigset_t * newmask, sigset_t * oldmask)
 {

+ 3 - 0
libpthread/linuxthreads/sysdeps/i386/pt-machine.h

@@ -77,6 +77,7 @@ __compare_and_swap (long int *p, long int oldval, long int newval)
 }
 
 
+PT_EI int get_eflags (void);
 PT_EI int
 get_eflags (void)
 {
@@ -86,6 +87,7 @@ get_eflags (void)
 }
 
 
+PT_EI void set_eflags (int newflags);
 PT_EI void
 set_eflags (int newflags)
 {
@@ -93,6 +95,7 @@ set_eflags (int newflags)
 }
 
 
+PT_EI int compare_and_swap_is_available (void);
 PT_EI int
 compare_and_swap_is_available (void)
 {

+ 1 - 1
libpthread/linuxthreads/sysdeps/i386/tls.h

@@ -117,7 +117,7 @@ typedef struct
 #   define TLS_LOAD_EBX
 #  endif
 
-#  if !defined IS_IN_linuxthreads && !defined DO_MODIFY_LDT
+#  if !defined IS_IN_libpthread && !defined DO_MODIFY_LDT
 #   include "useldt.h"		/* For the structure.  */
 #  endif
 #  if __ASSUME_LDT_WORKS > 0

+ 2 - 2
libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h

@@ -5,7 +5,7 @@
 #include <sys/cdefs.h>
 #include <bits/uClibc_page.h>
 
-#if IS_IN_linuxthreads
+#ifdef IS_IN_libpthread
 #include "kernel-features.h"
 
 #ifndef _GNU_SOURCE
@@ -39,7 +39,7 @@
 extern void *__libc_stack_end;
 extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
 
-#endif /* IS_IN_linuxthreads */
+#endif /* IS_IN_libpthread */
 
 /* Use a funky version in a probably vein attempt at preventing gdb 
  * from dlopen()'ing glibc's libthread_db library... */

+ 0 - 1
libpthread/linuxthreads/sysdeps/unix/sysv/linux/fork.h

@@ -19,7 +19,6 @@
 
 #include <list.h>
 #include <bits/libc-lock.h>
-#include <sysdep.h>
 
 struct fork_block
 {

+ 0 - 1
libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h

@@ -17,7 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <sysdep.h>
 #include <tls.h>
 #include <pt-machine.h>
 #ifndef __ASSEMBLER__

+ 0 - 1
libpthread/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c

@@ -21,7 +21,6 @@
 #include <signal.h>
 #include <unistd.h>
 
-#include <sysdep.h>
 #include <sys/syscall.h>
 #include <linuxthreads/internals.h>