changeset 1355:71acb8c4611a

Kick uClibc 0.9.32-rc3 to UNSTABLE for the moment, and put 0.9.31 back in stable, with its old patch stack.
author Rob Landley <rob@landley.net>
date Sat, 21 May 2011 23:37:31 -0500
parents 5ec7eb5b96ab
children 5198cfb8e368
files download.sh sources/baseconfig-uClibc sources/patches/alt-uClibc-mmu.patch sources/patches/alt-uClibc-ruserpass.patch sources/patches/alt-uClibc-schedparam.patch sources/patches/uClibc-backport-humor-udev.patch sources/patches/uClibc-fix-arm-unwind-001.patch sources/patches/uClibc-fix-arm-unwind-002.patch sources/patches/uClibc-fix-fcntl64.patch sources/patches/uClibc-fixintlassert.patch sources/patches/uClibc-fixlocalestruct.patch sources/patches/uClibc-fixm68k.patch sources/patches/uClibc-futimes.patch sources/patches/uClibc-mips64.patch sources/patches/uClibc-mmu.patch sources/patches/uClibc-ruserpass.patch
diffstat 16 files changed, 605 insertions(+), 221 deletions(-) [+]
line wrap: on
line diff
--- a/download.sh	Sat May 21 22:56:09 2011 -0500
+++ b/download.sh	Sat May 21 23:37:31 2011 -0500
@@ -26,10 +26,11 @@
 #UNSTABLE=http://kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.32-rc7.tar.bz2 \
 maybe_fork "download || dienow"
 
-URL=http://uclibc.org/downloads/uClibc-0.9.32-rc3.tar.bz2 \
-SHA1=4dded496fe734ba1ff94a49597ea647ada35e002 \
+URL=http://uclibc.org/downloads/uClibc-0.9.31.tar.bz2 \
+SHA1=f25f70534594dffdb6b9008799a1532271178338 \
 #SHA1= \
 #UNSTABLE=http://uclibc.org/downloads/uClibc-snapshot.tar.bz2 \
+UNSTABLE=http://uclibc.org/downloads/uClibc-0.9.32-rc3.tar.bz2 \
 maybe_fork "download || dienow"
 
 # 2.17 was the last GPLv2 release of binutils
--- a/sources/baseconfig-uClibc	Sat May 21 22:56:09 2011 -0500
+++ b/sources/baseconfig-uClibc	Sat May 21 23:37:31 2011 -0500
@@ -12,7 +12,7 @@
 
 # Obsolete symbols for 0.9.31
 
-#ARCH_HAS_MMU=y
+ARCH_HAS_MMU=y
 #LINUXTHREADS_OLD=y
 
 # Baseconfig for 0.9.31
@@ -28,7 +28,8 @@
 LDSO_RUNPATH=y
 LDSO_SEARCH_INTERP_PATH=y
 UCLIBC_CTOR_DTOR=y
-UCLIBC_HAS_THREADS_NATIVE=y
+#UCLIBC_HAS_THREADS_NATIVE=y
+LINUXTHREADS_OLD=y
 UCLIBC_HAS_SYSLOG=y
 UCLIBC_HAS_LFS=y
 MALLOC_GLIBC_COMPAT=y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/alt-uClibc-mmu.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,216 @@
+diff --git a/extra/Configs/Config.alpha b/extra/Configs/Config.alpha
+index 144924a..9aab976 100644
+--- a/extra/Configs/Config.alpha
++++ b/extra/Configs/Config.alpha
+@@ -11,6 +11,5 @@ config FORCE_OPTIONS_FOR_ARCH
+ 	bool
+ 	default y
+ 	select ARCH_LITTLE_ENDIAN
+-	select ARCH_HAS_MMU
+ 	select ARCH_HAS_NO_LDSO
+ 	select UCLIBC_HAS_LFS
+diff --git a/extra/Configs/Config.arm b/extra/Configs/Config.arm
+index b060ace..5c919b4 100644
+--- a/extra/Configs/Config.arm
++++ b/extra/Configs/Config.arm
+@@ -62,11 +62,9 @@ config CONFIG_GENERIC_ARM
+ 
+ config CONFIG_ARM610
+ 	bool "Arm 610"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM710
+ 	bool "Arm 710"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM7TDMI
+ 	bool "Arm 7TDMI"
+@@ -74,35 +72,27 @@ config CONFIG_ARM7TDMI
+ 
+ config CONFIG_ARM720T
+ 	bool "Arm 720T"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM920T
+ 	bool "Arm 920T"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM922T
+ 	bool "Arm 922T"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM926T
+ 	bool "Arm 926T"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM10T
+ 	bool "Arm 10T"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM1136JF_S
+ 	bool "Arm 1136JF-S"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM1176JZ_S
+ 	bool "Arm 1176JZ-S"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM1176JZF_S
+ 	bool "Arm 1176JZF-S"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM_CORTEX_M3
+ 	bool "Arm Cortex-M3"
+@@ -116,18 +106,14 @@ config CONFIG_ARM_CORTEX_M1
+ 
+ config CONFIG_ARM_SA110
+ 	bool "Intel StrongArm SA-110"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM_SA1100
+ 	bool "Intel StrongArm SA-1100"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM_XSCALE
+ 	bool "Intel Xscale"
+-	select ARCH_HAS_MMU
+ 
+ config CONFIG_ARM_IWMMXT
+ 	bool "Intel Xscale With WMMX PXA27x"
+-	select ARCH_HAS_MMU
+ 
+ endchoice
+diff --git a/extra/Configs/Config.avr32 b/extra/Configs/Config.avr32
+index cbadb4c..a5eb157 100644
+--- a/extra/Configs/Config.avr32
++++ b/extra/Configs/Config.avr32
+@@ -19,7 +19,6 @@ choice
+ 
+ config CONFIG_AVR32_AP7
+ 	bool "AVR32 AP7"
+-	select ARCH_HAS_MMU
+ 
+ endchoice
+ 
+diff --git a/extra/Configs/Config.cris b/extra/Configs/Config.cris
+index 52ca0c3..db9293c 100644
+--- a/extra/Configs/Config.cris
++++ b/extra/Configs/Config.cris
+@@ -24,11 +24,9 @@ choice
+ 		- CRISv32  Support for Axis' CRISv32 architecture.
+ 
+ config CONFIG_CRIS
+-	select ARCH_HAS_MMU
+ 	bool "CRIS"
+ 
+ config CONFIG_CRISV32
+-	select ARCH_HAS_MMU
+ 	bool "CRISv32"
+ 
+ endchoice
+diff --git a/extra/Configs/Config.hppa b/extra/Configs/Config.hppa
+index 1323de2..b8699bf 100644
+--- a/extra/Configs/Config.hppa
++++ b/extra/Configs/Config.hppa
+@@ -11,7 +11,6 @@ config FORCE_OPTIONS_FOR_ARCH
+ 	bool
+ 	default y
+ 	select ARCH_BIG_ENDIAN
+-	select ARCH_HAS_MMU
+ 	select HAS_NO_THREADS
+ 	select ARCH_HAS_NO_LDSO
+ 	select HAVE_NO_SSP
+diff --git a/extra/Configs/Config.i386 b/extra/Configs/Config.i386
+index 288aa5e..f23646c 100644
+--- a/extra/Configs/Config.i386
++++ b/extra/Configs/Config.i386
+@@ -11,7 +11,6 @@ config FORCE_OPTIONS_FOR_ARCH
+ 	bool
+ 	default y
+ 	select ARCH_LITTLE_ENDIAN
+-	select ARCH_HAS_MMU
+ 
+ choice
+ 	prompt "Target x86 Processor Family"
+diff --git a/extra/Configs/Config.ia64 b/extra/Configs/Config.ia64
+index ae88be7..c7a1f63 100644
+--- a/extra/Configs/Config.ia64
++++ b/extra/Configs/Config.ia64
+@@ -11,5 +11,4 @@ config FORCE_OPTIONS_FOR_ARCH
+ 	bool
+ 	default y
+ 	select ARCH_LITTLE_ENDIAN
+-	select ARCH_HAS_MMU
+ 	select ARCH_HAS_NO_LDSO
+diff --git a/extra/Configs/Config.in.arch b/extra/Configs/Config.in.arch
+index 8a02cb1..4679517 100644
+--- a/extra/Configs/Config.in.arch
++++ b/extra/Configs/Config.in.arch
+@@ -93,7 +93,7 @@ if ARCH_HAS_NO_MMU
+ comment "Target CPU lacks a memory management unit (MMU)"
+ endif
+ 
+-config ARCH_HAS_MMU
++config ARCH_USE_MMU
+ 	bool "Target CPU has a memory management unit (MMU)"
+ 	depends on !ARCH_HAS_NO_MMU
+ 	default y
+@@ -102,13 +102,6 @@ config ARCH_HAS_MMU
+ 	  then answer N here.  Normally, Linux runs on systems with an MMU.  
+ 	  If you are building a uClinux system, answer N.
+ 
+-	  Most people will answer Y.
+-
+-config ARCH_USE_MMU
+-	bool "Do you want to utilize the MMU?"
+-	depends on ARCH_HAS_MMU
+-	default y
+-	help
+ 	  If your target CPU has a MMU, and you wish to actually utilize it,
+ 	  then answer Y here.  Normal Linux requires an MMU.
+ 
+diff --git a/extra/Configs/Config.powerpc b/extra/Configs/Config.powerpc
+index 84c4423..6b09f47 100644
+--- a/extra/Configs/Config.powerpc
++++ b/extra/Configs/Config.powerpc
+@@ -11,7 +11,6 @@ config FORCE_OPTIONS_FOR_ARCH
+ 	bool
+ 	default y
+ 	select ARCH_BIG_ENDIAN
+-	select ARCH_HAS_MMU
+ 
+ choice
+ 	prompt "Target Processor Type"
+diff --git a/extra/Configs/Config.sh b/extra/Configs/Config.sh
+index 10e9d8b..ce86ef3 100644
+--- a/extra/Configs/Config.sh
++++ b/extra/Configs/Config.sh
+@@ -37,7 +37,6 @@ config CONFIG_SH2
+ 	bool "SH2"
+ 
+ config CONFIG_SH3
+-	select ARCH_HAS_MMU
+ 	bool "SH3"
+ 
+ config CONFIG_SH4
+diff --git a/extra/Configs/Config.sh64 b/extra/Configs/Config.sh64
+index 02535b9..a8c22bd 100644
+--- a/extra/Configs/Config.sh64
++++ b/extra/Configs/Config.sh64
+@@ -25,7 +25,6 @@ choice
+ 	  - "SH5" SuperH SH-5 101, 103
+ 
+ config CONFIG_SH5
+-	select ARCH_HAS_MMU
+ 	select UCLIBC_HAS_LFS
+ 	bool "SH5"
+ 
+diff --git a/extra/Configs/Config.x86_64 b/extra/Configs/Config.x86_64
+index 1b28088..80c9e08 100644
+--- a/extra/Configs/Config.x86_64
++++ b/extra/Configs/Config.x86_64
+@@ -11,4 +11,3 @@ config FORCE_OPTIONS_FOR_ARCH
+ 	bool
+ 	default y
+ 	select ARCH_LITTLE_ENDIAN
+-	select ARCH_HAS_MMU
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/alt-uClibc-ruserpass.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,40 @@
+diff -ru uClibc/include/netdb.h uClibc.new/include/netdb.h
+--- uClibc/include/netdb.h	2010-04-02 10:34:27.000000000 -0500
++++ uClibc.new/include/netdb.h	2010-11-13 14:40:03.000000000 -0600
+@@ -483,12 +483,6 @@
+ #endif	/* misc */
+ 
+ 
+-/* ruserpass - remote password check.
+-   This function also exists in glibc but is undocumented */
+-extern int ruserpass(const char *host, const char **aname, const char **apass);
+-libc_hidden_proto(ruserpass)
+-
+-
+ #ifdef __USE_BSD
+ /* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD.
+    The local user is LOCUSER, on the remote machine the command is
+diff -ru uClibc/libc/inet/rpc/rexec.c uClibc.new/libc/inet/rpc/rexec.c
+--- uClibc/libc/inet/rpc/rexec.c	2010-04-02 10:34:27.000000000 -0500
++++ uClibc.new/libc/inet/rpc/rexec.c	2010-11-13 16:23:37.000000000 -0600
+@@ -48,6 +48,8 @@
+ /* int rexecoptions; - google does not know it */
+ static char ahostbuf[NI_MAXHOST];
+ 
++int ruserpass(const char *host, const char **aname, const char **apass);
++
+ int
+ rexec_af(char **ahost, int rport, const char *name, const char *pass, const char *cmd, int *fd2p, sa_family_t af)
+ {
+diff -ru uClibc/libc/inet/rpc/ruserpass.c uClibc.new/libc/inet/rpc/ruserpass.c
+--- uClibc/libc/inet/rpc/ruserpass.c	2010-04-02 10:34:27.000000000 -0500
++++ uClibc.new/libc/inet/rpc/ruserpass.c	2010-11-13 16:25:27.000000000 -0600
+@@ -283,7 +283,7 @@
+ 	(void) fclose(cfile);
+ 	return (-1);
+ }
+-libc_hidden_def(ruserpass)
++libc_hidden_proto(ruserpass)
+ 
+ static int
+ token(void)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/alt-uClibc-schedparam.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,1 @@
+uClibc-schedparam.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/uClibc-backport-humor-udev.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,157 @@
+Udev is quite possibly the most brittle program in the history of Linux.
+
+commit 83333e9c873e4eca6b2c945f7770b1f5373b0427
+Author: Vladimir Zapolskiy <vzapolskiy@gmail.com>
+Date:   Tue Jun 1 20:02:39 2010 +0400
+
+    bits/socket.h: add SOCK_CLOEXEC and SOCK_NONBLOCK support
+    
+    This patch adds support for SOCK_CLOEXEC and SOCK_NONBLOCK socket
+    descriptor flags, which are introduced since Linux 2.6.27
+    
+    Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
+    Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+diff --git a/libc/sysdeps/linux/common/bits/socket.h b/libc/sysdeps/linux/common/bits/socket.h
+index ac5a433..11f6e97 100644
+--- a/libc/sysdeps/linux/common/bits/socket.h
++++ b/libc/sysdeps/linux/common/bits/socket.h
+@@ -53,10 +53,20 @@ enum __socket_type
+   SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based,
+ 				   datagrams of fixed maximum length.  */
+ #define SOCK_SEQPACKET SOCK_SEQPACKET
+-  SOCK_PACKET = 10		/* Linux specific way of getting packets
++  SOCK_PACKET = 10,		/* Linux specific way of getting packets
+ 				   at the dev level.  For writing rarp and
+ 				   other similar things on the user level. */
+ #define SOCK_PACKET SOCK_PACKET
++
++  /* Flags to be ORed into the type parameter of socket and socketpair and
++     used for the flags parameter of paccept.  */
++
++  SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the
++				   new descriptor(s).  */
++#define SOCK_CLOEXEC SOCK_CLOEXEC
++  SOCK_NONBLOCK = 04000		/* Atomically mark descriptor(s) as
++				   non-blocking.  */
++#define SOCK_NONBLOCK SOCK_NONBLOCK
+ };
+ 
+ /* Protocol families.  */
+commit c6d6237819037168a6923ac080e348e54615422c
+Author: Vladimir Zapolskiy <vzapolskiy@gmail.com>
+Date:   Tue Jun 1 23:22:57 2010 +0400
+
+    endian.h: add BSD convertions between big/little-endian byte order
+    
+    This patch adds support for convertion of values between host and
+    big-/little-endian byte order.
+    
+    Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
+    Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+
+diff --git a/include/endian.h b/include/endian.h
+index 2f7bce1..0ba7384 100644
+--- a/include/endian.h
++++ b/include/endian.h
+@@ -55,4 +55,42 @@
+ # define __LONG_LONG_PAIR(HI, LO) HI, LO
+ #endif
+ 
++
++#ifdef __USE_BSD
++/* Conversion interfaces.  */
++# include <byteswap.h>
++
++# if __BYTE_ORDER == __LITTLE_ENDIAN
++#  define htobe16(x) __bswap_16 (x)
++#  define htole16(x) (x)
++#  define be16toh(x) __bswap_16 (x)
++#  define le16toh(x) (x)
++
++#  define htobe32(x) __bswap_32 (x)
++#  define htole32(x) (x)
++#  define be32toh(x) __bswap_32 (x)
++#  define le32toh(x) (x)
++
++#  define htobe64(x) __bswap_64 (x)
++#  define htole64(x) (x)
++#  define be64toh(x) __bswap_64 (x)
++#  define le64toh(x) (x)
++# else
++#  define htobe16(x) (x)
++#  define htole16(x) __bswap_16 (x)
++#  define be16toh(x) (x)
++#  define le16toh(x) __bswap_16 (x)
++
++#  define htobe32(x) (x)
++#  define htole32(x) __bswap_32 (x)
++#  define be32toh(x) (x)
++#  define le32toh(x) __bswap_32 (x)
++
++#  define htobe64(x) (x)
++#  define htole64(x) __bswap_64 (x)
++#  define be64toh(x) (x)
++#  define le64toh(x) __bswap_64 (x)
++# endif
++#endif
++
+ #endif	/* endian.h */
+commit a2e5630af426f85fdd8721b2820786d9bd2aa695
+Author: Vladimir Zapolskiy <vzapolskiy@gmail.com>
+Date:   Tue Jun 1 20:02:54 2010 +0400
+
+    inotify: add inotify_init1 system call support
+    
+    This patch introduces support for inotify_init1 system call, found
+    since Linux 2.6.27.
+    
+    Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
+    Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+diff --git a/libc/sysdeps/linux/common/inotify.c b/libc/sysdeps/linux/common/inotify.c
+index e5a6120..e35f043 100644
+--- a/libc/sysdeps/linux/common/inotify.c
++++ b/libc/sysdeps/linux/common/inotify.c
+@@ -15,6 +15,10 @@
+ _syscall0(int, inotify_init)
+ #endif
+ 
++#ifdef __NR_inotify_init1
++_syscall1(int, inotify_init1, int, flags)
++#endif
++
+ #ifdef __NR_inotify_add_watch
+ _syscall3(int, inotify_add_watch, int, fd, const char *, path, uint32_t, mask)
+ #endif
+diff --git a/libc/sysdeps/linux/common/sys/inotify.h b/libc/sysdeps/linux/common/sys/inotify.h
+index 0131db9..dc4e19d 100644
+--- a/libc/sysdeps/linux/common/sys/inotify.h
++++ b/libc/sysdeps/linux/common/sys/inotify.h
+@@ -22,6 +22,16 @@
+ #include <stdint.h>
+ 
+ 
++/* Flags for the parameter of inotify_init1.  */
++enum
++  {
++    IN_CLOEXEC = 02000000,
++#define IN_CLOEXEC IN_CLOEXEC
++    IN_NONBLOCK = 04000
++#define IN_NONBLOCK IN_NONBLOCK
++  };
++
++
+ /* Structure describing an inotify event.  */
+ struct inotify_event
+ {
+@@ -79,6 +89,9 @@ __BEGIN_DECLS
+ /* Create and initialize inotify instance.  */
+ extern int inotify_init (void) __THROW;
+ 
++/* Create and initialize inotify instance.  */
++extern int inotify_init1 (int __flags) __THROW;
++
+ /* Add watch of object NAME to inotify instance FD.  Notify about
+    events specified by MASK.  */
+ extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/uClibc-fix-arm-unwind-001.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,11 @@
+--- a/libc/sysdeps/linux/arm/Makefile.arch	2007-03-06 02:06:26.000000000 -0600
++++ b/libc/sysdeps/linux/arm/Makefile.arch	2009-04-06 02:59:26.000000000 -0500
+@@ -15,7 +15,7 @@
+ ifeq ($(CONFIG_ARM_EABI),y)
+ CSRC += aeabi_assert.c aeabi_atexit.c aeabi_errno_addr.c \
+ 	aeabi_localeconv.c aeabi_memclr.c aeabi_memcpy.c \
+-	aeabi_memmove.c aeabi_memset.c find_exidx.c
++	aeabi_memmove.c aeabi_memset.c find_exidx.c aeabi_unwind_cpp_pr1.c
+ SSRC += syscall-eabi.S
+ ARCH_OBJ_FILTEROUT := syscall.c
+ ifeq ($(UCLIBC_HAS_WCHAR),y)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/uClibc-fix-arm-unwind-002.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,26 @@
+--- uClibc/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c	2010-04-02 10:34:27.000000000 -0500
++++ uClibc.bak/libc/sysdeps/linux/arm/aeabi_unwind_cpp_pr1.c	2010-04-05 12:33:50.000000000 -0500
+@@ -24,17 +24,17 @@
+ 
+ #include <stdlib.h>
+ 
+-attribute_hidden void __aeabi_unwind_cpp_pr0 (void);
+-attribute_hidden void __aeabi_unwind_cpp_pr0 (void)
++void __aeabi_unwind_cpp_pr0 (void);
++void __aeabi_unwind_cpp_pr0 (void)
+ {
+ }
+ 
+-attribute_hidden void __aeabi_unwind_cpp_pr1 (void);
+-attribute_hidden void __aeabi_unwind_cpp_pr1 (void)
++void __aeabi_unwind_cpp_pr1 (void);
++void __aeabi_unwind_cpp_pr1 (void)
+ {
+ }
+ 
+-attribute_hidden void __aeabi_unwind_cpp_pr2 (void);
+-attribute_hidden void __aeabi_unwind_cpp_pr2 (void)
++void __aeabi_unwind_cpp_pr2 (void);
++void __aeabi_unwind_cpp_pr2 (void)
+ {
+ }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/uClibc-fix-fcntl64.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,20 @@
+--- uClibc/include/fcntl.h	2010-04-02 10:34:27.000000000 -0500
++++ uClibc.bak/include/fcntl.h	2010-05-16 04:54:10.000000000 -0500
+@@ -73,7 +73,7 @@
+ 
+    This function is a cancellation point and therefore not marked with
+    __THROW.  */
+-#ifndef __USE_FILE_OFFSET64
++#if !defined(__USE_FILE_OFFSET64) || defined(__LP64__)
+ extern int fcntl (int __fd, int __cmd, ...);
+ libc_hidden_proto(fcntl)
+ #else
+@@ -83,7 +83,7 @@
+ #  define fcntl fcntl64
+ # endif
+ #endif
+-#ifdef __USE_LARGEFILE64
++#if defined(__USE_LARGEFILE64) && !defined(__LP64__)
+ extern int fcntl64 (int __fd, int __cmd, ...);
+ libc_hidden_proto(fcntl64)
+ #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/uClibc-fixintlassert.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,11 @@
+diff -ruN uClibc/libc/misc/wchar/wchar.c uClibc.bak2/libc/misc/wchar/wchar.c
+--- uClibc/libc/misc/wchar/wchar.c	2010-04-02 10:34:27.000000000 -0500
++++ uClibc.bak2/libc/misc/wchar/wchar.c	2010-11-20 21:57:16.000000000 -0600
+@@ -286,6 +286,7 @@
+ 		s = empty_string;
+ 		n = 1;
+ 	} else if (*s == '\0') {
++		if (pwc) *pwc = 0;
+ 	/* According to the ISO C 89 standard this is the expected behaviour.  */
+ 		return 0;
+ 	} else if (!n) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/uClibc-fixlocalestruct.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,33 @@
+diff -ruN uClibc/libc/sysdeps/linux/common/bits/uClibc_locale.h uClibc.bak/libc/sysdeps/linux/common/bits/uClibc_locale.h
+--- uClibc/libc/sysdeps/linux/common/bits/uClibc_locale.h	2010-04-02 10:34:27.000000000 -0500
++++ uClibc.bak/libc/sysdeps/linux/common/bits/uClibc_locale.h	2010-11-10 15:11:31.000000000 -0600
+@@ -41,11 +41,9 @@
+ 
+ # define __LOCALE_C_ONLY
+ 
+-# ifdef _LIBC
+ #  define __XL_NPP(N) N
+ #  define __LOCALE_PARAM
+ #  define __LOCALE_ARG
+-# endif
+ 
+ #endif
+ 
+@@ -90,8 +88,6 @@
+ struct __uclibc_locale_struct;
+ typedef struct __uclibc_locale_struct *__locale_t;
+ 
+-#ifdef _LIBC
+-
+ /* extern void _locale_set(const unsigned char *p); */
+ /* extern void _locale_init(void); */
+ 
+@@ -367,8 +363,6 @@
+ #endif
+ /**********************************************************************/
+ 
+-#endif /* _LIBC */
+-
+ #endif /* !defined(__LOCALE_C_ONLY) */
+ 
+ #endif /* _UCLIBC_LOCALE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/uClibc-fixm68k.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,12 @@
+--- uClibc/Rules.mak	2010-04-02 10:34:27.000000000 -0500
++++ uClibc.bak/Rules.mak	2010-04-12 00:08:21.000000000 -0500
+@@ -173,7 +173,9 @@
+ 
+ OPTIMIZATION:=
+ # Use '-Os' optimization if available, else use -O2, allow Config to override
++ifneq ($(TARGET_ARCH),m68k)
+ OPTIMIZATION+=$(call check_gcc,-Os,-O2)
++endif
+ # Use the gcc 3.4 -funit-at-a-time optimization when available
+ OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,)
+ # shrinks code by about 0.1%
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/uClibc-futimes.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,56 @@
+User Mode Linux needs futimes().
+
+--- uClibc/include/sys/time.h	2005-11-30 11:07:06.000000000 -0600
++++ uClibc2/include/sys/time.h	2009-11-14 04:55:32.000000000 -0600
+@@ -143,7 +143,9 @@
+ /* Same as `utimes', but does not follow symbolic links.  */
+ extern int lutimes (__const char *__file, __const struct timeval __tvp[2])
+      __THROW __nonnull ((1));
++#endif
+ 
++#ifdef __USE_BSD
+ /* Same as `utimes', but takes an open file descriptor instead of a name.  */
+ extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW;
+ #endif
+--- /dev/null	2009-08-01 20:56:12.000000000 -0500
++++ uClibc2/libc/sysdeps/linux/common/futimes.c	2009-11-14 04:53:49.000000000 -0600
+@@ -0,0 +1,39 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * futimes() for uClibc
++ *
++ * Copyright (C) 2009 Rob Landley <rob@landley.net>
++ *
++ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
++ */
++
++#define _SYSCALL_H
++#include <bits/syscalls.h>
++#include <utime.h>
++#include <sys/time.h>
++
++#ifdef __NR_utimensat
++libc_hidden_proto(futimes)
++
++int futimes(const int fd, const struct timeval tvp[2])
++{
++	struct timespec ts[2], *pts = ts;
++	int ret;
++	INTERNAL_SYSCALL_DECL(err);
++
++	/* Convert timeval to timespec, for syscall */
++
++	if (tvp) {
++		TIMEVAL_TO_TIMESPEC(tvp, ts);
++		TIMEVAL_TO_TIMESPEC(tvp+1, ts+1);
++	} else pts = 0;
++
++	/* Make syscall */
++
++	ret = INTERNAL_SYSCALL_NCS(utimensat, dummy, 4, fd, 0, pts, 0);
++	if (INTERNAL_SYSCALL_ERROR_P (ret, err))
++		return INTERNAL_SYSCALL_ERRNO (ret, err);
++	return 0;
++}
++libc_hidden_def(futimes)
++#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/uClibc-mips64.patch	Sat May 21 23:37:31 2011 -0500
@@ -0,0 +1,15 @@
+diff --git a/ldso/ldso/mips/elfinterp.c b/ldso/ldso/mips/elfinterp.c
+index b6e0932..a56ee81 100644
+--- a/ldso/ldso/mips/elfinterp.c
++++ b/ldso/ldso/mips/elfinterp.c
+@@ -172,8 +172,8 @@ int _dl_parse_relocation_information(struct dyn_elf *xpnt,
+ 	for (i = 0; i < rel_size; i++, rpnt++) {
+ 		reloc_addr = (unsigned long *) (tpnt->loadaddr +
+ 			(unsigned long) rpnt->r_offset);
+-		reloc_type = ELF32_R_TYPE(rpnt->r_info);
+-		symtab_index = ELF32_R_SYM(rpnt->r_info);
++		reloc_type = ELF_R_TYPE(rpnt->r_info);
++		symtab_index = ELF_R_SYM(rpnt->r_info);
+ 		symbol_addr = 0;
+ 
+ 		debug_sym(symtab,strtab,symtab_index);
--- a/sources/patches/uClibc-mmu.patch	Sat May 21 22:56:09 2011 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
-diff --git a/extra/Configs/Config.alpha b/extra/Configs/Config.alpha
-index 144924a..9aab976 100644
---- a/extra/Configs/Config.alpha
-+++ b/extra/Configs/Config.alpha
-@@ -11,6 +11,5 @@ config FORCE_OPTIONS_FOR_ARCH
- 	bool
- 	default y
- 	select ARCH_LITTLE_ENDIAN
--	select ARCH_HAS_MMU
- 	select ARCH_HAS_NO_LDSO
- 	select UCLIBC_HAS_LFS
-diff --git a/extra/Configs/Config.arm b/extra/Configs/Config.arm
-index b060ace..5c919b4 100644
---- a/extra/Configs/Config.arm
-+++ b/extra/Configs/Config.arm
-@@ -62,11 +62,9 @@ config CONFIG_GENERIC_ARM
- 
- config CONFIG_ARM610
- 	bool "Arm 610"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM710
- 	bool "Arm 710"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM7TDMI
- 	bool "Arm 7TDMI"
-@@ -74,35 +72,27 @@ config CONFIG_ARM7TDMI
- 
- config CONFIG_ARM720T
- 	bool "Arm 720T"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM920T
- 	bool "Arm 920T"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM922T
- 	bool "Arm 922T"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM926T
- 	bool "Arm 926T"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM10T
- 	bool "Arm 10T"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM1136JF_S
- 	bool "Arm 1136JF-S"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM1176JZ_S
- 	bool "Arm 1176JZ-S"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM1176JZF_S
- 	bool "Arm 1176JZF-S"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM_CORTEX_M3
- 	bool "Arm Cortex-M3"
-@@ -116,18 +106,14 @@ config CONFIG_ARM_CORTEX_M1
- 
- config CONFIG_ARM_SA110
- 	bool "Intel StrongArm SA-110"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM_SA1100
- 	bool "Intel StrongArm SA-1100"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM_XSCALE
- 	bool "Intel Xscale"
--	select ARCH_HAS_MMU
- 
- config CONFIG_ARM_IWMMXT
- 	bool "Intel Xscale With WMMX PXA27x"
--	select ARCH_HAS_MMU
- 
- endchoice
-diff --git a/extra/Configs/Config.avr32 b/extra/Configs/Config.avr32
-index cbadb4c..a5eb157 100644
---- a/extra/Configs/Config.avr32
-+++ b/extra/Configs/Config.avr32
-@@ -19,7 +19,6 @@ choice
- 
- config CONFIG_AVR32_AP7
- 	bool "AVR32 AP7"
--	select ARCH_HAS_MMU
- 
- endchoice
- 
-diff --git a/extra/Configs/Config.cris b/extra/Configs/Config.cris
-index 52ca0c3..db9293c 100644
---- a/extra/Configs/Config.cris
-+++ b/extra/Configs/Config.cris
-@@ -24,11 +24,9 @@ choice
- 		- CRISv32  Support for Axis' CRISv32 architecture.
- 
- config CONFIG_CRIS
--	select ARCH_HAS_MMU
- 	bool "CRIS"
- 
- config CONFIG_CRISV32
--	select ARCH_HAS_MMU
- 	bool "CRISv32"
- 
- endchoice
-diff --git a/extra/Configs/Config.hppa b/extra/Configs/Config.hppa
-index 1323de2..b8699bf 100644
---- a/extra/Configs/Config.hppa
-+++ b/extra/Configs/Config.hppa
-@@ -11,7 +11,6 @@ config FORCE_OPTIONS_FOR_ARCH
- 	bool
- 	default y
- 	select ARCH_BIG_ENDIAN
--	select ARCH_HAS_MMU
- 	select HAS_NO_THREADS
- 	select ARCH_HAS_NO_LDSO
- 	select HAVE_NO_SSP
-diff --git a/extra/Configs/Config.i386 b/extra/Configs/Config.i386
-index 288aa5e..f23646c 100644
---- a/extra/Configs/Config.i386
-+++ b/extra/Configs/Config.i386
-@@ -11,7 +11,6 @@ config FORCE_OPTIONS_FOR_ARCH
- 	bool
- 	default y
- 	select ARCH_LITTLE_ENDIAN
--	select ARCH_HAS_MMU
- 
- choice
- 	prompt "Target x86 Processor Family"
-diff --git a/extra/Configs/Config.ia64 b/extra/Configs/Config.ia64
-index ae88be7..c7a1f63 100644
---- a/extra/Configs/Config.ia64
-+++ b/extra/Configs/Config.ia64
-@@ -11,5 +11,4 @@ config FORCE_OPTIONS_FOR_ARCH
- 	bool
- 	default y
- 	select ARCH_LITTLE_ENDIAN
--	select ARCH_HAS_MMU
- 	select ARCH_HAS_NO_LDSO
-diff --git a/extra/Configs/Config.in.arch b/extra/Configs/Config.in.arch
-index 8a02cb1..4679517 100644
---- a/extra/Configs/Config.in.arch
-+++ b/extra/Configs/Config.in.arch
-@@ -93,7 +93,7 @@ if ARCH_HAS_NO_MMU
- comment "Target CPU lacks a memory management unit (MMU)"
- endif
- 
--config ARCH_HAS_MMU
-+config ARCH_USE_MMU
- 	bool "Target CPU has a memory management unit (MMU)"
- 	depends on !ARCH_HAS_NO_MMU
- 	default y
-@@ -102,13 +102,6 @@ config ARCH_HAS_MMU
- 	  then answer N here.  Normally, Linux runs on systems with an MMU.  
- 	  If you are building a uClinux system, answer N.
- 
--	  Most people will answer Y.
--
--config ARCH_USE_MMU
--	bool "Do you want to utilize the MMU?"
--	depends on ARCH_HAS_MMU
--	default y
--	help
- 	  If your target CPU has a MMU, and you wish to actually utilize it,
- 	  then answer Y here.  Normal Linux requires an MMU.
- 
-diff --git a/extra/Configs/Config.powerpc b/extra/Configs/Config.powerpc
-index 84c4423..6b09f47 100644
---- a/extra/Configs/Config.powerpc
-+++ b/extra/Configs/Config.powerpc
-@@ -11,7 +11,6 @@ config FORCE_OPTIONS_FOR_ARCH
- 	bool
- 	default y
- 	select ARCH_BIG_ENDIAN
--	select ARCH_HAS_MMU
- 
- choice
- 	prompt "Target Processor Type"
-diff --git a/extra/Configs/Config.sh b/extra/Configs/Config.sh
-index 10e9d8b..ce86ef3 100644
---- a/extra/Configs/Config.sh
-+++ b/extra/Configs/Config.sh
-@@ -37,7 +37,6 @@ config CONFIG_SH2
- 	bool "SH2"
- 
- config CONFIG_SH3
--	select ARCH_HAS_MMU
- 	bool "SH3"
- 
- config CONFIG_SH4
-diff --git a/extra/Configs/Config.sh64 b/extra/Configs/Config.sh64
-index 02535b9..a8c22bd 100644
---- a/extra/Configs/Config.sh64
-+++ b/extra/Configs/Config.sh64
-@@ -25,7 +25,6 @@ choice
- 	  - "SH5" SuperH SH-5 101, 103
- 
- config CONFIG_SH5
--	select ARCH_HAS_MMU
- 	select UCLIBC_HAS_LFS
- 	bool "SH5"
- 
-diff --git a/extra/Configs/Config.x86_64 b/extra/Configs/Config.x86_64
-index 1b28088..80c9e08 100644
---- a/extra/Configs/Config.x86_64
-+++ b/extra/Configs/Config.x86_64
-@@ -11,4 +11,3 @@ config FORCE_OPTIONS_FOR_ARCH
- 	bool
- 	default y
- 	select ARCH_LITTLE_ENDIAN
--	select ARCH_HAS_MMU
--- a/sources/patches/uClibc-ruserpass.patch	Sat May 21 22:56:09 2011 -0500
+++ b/sources/patches/uClibc-ruserpass.patch	Sat May 21 23:37:31 2011 -0500
@@ -37,4 +37,4 @@
 +libc_hidden_proto(ruserpass)
  
  static int
- token(void)
+ token()