diff options
Diffstat (limited to 'toolchain')
-rw-r--r-- | toolchain/uClibc/Makefile | 14 | ||||
-rw-r--r-- | toolchain/uClibc/Makefile.inc | 1 | ||||
-rw-r--r-- | toolchain/uClibc/patches/0.9.33.2/fix-newer-kernel.patch | 320 | ||||
-rw-r--r-- | toolchain/uClibc/patches/0.9.33.2/target_arch.patch | 24 | ||||
-rw-r--r-- | toolchain/uClibc/patches/uclibc-git-20140212.patch | 116822 | ||||
-rw-r--r-- | toolchain/uClibc/patches/xxx-n32-pread_pwrite.patch | 32 | ||||
-rw-r--r-- | toolchain/uClibc/patches/xxx-origin.patch (renamed from toolchain/uClibc/patches/0.9.33.2/origin.patch) | 49 |
7 files changed, 116888 insertions, 374 deletions
diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile index 6345e239b..f84575a3c 100644 --- a/toolchain/uClibc/Makefile +++ b/toolchain/uClibc/Makefile @@ -53,9 +53,6 @@ ifeq ($(ADK_TARGET_ABI_O32),y) $(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config $(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config endif -ifneq ($(ADK_DEBUG),) - $(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config -endif ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y) $(SED) 's,.*UCLIBC_HAS_SSP,UCLIBC_HAS_SSP=y,' ${WRKBUILD}/.config echo "UCLIBC_HAS_SSP_COMPAT=n" >> ${WRKBUILD}/.config @@ -100,18 +97,21 @@ $(WRKBUILD)/.install_headers: $(WRKBUILD)/.compiled touch $@ $(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers + touch $@ + +$(WRKBUILD)/.fixup: +ifneq ($(ADK_DEBUG),) + $(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config +endif $(MAKE) -C $(WRKBUILD) \ PREFIX=$(STAGING_TARGET_DIR) \ DEVEL_PREFIX=/usr/ \ DEVEL_PREFIX_LIB=/ \ RUNTIME_PREFIX=/ \ CPU_CFLAGS="$(TARGET_CFLAGS)" \ - install_runtime + all install_runtime rm -rf $(STAGING_TARGET_DIR)/lib/libc.so ln -s libc.so.0 $(STAGING_TARGET_DIR)/lib/libc.so touch $@ -$(WRKBUILD)/.fixup: - touch $@ - include ${TOPDIR}/mk/toolchain.mk diff --git a/toolchain/uClibc/Makefile.inc b/toolchain/uClibc/Makefile.inc index cdafb2c9d..60e87966c 100644 --- a/toolchain/uClibc/Makefile.inc +++ b/toolchain/uClibc/Makefile.inc @@ -3,6 +3,7 @@ PKG_NAME:= uClibc PKG_VERSION:= 0.9.33.2 +GIT_VERSION:= 0.9.34-git PKG_RELEASE:= 1 PKG_MD5SUM:= a338aaffc56f0f5040e6d9fa8a12eda1 PKG_SITES:= http://uclibc.org/downloads/ diff --git a/toolchain/uClibc/patches/0.9.33.2/fix-newer-kernel.patch b/toolchain/uClibc/patches/0.9.33.2/fix-newer-kernel.patch deleted file mode 100644 index d790664ba..000000000 --- a/toolchain/uClibc/patches/0.9.33.2/fix-newer-kernel.patch +++ /dev/null @@ -1,320 +0,0 @@ -From 6a76edddaa62ff06f178143b582167734cb55c18 Mon Sep 17 00:00:00 2001 -From: Chris Packham <chris.packham@alliedtelesis.co.nz> -Date: Mon, 01 Oct 2012 05:12:54 +0000 -Subject: libc/sysdeps: add __kernel_long and __kernel_ulong - -Linux 3.4 added __kernel_long_t and __kernel_ulong_t and various -exported header files were updated to use these new types. Add the -definitions for __kernel_long_t and __kernel_ulong_t to the relevant -kernel_types.h headers. - -This change was automated with the following scriptlet - - git grep --name-only 'typedef.*__kernel_old_dev_t' \ - | xargs sed -i '/typedef.*__kernel_old_dev_t/ a\ - typedef long\t\t__kernel_long_t;\ - typedef unsigned long\t__kernel_ulong_t;' - -Whitespace in arm, avr32, hppa, sparc was then manually fixed up. - -Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> --- -Here's a cleaned up patch which should get the whitespace right. I'm a -bit iffy about the sparc changes they make sense to me but it's not a -platform I have access to. - -I can break this up per arch or per maintainer if requested. - - libc/sysdeps/linux/alpha/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/arm/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/avr32/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/bfin/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/c6x/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/cris/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/e1/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/h8300/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/hppa/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/i386/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/ia64/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/m68k/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/microblaze/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/mips/bits/kernel_types.h | 4 ++++ - libc/sysdeps/linux/nios2/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/powerpc/bits/kernel_types.h | 4 ++++ - libc/sysdeps/linux/sh/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/sh64/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/sparc/bits/kernel_types.h | 4 ++++ - libc/sysdeps/linux/v850/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/x86_64/bits/kernel_types.h | 2 ++ - libc/sysdeps/linux/xtensa/bits/kernel_types.h | 2 ++ - 22 files changed, 50 insertions(+) -Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> ---- ---- a/libc/sysdeps/linux/alpha/bits/kernel_types.h -+++ b/libc/sysdeps/linux/alpha/bits/kernel_types.h -@@ -33,6 +33,8 @@ typedef __kernel_gid_t __kernel_old_gid_ - typedef __kernel_uid_t __kernel_uid32_t; - typedef __kernel_gid_t __kernel_gid32_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - - typedef struct { - int val[2]; ---- a/libc/sysdeps/linux/arm/bits/kernel_types.h -+++ b/libc/sysdeps/linux/arm/bits/kernel_types.h -@@ -32,6 +32,8 @@ typedef unsigned short __kernel_old_uid - typedef unsigned short __kernel_old_gid_t; - typedef long long __kernel_loff_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - - typedef struct { - #ifdef __USE_ALL ---- a/libc/sysdeps/linux/avr32/bits/kernel_types.h -+++ b/libc/sysdeps/linux/avr32/bits/kernel_types.h -@@ -39,6 +39,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned short __kernel_old_uid_t; - typedef unsigned short __kernel_old_gid_t; - typedef unsigned short __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - - #ifdef __GNUC__ - typedef long long __kernel_loff_t; ---- a/libc/sysdeps/linux/bfin/bits/kernel_types.h -+++ b/libc/sysdeps/linux/bfin/bits/kernel_types.h -@@ -32,6 +32,8 @@ typedef unsigned short __kernel_old_uid_ - typedef unsigned short __kernel_old_gid_t; - typedef long long __kernel_loff_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - - typedef struct { - #ifdef __USE_ALL ---- a/libc/sysdeps/linux/c6x/bits/kernel_types.h -+++ b/libc/sysdeps/linux/c6x/bits/kernel_types.h -@@ -22,6 +22,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned int __kernel_old_uid_t; - typedef unsigned int __kernel_old_gid_t; - typedef unsigned int __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef unsigned int __kernel_size_t; - typedef int __kernel_ssize_t; - typedef int __kernel_ptrdiff_t; ---- a/libc/sysdeps/linux/cris/bits/kernel_types.h -+++ b/libc/sysdeps/linux/cris/bits/kernel_types.h -@@ -28,6 +28,8 @@ typedef unsigned int __kernel_gid32_t - typedef unsigned short __kernel_old_uid_t; - typedef unsigned short __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - - #ifdef __GNUC__ - typedef long long __kernel_loff_t; ---- a/libc/sysdeps/linux/e1/bits/kernel_types.h -+++ b/libc/sysdeps/linux/e1/bits/kernel_types.h -@@ -31,6 +31,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned short __kernel_old_uid_t; - typedef unsigned short __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef long long __kernel_loff_t; - - /* ---- a/libc/sysdeps/linux/h8300/bits/kernel_types.h -+++ b/libc/sysdeps/linux/h8300/bits/kernel_types.h -@@ -32,6 +32,8 @@ typedef unsigned short __kernel_old_uid_ - typedef unsigned short __kernel_old_gid_t; - typedef long long __kernel_loff_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - - typedef struct { - #ifdef __USE_ALL ---- a/libc/sysdeps/linux/hppa/bits/kernel_types.h -+++ b/libc/sysdeps/linux/hppa/bits/kernel_types.h -@@ -45,6 +45,8 @@ typedef long long __kernel_off64_t; - typedef unsigned long long __kernel_ino64_t; - - typedef unsigned int __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - - typedef struct { - #ifdef __USE_ALL ---- a/libc/sysdeps/linux/i386/bits/kernel_types.h -+++ b/libc/sysdeps/linux/i386/bits/kernel_types.h -@@ -40,6 +40,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned short __kernel_old_uid_t; - typedef unsigned short __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef long long __kernel_loff_t; - - typedef struct { ---- a/libc/sysdeps/linux/ia64/bits/kernel_types.h -+++ b/libc/sysdeps/linux/ia64/bits/kernel_types.h -@@ -52,5 +52,7 @@ typedef __kernel_gid_t __kernel_gid32_t; - - typedef unsigned int __kernel_dev_t; - typedef unsigned int __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - - #endif /* _ASM_IA64_POSIX_TYPES_H */ ---- a/libc/sysdeps/linux/m68k/bits/kernel_types.h -+++ b/libc/sysdeps/linux/m68k/bits/kernel_types.h -@@ -32,6 +32,8 @@ typedef unsigned short __kernel_old_uid_ - typedef unsigned short __kernel_old_gid_t; - typedef long long __kernel_loff_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - - typedef struct { - #ifdef __USE_ALL ---- a/libc/sysdeps/linux/microblaze/bits/kernel_types.h -+++ b/libc/sysdeps/linux/microblaze/bits/kernel_types.h -@@ -44,6 +44,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned int __kernel_old_uid_t; - typedef unsigned int __kernel_old_gid_t; - typedef unsigned int __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - - #ifdef __GNUC__ - typedef long long __kernel_loff_t; ---- a/libc/sysdeps/linux/mips/bits/kernel_types.h -+++ b/libc/sysdeps/linux/mips/bits/kernel_types.h -@@ -32,6 +32,8 @@ typedef int __kernel_gid32_t; - typedef __kernel_uid_t __kernel_old_uid_t; - typedef __kernel_gid_t __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef long long __kernel_loff_t; - #else - typedef unsigned int __kernel_dev_t; -@@ -68,6 +70,8 @@ typedef int __kernel_gid32_t; - typedef __kernel_uid_t __kernel_old_uid_t; - typedef __kernel_gid_t __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef long long __kernel_loff_t; - #endif - ---- a/libc/sysdeps/linux/nios2/bits/kernel_types.h -+++ b/libc/sysdeps/linux/nios2/bits/kernel_types.h -@@ -31,6 +31,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned short __kernel_old_uid_t; - typedef unsigned short __kernel_old_gid_t; - typedef unsigned short __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef long long __kernel_loff_t; - - typedef struct { ---- a/libc/sysdeps/linux/powerpc/bits/kernel_types.h -+++ b/libc/sysdeps/linux/powerpc/bits/kernel_types.h -@@ -36,6 +36,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned int __kernel_old_uid_t; - typedef unsigned int __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - #else - typedef unsigned int __kernel_dev_t; - typedef unsigned int __kernel_ino_t; -@@ -61,6 +63,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned int __kernel_old_uid_t; - typedef unsigned int __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef long long __kernel_loff_t; - #endif - ---- a/libc/sysdeps/linux/sh/bits/kernel_types.h -+++ b/libc/sysdeps/linux/sh/bits/kernel_types.h -@@ -32,6 +32,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned short __kernel_old_uid_t; - typedef unsigned short __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef long long __kernel_loff_t; - - typedef struct { ---- a/libc/sysdeps/linux/sh64/bits/kernel_types.h -+++ b/libc/sysdeps/linux/sh64/bits/kernel_types.h -@@ -43,6 +43,8 @@ typedef unsigned int __kernel_gid32_t - typedef unsigned short __kernel_old_uid_t; - typedef unsigned short __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef long long __kernel_loff_t; - - typedef struct { ---- a/libc/sysdeps/linux/sparc/bits/kernel_types.h -+++ b/libc/sysdeps/linux/sparc/bits/kernel_types.h -@@ -32,6 +32,8 @@ typedef unsigned short __kernel_g - typedef __kernel_uid_t __kernel_old_uid_t; - typedef __kernel_gid_t __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef __kernel_uid_t __kernel_uid32_t; - typedef __kernel_gid_t __kernel_gid32_t; - typedef int __kernel_suseconds_t; -@@ -62,6 +64,8 @@ typedef unsigned int __kernel_gid - typedef unsigned short __kernel_old_uid_t; - typedef unsigned short __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef long long __kernel_loff_t; - #endif - ---- a/libc/sysdeps/linux/v850/bits/kernel_types.h -+++ b/libc/sysdeps/linux/v850/bits/kernel_types.h -@@ -41,6 +41,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned short __kernel_old_uid_t; - typedef unsigned short __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - - typedef struct { - #ifdef __USE_ALL ---- a/libc/sysdeps/linux/x86_64/bits/kernel_types.h -+++ b/libc/sysdeps/linux/x86_64/bits/kernel_types.h -@@ -40,6 +40,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned short __kernel_old_uid_t; - typedef unsigned short __kernel_old_gid_t; - typedef __kernel_dev_t __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef long long __kernel_loff_t; - - typedef struct { ---- a/libc/sysdeps/linux/xtensa/bits/kernel_types.h -+++ b/libc/sysdeps/linux/xtensa/bits/kernel_types.h -@@ -33,6 +33,8 @@ typedef unsigned int __kernel_gid32_t; - typedef unsigned short __kernel_old_uid_t; - typedef unsigned short __kernel_old_gid_t; - typedef unsigned short __kernel_old_dev_t; -+typedef long __kernel_long_t; -+typedef unsigned long __kernel_ulong_t; - typedef long long __kernel_loff_t; - - /* Beginning in 2.6 kernels, which is the first version that includes the diff --git a/toolchain/uClibc/patches/0.9.33.2/target_arch.patch b/toolchain/uClibc/patches/0.9.33.2/target_arch.patch deleted file mode 100644 index 8bdf1f30f..000000000 --- a/toolchain/uClibc/patches/0.9.33.2/target_arch.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Nur uClibc-0.9.33.2.orig/Rules.mak uClibc-0.9.33.2/Rules.mak ---- uClibc-0.9.33.2.orig/Rules.mak 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc-0.9.33.2/Rules.mak 2013-04-19 12:52:32.000000000 +0200 -@@ -118,12 +118,17 @@ - LIBC := libc - SHARED_LIBNAME := $(LIBC).so.$(ABI_VERSION) - UBACKTRACE_DSO := libubacktrace.so.$(ABI_VERSION) --ifneq ($(findstring $(TARGET_ARCH) , hppa64 ia64 mips64 powerpc64 s390x sparc64 x86_64 ),) -+ -+UCLIBC_LDSO_NAME := ld-uClibc -+ARCH_NATIVE_BIT := 32 -+ifneq ($(findstring $(TARGET_ARCH) , hppa64 ia64 powerpc64 s390x sparc64 x86_64 ),) - UCLIBC_LDSO_NAME := ld64-uClibc - ARCH_NATIVE_BIT := 64 - else --UCLIBC_LDSO_NAME := ld-uClibc --ARCH_NATIVE_BIT := 32 -+ifeq ($(CONFIG_MIPS_N64_ABI),y) -+UCLIBC_LDSO_NAME := ld64-uClibc -+ARCH_NATIVE_BIT := 64 -+endif - endif - UCLIBC_LDSO := $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) - NONSHARED_LIBNAME := uclibc_nonshared.a diff --git a/toolchain/uClibc/patches/uclibc-git-20140212.patch b/toolchain/uClibc/patches/uclibc-git-20140212.patch new file mode 100644 index 000000000..049e3e5f3 --- /dev/null +++ b/toolchain/uClibc/patches/uclibc-git-20140212.patch @@ -0,0 +1,116822 @@ +diff -Nur uClibc-0.9.33.2/docs/man/arc4random.3 uClibc/docs/man/arc4random.3 +--- uClibc-0.9.33.2/docs/man/arc4random.3 1970-01-01 01:00:00.000000000 +0100 ++++ uClibc/docs/man/arc4random.3 2014-02-03 12:32:56.000000000 +0100 +@@ -0,0 +1,110 @@ ++.\" $OpenBSD: arc4random.3,v 1.19 2005/07/17 08:50:55 jaredy Exp $ ++.\" ++.\" Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> ++.\" All rights reserved. ++.\" ++.\" Redistribution and use in source and binary forms, with or without ++.\" modification, are permitted provided that the following conditions ++.\" are met: ++.\" 1. Redistributions of source code must retain the above copyright ++.\" notice, this list of conditions and the following disclaimer. ++.\" 2. Redistributions in binary form must reproduce the above copyright ++.\" notice, this list of conditions and the following disclaimer in the ++.\" documentation and/or other materials provided with the distribution. ++.\" 3. All advertising materials mentioning features or use of this software ++.\" must display the following acknowledgement: ++.\" This product includes software developed by Niels Provos. ++.\" 4. The name of the author may not be used to endorse or promote products ++.\" derived from this software without specific prior written permission. ++.\" ++.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++.\" ++.\" Manual page, using -mandoc macros ++.\" ++.Dd April 15, 1997 ++.Dt ARC4RANDOM 3 ++.Os ++.Sh NAME ++.Nm arc4random , ++.Nm arc4random_stir , ++.Nm arc4random_addrandom ++.Nd arc4 random number generator ++.Sh SYNOPSIS ++.Fd #include <stdlib.h> ++.Ft uint32_t ++.Fn arc4random "void" ++.Ft void ++.Fn arc4random_stir "void" ++.Ft void ++.Fn arc4random_addrandom "u_char *dat" "int datlen" ++.Sh DESCRIPTION ++The ++.Fn arc4random ++function provides a high quality 32-bit pseudo-random ++number very quickly. ++.Fn arc4random ++seeds itself on a regular basis from the kernel strong random number ++subsystem described in ++.Xr random 4 . ++On each call, an ARC4 generator is used to generate a new result. ++The ++.Fn arc4random ++function uses the ARC4 cipher key stream generator, ++which uses 8*8 8-bit S-Boxes. ++The S-Boxes can be in about (2**1700) states. ++.Pp ++.Fn arc4random ++fits into a middle ground not covered by other subsystems such as ++the strong, slow, and resource expensive random ++devices described in ++.Xr random 4 ++versus the fast but poor quality interfaces described in ++.Xr rand 3 , ++.Xr random 3 , ++and ++.Xr drand48 3 . ++.Pp ++The ++.Fn arc4random_stir ++function reads data from a pseudo-random device, usually ++.Pa /dev/urandom, ++and uses it to permute the S-Boxes via ++.Fn arc4random_addrandom . ++.Pp ++There is no need to call ++.Fn arc4random_stir ++before using ++.Fn arc4random , ++since ++.Fn arc4random ++automatically initializes itself. ++.Sh SEE ALSO ++.Xr rand 3 , ++.Xr rand48 3 , ++.Xr random 3 ++.Sh HISTORY ++An algorithm called ++.Pa RC4 ++was designed by RSA Data Security, Inc. ++It was considered a trade secret. ++Because it was a trade secret, it obviously could not be patented. ++A clone of this was posted anonymously to USENET and confirmed to ++be equivalent by several sources who had access to the original cipher. ++Because of the trade secret situation, RSA Data Security, Inc. can do ++nothing about the release of the ARC4 algorithm. ++Since ++.Pa RC4 ++used to be a trade secret, the cipher is now referred to as ++.Pa ARC4 . ++.Pp ++These functions first appeared in ++.Ox 2.1 . +diff -Nur uClibc-0.9.33.2/docs/PORTING uClibc/docs/PORTING +--- uClibc-0.9.33.2/docs/PORTING 2012-05-15 09:20:09.000000000 +0200 ++++ uClibc/docs/PORTING 2014-02-03 12:32:56.000000000 +0100 +@@ -130,9 +130,6 @@ + ==================== + === Misc Cruft === + ==================== +-- utils/readelf.c - not really needed generally speaking, but might as well +- add your arch to the giant EM_* list (describe_elf_hdr) +- + - MAINTAINERS - presumably you're going to submit this code back to mainline + and since you're the only one who cares about this arch (right now), you + should add yourself to the toplevel MAINTAINERS file. do it. +diff -Nur uClibc-0.9.33.2/extra/config/check.sh uClibc/extra/config/check.sh +--- uClibc-0.9.33.2/extra/config/check.sh 2012-05-15 09:20:09.000000000 +0200 ++++ uClibc/extra/config/check.sh 2014-02-03 12:32:56.000000000 +0100 +@@ -1,6 +1,6 @@ + #!/bin/sh + # Needed for systems without gettext +-$* -xc -o /dev/null - > /dev/null 2>&1 << EOF ++$* -x c -o /dev/null - > /dev/null 2>&1 << EOF + #include <libintl.h> + int main() + { +diff -Nur uClibc-0.9.33.2/extra/config/conf.c uClibc/extra/config/conf.c +--- uClibc-0.9.33.2/extra/config/conf.c 2012-05-15 09:20:09.000000000 +0200 ++++ uClibc/extra/config/conf.c 2014-02-03 12:32:56.000000000 +0100 +@@ -10,42 +10,48 @@ + #include <string.h> + #include <time.h> + #include <unistd.h> ++#include <getopt.h> + #include <sys/stat.h> + #include <sys/time.h> ++#include <errno.h> + +-#define LKC_DIRECT_LINK + #include "lkc.h" + + static void conf(struct menu *menu); + static void check_conf(struct menu *menu); ++static void xfgets(char *str, int size, FILE *in); + +-enum { +- ask_all, +- ask_new, +- ask_silent, +- set_default, +- set_yes, +- set_mod, +- set_no, +- set_random +-} input_mode = ask_all; +-char *defconfig_file; ++enum input_mode { ++ oldaskconfig, ++ silentoldconfig, ++ oldconfig, ++ allnoconfig, ++ allyesconfig, ++ allmodconfig, ++ alldefconfig, ++ randconfig, ++ defconfig, ++ savedefconfig, ++ listnewconfig, ++ olddefconfig, ++} input_mode = oldaskconfig; + + static int indent = 1; ++static int tty_stdio; + static int valid_stdin = 1; + static int sync_kconfig; + static int conf_cnt; + static char line[128]; + static struct menu *rootEntry; + +-static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); +- +-static const char *get_help(struct menu *menu) ++static void print_help(struct menu *menu) + { +- if (menu_has_help(menu)) +- return _(menu_get_help(menu)); +- else +- return nohelp_text; ++ struct gstr help = str_new(); ++ ++ menu_get_ext_help(menu, &help); ++ ++ printf("\n%s\n", str_get(&help)); ++ str_free(&help); + } + + static void strip(char *str) +@@ -93,16 +99,19 @@ + } + + switch (input_mode) { +- case ask_new: +- case ask_silent: ++ case oldconfig: ++ case silentoldconfig: + if (sym_has_value(sym)) { + printf("%s\n", def); + return 0; + } + check_stdin(); +- case ask_all: ++ /* fall through */ ++ case oldaskconfig: + fflush(stdout); +- fgets(line, 128, stdin); ++ xfgets(line, 128, stdin); ++ if (!tty_stdio) ++ printf("\n"); + return 1; + default: + break; +@@ -121,7 +130,7 @@ + return 1; + } + +-int conf_string(struct menu *menu) ++static int conf_string(struct menu *menu) + { + struct symbol *sym = menu->sym; + const char *def; +@@ -140,10 +149,11 @@ + case '?': + /* print help */ + if (line[1] == '\n') { +- printf("\n%s\n", get_help(menu)); ++ print_help(menu); + def = NULL; + break; + } ++ /* fall through */ + default: + line[strlen(line)-1] = 0; + def = line; +@@ -156,14 +166,12 @@ + static int conf_sym(struct menu *menu) + { + struct symbol *sym = menu->sym; +- int type; + tristate oldval, newval; + + while (1) { + printf("%*s%s ", indent - 1, "", _(menu->prompt->text)); + if (sym->name) + printf("(%s) ", sym->name); +- type = sym_get_type(sym); + putchar('['); + oldval = sym_get_tristate_value(sym); + switch (oldval) { +@@ -220,7 +228,7 @@ + if (sym_set_tristate_value(sym, newval)) + return 0; + help: +- printf("\n%s\n", get_help(menu)); ++ print_help(menu); + } + } + +@@ -228,11 +236,9 @@ + { + struct symbol *sym, *def_sym; + struct menu *child; +- int type; + bool is_new; + + sym = menu->sym; +- type = sym_get_type(sym); + is_new = !sym_has_value(sym); + if (sym_is_changable(sym)) { + conf_sym(menu); +@@ -294,20 +300,21 @@ + printf("?"); + printf("]: "); + switch (input_mode) { +- case ask_new: +- case ask_silent: ++ case oldconfig: ++ case silentoldconfig: + if (!is_new) { + cnt = def; + printf("%d\n", cnt); + break; + } + check_stdin(); +- case ask_all: ++ /* fall through */ ++ case oldaskconfig: + fflush(stdout); +- fgets(line, 128, stdin); ++ xfgets(line, 128, stdin); + strip(line); + if (line[0] == '?') { +- printf("\n%s\n", get_help(menu)); ++ print_help(menu); + continue; + } + if (!line[0]) +@@ -330,8 +337,8 @@ + } + if (!child) + continue; +- if (line[strlen(line) - 1] == '?') { +- printf("\n%s\n", get_help(child)); ++ if (line[0] && line[strlen(line) - 1] == '?') { ++ print_help(child); + continue; + } + sym_set_choice_value(sym, child->sym); +@@ -360,10 +367,14 @@ + + switch (prop->type) { + case P_MENU: +- if (input_mode == ask_silent && rootEntry != menu) { ++ if ((input_mode == silentoldconfig || ++ input_mode == listnewconfig || ++ input_mode == olddefconfig) && ++ rootEntry != menu) { + check_conf(menu); + return; + } ++ /* fall through */ + case P_COMMENT: + prompt = menu_get_prompt(menu); + if (prompt) +@@ -418,10 +429,16 @@ + if (sym && !sym_has_value(sym)) { + if (sym_is_changable(sym) || + (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) { +- if (!conf_cnt++) +- printf(_("*\n* Restart config...\n*\n")); +- rootEntry = menu_get_parent_menu(menu); +- conf(rootEntry); ++ if (input_mode == listnewconfig) { ++ if (sym->name && !sym_is_choice_value(sym)) { ++ printf("%s%s\n", CONFIG_, sym->name); ++ } ++ } else if (input_mode != olddefconfig) { ++ if (!conf_cnt++) ++ printf(_("*\n* Restart config...\n*\n")); ++ rootEntry = menu_get_parent_menu(menu); ++ conf(rootEntry); ++ } + } + } + +@@ -429,90 +446,170 @@ + check_conf(child); + } + ++#if 00 // || !defined __UCLIBC__ || \ ++ (defined UCLIBC_HAS_GETOPT_LONG || defined UCLIBC_HAS_GNU_GETOPT) ++static struct option long_opts[] = { ++ {"oldaskconfig", no_argument, NULL, oldaskconfig}, ++ {"oldconfig", no_argument, NULL, oldconfig}, ++ {"silentoldconfig", no_argument, NULL, silentoldconfig}, ++ {"defconfig", optional_argument, NULL, defconfig}, ++ {"savedefconfig", required_argument, NULL, savedefconfig}, ++ {"allnoconfig", no_argument, NULL, allnoconfig}, ++ {"allyesconfig", no_argument, NULL, allyesconfig}, ++ {"allmodconfig", no_argument, NULL, allmodconfig}, ++ {"alldefconfig", no_argument, NULL, alldefconfig}, ++ {"randconfig", no_argument, NULL, randconfig}, ++ {"listnewconfig", no_argument, NULL, listnewconfig}, ++ {"olddefconfig", no_argument, NULL, olddefconfig}, ++ /* ++ * oldnoconfig is an alias of olddefconfig, because people already ++ * are dependent on its behavior(sets new symbols to their default ++ * value but not 'n') with the counter-intuitive name. ++ */ ++ {"oldnoconfig", no_argument, NULL, olddefconfig}, ++ {NULL, 0, NULL, 0} ++}; ++ ++static void conf_usage(const char *progname) ++{ ++ ++ printf("Usage: %s [option] <kconfig-file>\n", progname); ++ printf("[option] is _one_ of the following:\n"); ++ printf(" --listnewconfig List new options\n"); ++ printf(" --oldaskconfig Start a new configuration using a line-oriented program\n"); ++ printf(" --oldconfig Update a configuration using a provided .config as base\n"); ++ printf(" --silentoldconfig Same as oldconfig, but quietly, additionally update deps\n"); ++ printf(" --olddefconfig Same as silentoldconfig but sets new symbols to their default value\n"); ++ printf(" --oldnoconfig An alias of olddefconfig\n"); ++ printf(" --defconfig <file> New config with default defined in <file>\n"); ++ printf(" --savedefconfig <file> Save the minimal current configuration to <file>\n"); ++ printf(" --allnoconfig New config where all options are answered with no\n"); ++ printf(" --allyesconfig New config where all options are answered with yes\n"); ++ printf(" --allmodconfig New config where all options are answered with mod\n"); ++ printf(" --alldefconfig New config with all symbols set to default\n"); ++ printf(" --randconfig New config with random answer to all options\n"); ++} ++#else ++static void conf_usage(const char *progname) ++{ ++ ++ printf("Usage: %s [option] <kconfig-file>\n", progname); ++ printf("[option] is _one_ of the following:\n"); ++ printf(" -a, --oldaskconfig Start a new configuration using a line-oriented program\n"); ++ printf(" -s, --silentoldconfig Same as oldconfig, but quietly, additionally update deps\n"); ++ printf(" -o, --oldconfig Update a configuration using a provided .config as base\n"); ++ printf(" -n, --allnoconfig New config where all options are answered with no\n"); ++ printf(" -y, --allyesconfig New config where all options are answered with yes\n"); ++ printf(" -m, --allmodconfig New config where all options are answered with mod\n"); ++ printf(" -A, --alldefconfig New config with all symbols set to default\n"); ++ printf(" -r, --randconfig New config with random answer to all options\n"); ++ printf(" -D, --defconfig <file> New config with default defined in <file>\n"); ++ printf(" -S, --savedefconfig <file> Save the minimal current configuration to <file>\n"); ++ printf(" -l, --listnewconfig List new options\n"); ++ printf(" -d, --olddefconfig Same as silentoldconfig but sets new symbols to their default value\n"); ++ printf(" --oldnoconfig An alias of olddefconfig\n"); ++ ++} ++#endif ++ + int main(int ac, char **av) + { ++ const char *progname = av[0]; + int opt; +- const char *name; +- const char *configname = conf_get_configname(); ++ const char *name, *defconfig_file = NULL /* gcc uninit */; + struct stat tmpstat; + + setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); + +- while ((opt = getopt(ac, av, "osdD:nmyrh")) != -1) { ++ tty_stdio = isatty(0) && isatty(1) && isatty(2); ++ ++#if 00// !defined __UCLIBC__ || \ ++ (defined UCLIBC_HAS_GETOPT_LONG || defined UCLIBC_HAS_GNU_GETOPT) ++ while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) ++#else ++ char *gch = "asonymArDSld"; ++ while ((opt = getopt(ac, av, "asonymArD:S:ldh")) != -1) ++#endif ++ { ++ char *x = memchr(gch, opt, strlen(gch)); ++ if (x == NULL) ++ opt = '?'; ++ else ++ opt = x - gch; ++ input_mode = (enum input_mode)opt; + switch (opt) { +- case 'o': +- input_mode = ask_silent; +- break; +- case 's': +- input_mode = ask_silent; ++ case silentoldconfig: + sync_kconfig = 1; + break; +- case 'd': +- input_mode = set_default; +- break; +- case 'D': +- input_mode = set_default; ++ case defconfig: ++ case savedefconfig: + defconfig_file = optarg; + break; +- case 'n': +- input_mode = set_no; +- break; +- case 'm': +- input_mode = set_mod; +- break; +- case 'y': +- input_mode = set_yes; +- break; +- case 'r': ++ case randconfig: + { + struct timeval now; + unsigned int seed; ++ char *seed_env; + + /* + * Use microseconds derived seed, + * compensate for systems where it may be zero + */ + gettimeofday(&now, NULL); +- + seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1)); +- srand(seed); + +- input_mode = set_random; ++ seed_env = getenv("KCONFIG_SEED"); ++ if( seed_env && *seed_env ) { ++ char *endp; ++ int tmp = (int)strtol(seed_env, &endp, 0); ++ if (*endp == '\0') { ++ seed = tmp; ++ } ++ } ++ fprintf( stderr, "KCONFIG_SEED=0x%X\n", seed ); ++ srand(seed); + break; + } +- case 'h': +- printf(_("See README for usage info\n")); +- exit(0); ++ case oldaskconfig: ++ case oldconfig: ++ case allnoconfig: ++ case allyesconfig: ++ case allmodconfig: ++ case alldefconfig: ++ case listnewconfig: ++ case olddefconfig: + break; +- default: +- fprintf(stderr, _("See README for usage info\n")); ++ case '?': ++ conf_usage(progname); + exit(1); ++ break; + } + } + if (ac == optind) { + printf(_("%s: Kconfig file missing\n"), av[0]); ++ conf_usage(progname); + exit(1); + } + name = av[optind]; + conf_parse(name); + //zconfdump(stdout); + if (sync_kconfig) { +- if (stat(configname, &tmpstat)) { ++ name = conf_get_configname(); ++ if (stat(name, &tmpstat)) { + fprintf(stderr, _("***\n" +- "*** You have not yet configured!\n" +- "*** (missing .config file)\n" ++ "*** Configuration file \"%s\" not found!\n" + "***\n" + "*** Please run some configurator (e.g. \"make oldconfig\" or\n" + "*** \"make menuconfig\" or \"make xconfig\").\n" +- "***\n")); ++ "***\n"), name); + exit(1); + } + } + + switch (input_mode) { +- case set_default: ++ case defconfig: + if (!defconfig_file) + defconfig_file = conf_get_default_confname(); + if (conf_read(defconfig_file)) { +@@ -522,31 +619,46 @@ + exit(1); + } + break; + |