svn commit: branches/uClibc-nptl: include include/sys ldso ldso/libdl lib etc...

sjhill at uclibc.org sjhill at uclibc.org
Thu Oct 6 04:07:23 UTC 2005


Author: sjhill
Date: 2005-10-05 21:07:21 -0700 (Wed, 05 Oct 2005)
New Revision: 11778

Log:
Sync with trunk.


Modified:
   branches/uClibc-nptl/Makefile
   branches/uClibc-nptl/Rules.mak
   branches/uClibc-nptl/include/sys/mman.h
   branches/uClibc-nptl/include/unistd.h
   branches/uClibc-nptl/ldso/Makefile
   branches/uClibc-nptl/ldso/libdl/Makefile
   branches/uClibc-nptl/libc/sysdeps/linux/arm/crt1.S
   branches/uClibc-nptl/libc/sysdeps/linux/common/fork.c
   branches/uClibc-nptl/libc/sysdeps/linux/common/ioperm.c
   branches/uClibc-nptl/libc/sysdeps/linux/common/iopl.c
   branches/uClibc-nptl/libc/sysdeps/linux/common/mlock.c
   branches/uClibc-nptl/libc/sysdeps/linux/common/mlockall.c
   branches/uClibc-nptl/libc/sysdeps/linux/common/munlock.c
   branches/uClibc-nptl/libc/unistd/Makefile
   branches/uClibc-nptl/libc/unistd/daemon.c
   branches/uClibc-nptl/libpthread/Makefile
   branches/uClibc-nptl/utils/ldd.c


Changeset:
Modified: branches/uClibc-nptl/Makefile
===================================================================
--- branches/uClibc-nptl/Makefile	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/Makefile	2005-10-06 04:07:21 UTC (rev 11778)
@@ -348,13 +348,13 @@
 
 clean:
 	@$(RM) -r lib include/bits
-	$(RM) */*.so */*.a
+	$(RM) libc/*.a libc/obj.* libc/nonshared_obj.*
 	$(RM) libc/misc/internals/interp.c
+	$(RM) ldso/libdl/*.a
 	$(RM) include/fpu_control.h
 	$(MAKE) -C extra/locale clean
-	$(MAKE) -C ldso clean
-	$(MAKE) -C libc clean
-	$(MAKE) -C libpthread clean
+	$(MAKE) -C ldso headers_clean
+	$(MAKE) -C libpthread headers_clean
 	$(MAKE) -C test clean
 	$(MAKE) -C utils clean
 	@set -e; \
@@ -370,9 +370,10 @@
 	@if [ -d libc/sysdeps/linux/$(TARGET_ARCH) ]; then		\
 	    $(MAKE) -C libc/sysdeps/linux/$(TARGET_ARCH) clean;		\
 	fi
-	- find . \( -name \*.o -o -name core -o -name .\#\* \) -exec $(RM) {} \;
+	-find . -name \*.o -exec $(RM) {} \;
 
 distclean: clean
+	-find . \( -name core -o -name \*.orig -o -name \*~ -o -name .\#\* \) -exec $(RM) {} \;
 	$(RM) .config .config.old .config.cmd
 	$(RM) extra/locale/*.txt
 	$(MAKE) -C extra clean

Modified: branches/uClibc-nptl/Rules.mak
===================================================================
--- branches/uClibc-nptl/Rules.mak	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/Rules.mak	2005-10-06 04:07:21 UTC (rev 11778)
@@ -304,20 +304,22 @@
 endif
 
 ifeq ($(UCLIBC_HAS_THREADS),y)
+ifeq ($(strip $(UCLIBC_HAS_THREADS_NATIVE)),y)
+	PTNAME := nptl
+else
+	PTNAME := linuxthreads
+endif
+PTDIR := $(TOPDIR)libpthread/$(PTNAME)/
 # set up system dependencies include dirs (NOTE: order matters!)
-PTDIR   := $(TOPDIR)libpthread/linuxthreads/
-PTINC   := -I$(PTDIR)sysdeps/pthread \
-           -I$(PTDIR)sysdeps/$(TARGET_ARCH)
-ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
-PTDIR	:= $(TOPDIR)libpthread/nptl/
-PTINC	:= -I$(PTDIR)compat					\
-	   -I$(PTDIR)sysdeps/unix/sysv/linux/$(TARGET_ARCH)	\
-	   -I$(PTDIR)sysdeps/$(TARGET_ARCH)			\
-	   -I$(PTDIR)sysdeps/unix/sysv/linux			\
-	   -I$(PTDIR)sysdeps/pthread				\
-	   -I$(PTDIR)sysdeps/pthread/bits			\
-	   -I$(PTDIR)sysdeps/generic				\
-	   -include $(PTDIR)compat/libc-symbols.h
+ifeq ($(strip $(UCLIBC_HAS_THREADS_NATIVE)),y)
+PTINC := -I$(PTDIR)compat					\
+	 -I$(PTDIR)sysdeps/unix/sysv/linux/$(TARGET_ARCH)	\
+	 -I$(PTDIR)sysdeps/$(TARGET_ARCH)			\
+	 -I$(PTDIR)sysdeps/unix/sysv/linux			\
+	 -I$(PTDIR)sysdeps/pthread				\
+	 -I$(PTDIR)sysdeps/pthread/bits				\
+	 -I$(PTDIR)sysdeps/generic				\
+	 -include $(PTDIR)compat/libc-symbols.h
 #
 # Test for TLS if NPTL support was selected.
 #
@@ -335,6 +337,11 @@
 	@echo "####";
 	@exit 1;
 endif
+else
+# psm: the next 2 are probably incorrect, the generic header will
+# win over the arch specific one
+PTINC := -I$(PTDIR)sysdeps/pthread				\
+         -I$(PTDIR)sysdeps/$(TARGET_ARCH)
 endif
 endif
 

Modified: branches/uClibc-nptl/include/sys/mman.h
===================================================================
--- branches/uClibc-nptl/include/sys/mman.h	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/include/sys/mman.h	2005-10-06 04:07:21 UTC (rev 11778)
@@ -96,6 +96,7 @@
 extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW;
 #endif
 
+#if defined __ARCH_HAS_MMU__
 /* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to
    be memory resident.  */
 extern int mlock (__const void *__addr, size_t __len) __THROW;
@@ -111,6 +112,7 @@
 /* All currently mapped pages of the process' address space become
    unlocked.  */
 extern int munlockall (void) __THROW;
+#endif
 
 #ifdef __USE_MISC
 /* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length

Modified: branches/uClibc-nptl/include/unistd.h
===================================================================
--- branches/uClibc-nptl/include/unistd.h	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/include/unistd.h	2005-10-06 04:07:21 UTC (rev 11778)
@@ -632,10 +632,12 @@
 #endif
 
 
+#ifdef __ARCH_HAS_MMU__
 /* Clone the calling process, creating an exact copy.
    Return -1 for errors, 0 to the new process,
    and the process ID of the new process to the old process.  */
 extern __pid_t fork (void) __THROW;
+#endif
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Clone the calling process, but without copying the whole address space.
@@ -752,10 +754,12 @@
 extern void setusershell (void) __THROW; /* Rewind and re-read the file.  */
 
 
+#if defined __ARCH_HAS_MMU__
 /* Put the program in the background, and dissociate from the controlling
    terminal.  If NOCHDIR is zero, do `chdir ("/")'.  If NOCLOSE is zero,
    redirects stdin, stdout, and stderr to /dev/null.  */
 extern int daemon (int __nochdir, int __noclose) __THROW;
+#endif
 #endif /* Use BSD || X/Open.  */
 
 

Modified: branches/uClibc-nptl/ldso/Makefile
===================================================================
--- branches/uClibc-nptl/ldso/Makefile	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/ldso/Makefile	2005-10-06 04:07:21 UTC (rev 11778)
@@ -43,9 +43,11 @@
 	echo '#include "$(TARGET_ARCH)/elfinterp.c"' \
 		> include/dl-progname.h
 
-clean: subdirs_clean
+headers_clean:
 	$(RM) $(HEADERS)
 
+clean: subdirs_clean headers_clean
+
 subdirs: $(patsubst %, _dir_%, $(DIRS))
 subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))
 

Modified: branches/uClibc-nptl/ldso/libdl/Makefile
===================================================================
--- branches/uClibc-nptl/ldso/libdl/Makefile	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/ldso/libdl/Makefile	2005-10-06 04:07:21 UTC (rev 11778)
@@ -98,4 +98,4 @@
 	$(STRIPTOOL) -x -R .note -R .comment $*.o
 
 clean:
-	$(RM) *.o *~ core *.a
+	$(RM) *.[oa] *~ core

Modified: branches/uClibc-nptl/libc/sysdeps/linux/arm/crt1.S
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/arm/crt1.S	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/libc/sysdeps/linux/arm/crt1.S	2005-10-06 04:07:21 UTC (rev 11778)
@@ -7,6 +7,23 @@
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

Modified: branches/uClibc-nptl/libc/sysdeps/linux/common/fork.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/common/fork.c	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/libc/sysdeps/linux/common/fork.c	2005-10-06 04:07:21 UTC (rev 11778)
@@ -13,11 +13,5 @@
 #ifdef __ARCH_HAS_MMU__
 #define __NR___libc_fork __NR_fork
 _syscall0(pid_t, __libc_fork);
-#else
-pid_t __libc_fork(void)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
-#endif
 weak_alias(__libc_fork, fork);
+#endif

Modified: branches/uClibc-nptl/libc/sysdeps/linux/common/ioperm.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/common/ioperm.c	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/libc/sysdeps/linux/common/ioperm.c	2005-10-06 04:07:21 UTC (rev 11778)
@@ -10,10 +10,4 @@
 #include "syscalls.h"
 #if defined __ARCH_HAS_MMU__ && defined __NR_ioperm
 _syscall3(int, ioperm, unsigned long, from, unsigned long, num, int, turn_on);
-#else
-int ioperm(unsigned long from, unsigned long num, int turn_on)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif

Modified: branches/uClibc-nptl/libc/sysdeps/linux/common/iopl.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/common/iopl.c	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/libc/sysdeps/linux/common/iopl.c	2005-10-06 04:07:21 UTC (rev 11778)
@@ -11,10 +11,4 @@
 /* Tuns out the m68k unistd.h kernel header is broken */
 #if defined __ARCH_HAS_MMU__ && defined __NR_iopl && ( !defined(__mc68000__))
 _syscall1(int, iopl, int, level);
-#else
-int iopl(int level)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif

Modified: branches/uClibc-nptl/libc/sysdeps/linux/common/mlock.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/common/mlock.c	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/libc/sysdeps/linux/common/mlock.c	2005-10-06 04:07:21 UTC (rev 11778)
@@ -9,6 +9,6 @@
 
 #include "syscalls.h"
 #include <sys/mman.h>
-#	if defined __ARCH_HAS_MMU__ && defined __NR_mlock
+#if defined __ARCH_HAS_MMU__ && defined __NR_mlock
 _syscall2(int, mlock, const void *, addr, size_t, len);
-#	endif
+#endif

Modified: branches/uClibc-nptl/libc/sysdeps/linux/common/mlockall.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/common/mlockall.c	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/libc/sysdeps/linux/common/mlockall.c	2005-10-06 04:07:21 UTC (rev 11778)
@@ -9,6 +9,6 @@
 
 #include "syscalls.h"
 #include <sys/mman.h>
-#	if defined __ARCH_HAS_MMU__ && defined __NR_mlockall
+#if defined __ARCH_HAS_MMU__ && defined __NR_mlockall
 _syscall1(int, mlockall, int, flags);
-#	endif
+#endif

Modified: branches/uClibc-nptl/libc/sysdeps/linux/common/munlock.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/common/munlock.c	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/libc/sysdeps/linux/common/munlock.c	2005-10-06 04:07:21 UTC (rev 11778)
@@ -9,6 +9,6 @@
 
 #include "syscalls.h"
 #include <sys/mman.h>
-#	if defined __ARCH_HAS_MMU__ && defined __NR_munlock
+#if defined __ARCH_HAS_MMU__ && defined __NR_munlock
 _syscall2(int, munlock, const void *, addr, size_t, len);
-#	endif
+#endif

Modified: branches/uClibc-nptl/libc/unistd/Makefile
===================================================================
--- branches/uClibc-nptl/libc/unistd/Makefile	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/libc/unistd/Makefile	2005-10-06 04:07:21 UTC (rev 11778)
@@ -25,11 +25,9 @@
 
 CSRC=	sleep.c usleep.c ualarm.c getpass.c sysconf.c getlogin.c \
 	fpathconf.c confstr.c pathconf.c swab.c usershell.c \
-	getsubopt.c
+	getsubopt.c daemon.c
 
-ifeq ($(strip $(ARCH_HAS_MMU)),y)
-	CSRC += daemon.c
-else
+ifneq ($(strip $(ARCH_HAS_MMU)),y)
 	MOBJ1 += __exec_alloc.o
 endif
 

Modified: branches/uClibc-nptl/libc/unistd/daemon.c
===================================================================
--- branches/uClibc-nptl/libc/unistd/daemon.c	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/libc/unistd/daemon.c	2005-10-06 04:07:21 UTC (rev 11778)
@@ -29,8 +29,7 @@
 #include <paths.h>
 #include <unistd.h>
 
-/* Note that this file should not be compiled in 
- * unless __ARCH_HAS_MMU__ is defined */
+#if defined __ARCH_HAS_MMU__
 
 int daemon( int nochdir, int noclose )
 {
@@ -66,8 +65,8 @@
 	return(0);
 }
 
+#endif
 
-
 /*-
  * Copyright (c) 1990, 1993
  *	The Regents of the University of California.  All rights reserved.

Modified: branches/uClibc-nptl/libpthread/Makefile
===================================================================
--- branches/uClibc-nptl/libpthread/Makefile	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/libpthread/Makefile	2005-10-06 04:07:21 UTC (rev 11778)
@@ -19,41 +19,30 @@
 TOPDIR=../
 include $(TOPDIR)Rules.mak
 
-ifeq ($(strip $(UCLIBC_HAS_THREADS_NATIVE)),y)
-ALL_SUBDIRS = nptl nptl_db
-DIRS = nptl
+ALL_SUBDIRS = $(PTNAME) $(PTNAME)_db
+DIRS = $(PTNAME)
 ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
-	DIRS += nptl_db
+	DIRS += $(PTNAME)_db
 endif
-else
-ALL_SUBDIRS = linuxthreads linuxthreads_db
-DIRS = linuxthreads
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
-        DIRS += linuxthreads_db
-endif
-endif
 
 all: subdirs
 
+# NPTL does not have a generic pthreadtypes.h
+# and each arch has to have both semaphore.h/pthreadtypes.h ?
 headers:
-ifeq ($(strip $(UCLIBC_HAS_THREADS_NATIVE)),y)
-	$(LN) -sf $(TOPDIR)libpthread/nptl/sysdeps/pthread/pthread.h $(TOPDIR)include/
-	$(LN) -sf $(TOPDIR)libpthread/nptl/semaphore.h $(TOPDIR)include/
-	$(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/semaphore.h $(TOPDIR)include/bits/
-	$(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/pthreadtypes.h $(TOPDIR)include/bits/
-	$(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/pthread/bits/libc-lock.h $(TOPDIR)include/bits/
-	$(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h $(TOPDIR)include/bits/
+	$(LN) -sf $(PTDIR)/sysdeps/pthread/pthread.h $(TOPDIR)include/
+	$(LN) -sf $(PTDIR)/semaphore.h $(TOPDIR)include/
 ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
-	$(LN) -sf $(TOPDIR)libpthread/nptl_db/thread_db.h $(TOPDIR)include/
+	$(LN) -sf $(PTDIR)_db/thread_db.h $(TOPDIR)include/
 endif
+ifeq ($(strip $(UCLIBC_HAS_THREADS_NATIVE)),y)
+	$(LN) -sf ../$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/semaphore.h $(TOPDIR)include/bits/
+	$(LN) -sf ../$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/pthreadtypes.h $(TOPDIR)include/bits/
+	$(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/libc-lock.h $(TOPDIR)include/bits/
+	$(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/stdio-lock.h $(TOPDIR)include/bits/
 else
-	$(LN) -sf $(TOPDIR)libpthread/linuxthreads/sysdeps/pthread/pthread.h $(TOPDIR)include/
-	$(LN) -sf $(TOPDIR)libpthread/linuxthreads/semaphore.h $(TOPDIR)include/
-	$(LN) -sf ../$(TOPDIR)libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h $(TOPDIR)include/bits/
-ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
-	$(LN) -sf $(TOPDIR)libpthread/linuxthreads_db/thread_db.h $(TOPDIR)include/
+	$(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(TOPDIR)include/bits/
 endif
-endif
 
 tags:
 	ctags -R
@@ -67,10 +56,12 @@
 $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
 	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
 
-clean: subdirs_clean
+headers_clean:
 	$(RM)	$(TOPDIR)include/pthread.h $(TOPDIR)include/semaphore.h \
 		$(TOPDIR)include/thread_db.h \
 		$(TOPDIR)include/bits/pthreadtypes.h $(TOPDIR)include/bits/semaphore.h \
 		$(TOPDIR)include/bits/libc-lock.h $(TOPDIR)include/bits/stdio-lock
 
+clean: subdirs_clean headers_clean
+
 .PHONY: dummy

Modified: branches/uClibc-nptl/utils/ldd.c
===================================================================
--- branches/uClibc-nptl/utils/ldd.c	2005-10-06 04:03:47 UTC (rev 11777)
+++ branches/uClibc-nptl/utils/ldd.c	2005-10-06 04:07:21 UTC (rev 11778)
@@ -727,7 +727,7 @@
 				NULL
 			};
 
-			if ((pid = fork()) == 0) {
+			if ((pid = vfork()) == 0) {
 				/* Cool, it looks like we should be able to actually
 				 * run this puppy.  Do so now... */
 				execle(filename, filename, NULL, environment);




More information about the uClibc-cvs mailing list