summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/build.mk6
-rw-r--r--package/cairo/Makefile3
-rw-r--r--package/dbus/Makefile2
-rw-r--r--package/dbus/patches/patch-configure11
-rw-r--r--package/fontconfig/patches/patch-fontconfig_pc_in9
-rw-r--r--package/fuse/patches/patch-fuse_pc_in9
-rw-r--r--package/gdk-pixbuf/patches/patch-gdk-pixbuf-2_0_pc_in10
-rw-r--r--package/libpthread/Makefile2
-rw-r--r--package/libpthread/files/libpthread.so.arm5
-rw-r--r--package/neon/patches/patch-neon_pc_in10
-rw-r--r--package/openjdk/Makefile2
-rw-r--r--package/openjdk/patches/iconv.patch49
-rw-r--r--package/pcc-libs/Makefile1
-rw-r--r--package/pcc/Makefile1
-rw-r--r--target/arm/Makefile2
-rw-r--r--target/config/Config.in1
-rw-r--r--toolchain/uClibc/patches/cris-vfork.patch49
-rw-r--r--toolchain/uClibc/patches/uClibc-26042011-git.patch2506
18 files changed, 2622 insertions, 56 deletions
diff --git a/mk/build.mk b/mk/build.mk
index 32e125df9..29fb0fc9c 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -513,7 +513,7 @@ bulk:
( \
echo === building $$arch $$system $$libc on $$(date); \
$(GMAKE) prereq && \
- $(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc defconfig; \
+ $(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc FS=archive defconfig; \
$(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \
rm .config; \
) 2>&1 | tee $(TOPDIR)/bin/$${system}_$${arch}_$$libc/build.log; \
@@ -531,7 +531,7 @@ bulkall:
( \
echo === building $$arch $$system $$libc on $$(date); \
$(GMAKE) prereq && \
- $(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc allconfig; \
+ $(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc FS=archive allconfig; \
$(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \
rm .config; \
) 2>&1 | tee $(TOPDIR)/bin/$${system}_$${arch}_$$libc/build.log; \
@@ -549,7 +549,7 @@ bulkallmod:
( \
echo === building $$arch $$system $$libc on $$(date); \
$(GMAKE) prereq && \
- $(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc allmodconfig; \
+ $(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc FS=archive allmodconfig; \
$(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \
rm .config; \
) 2>&1 | tee $(TOPDIR)/bin/$${system}_$${arch}_$$libc/build.log; \
diff --git a/package/cairo/Makefile b/package/cairo/Makefile
index 503468257..f25372af8 100644
--- a/package/cairo/Makefile
+++ b/package/cairo/Makefile
@@ -28,6 +28,9 @@ $(eval $(call PKG_template,CAIRO,cairo,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPEN
$(eval $(call PKG_template,CAIRO_DEV,cairo-dev,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_CAIRO_DEV},${PKGSC_CAIRO_DEV},${PKG_OPTS}))
TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS))
+ifeq ($(TARGET_ARCH),arm)
+TARGET_CFLAGS:= $(filter-out -Os,$(TARGET_CFLAGS))
+endif
CONFIGURE_ARGS+= --enable-ft=yes \
--enable-tee=yes \
--enable-xlib=yes
diff --git a/package/dbus/Makefile b/package/dbus/Makefile
index 8b7a96504..02ee6936d 100644
--- a/package/dbus/Makefile
+++ b/package/dbus/Makefile
@@ -18,6 +18,8 @@ PKG_SUBPKGS:= DBUS DBUS_DEV
PKGSC_DBUS_DEV:= devel
PKGSD_DBUS_DEV:= DBUS headers
+PKG_ARCH_DEPENDS:= !arm
+
ifeq ($(ADK_STATIC),y)
PKG_OPTS:= libonly
endif
diff --git a/package/dbus/patches/patch-configure b/package/dbus/patches/patch-configure
index e5bce5132..1aa31b56b 100644
--- a/package/dbus/patches/patch-configure
+++ b/package/dbus/patches/patch-configure
@@ -1,5 +1,14 @@
--- dbus-1.4.6.orig/configure 2011-02-17 21:06:57.000000000 +0100
-+++ dbus-1.4.6/configure 2011-04-13 04:47:38.000000000 +0200
++++ dbus-1.4.6/configure 2011-04-26 16:00:48.797847993 +0200
+@@ -18718,7 +18718,7 @@ DBUS_CLIENT_LIBS="$THREAD_LIBS $NETWORK_
+
+
+ DBUS_BUS_CFLAGS="$XML_CFLAGS"
+-DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $THREAD_LIBS $ADT_LIBS $NETWORK_libs"
++DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $ADT_LIBS $NETWORK_libs"
+
+
+
@@ -19608,18 +19608,6 @@ if test "x$GCC" = "xyes"; then
;;
esac
diff --git a/package/fontconfig/patches/patch-fontconfig_pc_in b/package/fontconfig/patches/patch-fontconfig_pc_in
new file mode 100644
index 000000000..b2670b8df
--- /dev/null
+++ b/package/fontconfig/patches/patch-fontconfig_pc_in
@@ -0,0 +1,9 @@
+--- fontconfig-2.8.0.orig/fontconfig.pc.in 2009-11-16 18:24:52.000000000 +0100
++++ fontconfig-2.8.0/fontconfig.pc.in 2011-04-25 18:08:32.487672440 +0200
+@@ -7,5 +7,5 @@ Name: Fontconfig
+ Description: Font configuration and customization library
+ Version: @VERSION@
+ Libs: -L${libdir} -lfontconfig
+-Libs.private: @LIBXML2_LIBS@ @EXPAT_LIBS@ @FREETYPE_LIBS@ @ICONV_LIBS@
++Libs.private: @LIBXML2_LIBS@ @EXPAT_LIBS@ -lfreetype -lz @ICONV_LIBS@
+ Cflags: -I${includedir}
diff --git a/package/fuse/patches/patch-fuse_pc_in b/package/fuse/patches/patch-fuse_pc_in
new file mode 100644
index 000000000..9f21cd567
--- /dev/null
+++ b/package/fuse/patches/patch-fuse_pc_in
@@ -0,0 +1,9 @@
+--- fuse-2.7.4.orig/fuse.pc.in 2008-02-19 20:51:21.000000000 +0100
++++ fuse-2.7.4/fuse.pc.in 2011-04-25 18:02:20.087672599 +0200
+@@ -6,5 +6,5 @@ includedir=@includedir@
+ Name: fuse
+ Description: Filesystem in Userspace
+ Version: @VERSION@
+-Libs: -L${libdir} -lfuse @libfuse_libs@
++Libs: -L${libdir} -lfuse
+ Cflags: -I${includedir}/fuse -D_FILE_OFFSET_BITS=64
diff --git a/package/gdk-pixbuf/patches/patch-gdk-pixbuf-2_0_pc_in b/package/gdk-pixbuf/patches/patch-gdk-pixbuf-2_0_pc_in
new file mode 100644
index 000000000..ae45cef82
--- /dev/null
+++ b/package/gdk-pixbuf/patches/patch-gdk-pixbuf-2_0_pc_in
@@ -0,0 +1,10 @@
+--- gdk-pixbuf-2.23.1.orig/gdk-pixbuf-2.0.pc.in 2010-11-30 03:37:47.000000000 +0100
++++ gdk-pixbuf-2.23.1/gdk-pixbuf-2.0.pc.in 2011-04-25 18:07:16.917662321 +0200
+@@ -13,6 +13,6 @@ Description: Image loading and scaling
+ Version: @VERSION@
+ Requires: gobject-2.0
+ Requires.private: gmodule-no-export-2.0 @PNG_DEP_CFLAGS_PACKAGES@
+-Libs: -L${libdir} -lgdk_pixbuf-@GDK_PIXBUF_API_VERSION@ @GDK_PIXBUF_EXTRA_LIBS@
++Libs: -L${libdir} -lgdk_pixbuf-@GDK_PIXBUF_API_VERSION@ -ltiff -ljpeg -lpng12 -lm
+ Cflags: -I${includedir}/gdk-pixbuf-@GDK_PIXBUF_API_VERSION@ @GDK_PIXBUF_EXTRA_CFLAGS@
+
diff --git a/package/libpthread/Makefile b/package/libpthread/Makefile
index 4d61d570a..ed0602c86 100644
--- a/package/libpthread/Makefile
+++ b/package/libpthread/Makefile
@@ -49,7 +49,7 @@ endif
libpthread-dev-install:
ifeq ($(ADK_NATIVE),)
${INSTALL_DIR} ${IDIR_LIBPTHREAD_DEV}/usr/lib
- ${CP} ./files/libpthread.so.$(ARCH) ${IDIR_LIBPTHREAD_DEV}/usr/lib/libpthread.so
+ -${CP} ./files/libpthread.so.$(ARCH) ${IDIR_LIBPTHREAD_DEV}/usr/lib/libpthread.so
${CP} ${STAGING_TARGET_DIR}/usr/lib/libpthread_nonshared.a ${IDIR_LIBPTHREAD_DEV}/usr/lib
endif
diff --git a/package/libpthread/files/libpthread.so.arm b/package/libpthread/files/libpthread.so.arm
new file mode 100644
index 000000000..73f6b6c9d
--- /dev/null
+++ b/package/libpthread/files/libpthread.so.arm
@@ -0,0 +1,5 @@
+/* GNU ld script
+ Use the shared library, but some functions are only in
+ the static library, so try that secondarily. */
+OUTPUT_FORMAT(elf32-arm)
+GROUP ( /lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a )
diff --git a/package/neon/patches/patch-neon_pc_in b/package/neon/patches/patch-neon_pc_in
new file mode 100644
index 000000000..7ae4faf9a
--- /dev/null
+++ b/package/neon/patches/patch-neon_pc_in
@@ -0,0 +1,10 @@
+--- neon-0.29.5.orig/neon.pc.in 2006-06-26 12:01:29.000000000 +0200
++++ neon-0.29.5/neon.pc.in 2011-04-25 18:11:35.518922624 +0200
+@@ -6,6 +6,6 @@ includedir=@includedir@
+ Name: neon
+ Description: HTTP/WebDAV client library
+ Version: @NEON_VERSION@
+-Libs.private: @NEON_LIBS@
++Libs.private: -lz -lssl -lcrypto -ldl -lxml2 -lm
+ Libs: -L${libdir} -lneon @NEON_PC_LIBS@
+ Cflags: -I${includedir}/neon @NEON_CFLAGS@
diff --git a/package/openjdk/Makefile b/package/openjdk/Makefile
index 8d0da3e2c..08d80e4c4 100644
--- a/package/openjdk/Makefile
+++ b/package/openjdk/Makefile
@@ -24,6 +24,8 @@ PKG_SITES:= http://download.java.net/openjdk/jdk6/promoted/b22/ \
http://icedtea.classpath.org/download/drops/ \
http://icedtea.classpath.org/download/source/
+PKG_CFLINE_OPENJDK:= depends on ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC
+
# autotools infrastructure for OpenJDK
ICEDTEA_NAME:= icedtea6
ICEDTEA_VERSION:= 1.10
diff --git a/package/openjdk/patches/iconv.patch b/package/openjdk/patches/iconv.patch
new file mode 100644
index 000000000..16a6946f6
--- /dev/null
+++ b/package/openjdk/patches/iconv.patch
@@ -0,0 +1,49 @@
+diff -Nur w-openjdk-6.orig/openjdk-6/hotspot/make/linux/makefiles/gcc.make w-openjdk-6/openjdk-6/hotspot/make/linux/makefiles/gcc.make
+--- w-openjdk-6.orig/openjdk-6/hotspot/make/linux/makefiles/gcc.make 2011-02-28 17:03:13.000000000 +0100
++++ w-openjdk-6/openjdk-6/hotspot/make/linux/makefiles/gcc.make 2011-04-11 18:36:16.837665258 +0200
+@@ -108,9 +108,6 @@
+ CFLAGS += -pipe
+ endif
+
+-# Compiler warnings are treated as errors
+-WARNINGS_ARE_ERRORS = -Werror
+-
+ # Except for a few acceptable ones
+ # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
+ # conversions which might affect the values. To avoid that, we need to turn
+diff -Nur w-openjdk-6.orig/openjdk-6/jdk/make/java/instrument/Makefile w-openjdk-6/openjdk-6/jdk/make/java/instrument/Makefile
+--- w-openjdk-6.orig/openjdk-6/jdk/make/java/instrument/Makefile 2011-02-28 17:06:10.000000000 +0100
++++ w-openjdk-6/openjdk-6/jdk/make/java/instrument/Makefile 2011-04-11 23:14:27.571411016 +0200
+@@ -123,6 +123,8 @@
+ # We don't want to link against -ljava
+ JAVALIB=
+
++LDLIBS += -liconv
++
+ #
+ # Add to ambient vpath so we pick up the library files
+ #
+diff -Nur w-openjdk-6.orig/openjdk-6/jdk/make/java/npt/Makefile w-openjdk-6/openjdk-6/jdk/make/java/npt/Makefile
+--- w-openjdk-6.orig/openjdk-6/jdk/make/java/npt/Makefile 2011-02-28 17:06:11.000000000 +0100
++++ w-openjdk-6/openjdk-6/jdk/make/java/npt/Makefile 2011-04-11 23:14:07.017670197 +0200
+@@ -65,6 +65,8 @@
+ # We don't want to link against -ljava
+ JAVALIB=
+
++LDLIBS += -liconv
++
+ # Add -export options to explicitly spell exported symbols
+ ifeq ($(PLATFORM), windows)
+ OTHER_LCF += -export:nptInitialize -export:nptTerminate
+diff -Nur w-openjdk-6.orig/openjdk-6/jdk/make/sun/splashscreen/Makefile w-openjdk-6/openjdk-6/jdk/make/sun/splashscreen/Makefile
+--- w-openjdk-6.orig/openjdk-6/jdk/make/sun/splashscreen/Makefile 2011-02-28 17:06:12.000000000 +0100
++++ w-openjdk-6/openjdk-6/jdk/make/sun/splashscreen/Makefile 2011-04-11 23:15:07.221411030 +0200
+@@ -55,6 +55,8 @@
+
+ JAVALIB=
+
++LDLIBS += -liconv
++
+ #
+ # C Flags
+ #
diff --git a/package/pcc-libs/Makefile b/package/pcc-libs/Makefile
index 9533b97c9..ec6477779 100644
--- a/package/pcc-libs/Makefile
+++ b/package/pcc-libs/Makefile
@@ -12,6 +12,7 @@ PKG_SECTION:= lang
PKG_URL:= http://pcc.ludd.ltu.se/
PKG_SITES:= http://pcc.ludd.ltu.se/ftp/pub/pcc-releases/
+PKG_ARCH_DEPENDS:= !arm
DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
include $(TOPDIR)/mk/package.mk
diff --git a/package/pcc/Makefile b/package/pcc/Makefile
index a20d3dece..1fd798a74 100644
--- a/package/pcc/Makefile
+++ b/package/pcc/Makefile
@@ -15,6 +15,7 @@ PKG_URL:= http://pcc.ludd.ltu.se/
PKG_SITES:= http://pcc.ludd.ltu.se/ftp/pub/pcc-releases/
PKG_NOPARALLEL:= 1
+PKG_ARCH_DEPENDS:= !arm
DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
include $(TOPDIR)/mk/package.mk
diff --git a/target/arm/Makefile b/target/arm/Makefile
index 141d2c279..dbf955a81 100644
--- a/target/arm/Makefile
+++ b/target/arm/Makefile
@@ -7,7 +7,7 @@ include $(TOPDIR)/mk/modules.mk
include $(TOPDIR)/mk/kernel-build.mk
include $(TOPDIR)/mk/image.mk
-KERNEL:=$(LINUX_DIR)/kernel-adk
+KERNEL:=$(LINUX_DIR)/vmlinux
LOADADDR:=0x20008000
tools-compile:
diff --git a/target/config/Config.in b/target/config/Config.in
index 4c8c8bcb5..35c8688b2 100644
--- a/target/config/Config.in
+++ b/target/config/Config.in
@@ -464,7 +464,6 @@ config ADK_TARGET_ROOTFS_MMC
config ADK_TARGET_ROOTFS_ARCHIVE
bool "Archive usable for different filesystems"
- depends on ADK_HARDWARE_QEMU
help
Use this option if your root filesystem is ext2/ext3/ext4/xfs.
diff --git a/toolchain/uClibc/patches/cris-vfork.patch b/toolchain/uClibc/patches/cris-vfork.patch
deleted file mode 100644
index 8e0faa2f3..000000000
--- a/toolchain/uClibc/patches/cris-vfork.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff -Nur uClibc-0.9.32-rc2.orig/libc/sysdeps/linux/cris/Makefile.arch uClibc-0.9.32-rc2/libc/sysdeps/linux/cris/Makefile.arch
---- uClibc-0.9.32-rc2.orig/libc/sysdeps/linux/cris/Makefile.arch 2011-01-20 15:49:47.000000000 +0100
-+++ uClibc-0.9.32-rc2/libc/sysdeps/linux/cris/Makefile.arch 2011-02-07 23:01:26.000000000 +0100
-@@ -7,7 +7,7 @@
-
- CSRC := __init_brk.c brk.c sbrk.c
-
--SSRC := setjmp.S __longjmp.S clone.S sysdep.S syscall.S
-+SSRC := setjmp.S __longjmp.S clone.S sysdep.S syscall.S vfork.S
- ifeq ($(UNIFIED_SYSCALL),y)
- SSRC += __uClibc_syscall.S
- endif
-diff -Nur uClibc-0.9.32-rc2.orig/libc/sysdeps/linux/cris/vfork.S uClibc-0.9.32-rc2/libc/sysdeps/linux/cris/vfork.S
---- uClibc-0.9.32-rc2.orig/libc/sysdeps/linux/cris/vfork.S 1970-01-01 01:00:00.000000000 +0100
-+++ uClibc-0.9.32-rc2/libc/sysdeps/linux/cris/vfork.S 2011-02-08 00:39:10.000000000 +0100
-@@ -0,0 +1,33 @@
-+/*
-+ * vfork.S
-+ *
-+ * On cris, r9 contains the syscall number (set by generated stub);
-+ * r10..r13 contain arguments 0-3 per the standard calling convention.
-+ * The return address is in $srp; so we just need to avoid the stack
-+ * usage of the normal syscall stubs.
-+ */
-+
-+#include <asm/unistd.h>
-+#include <sys/syscall.h>
-+
-+ .section ".text","ax"
-+ .balign 4
-+ .globl __vfork
-+ .type __vfork,@function
-+__vfork:
-+ move.d __NR_vfork, $r9
-+ break 13
-+
-+ cmps.w -4096,$r10
-+ blo 1f
-+ neg.d $r10,$r11
-+ move.d $r11,[errno]
-+ moveq -1,$r10
-+1:
-+ ret
-+ nop
-+
-+ .size __vfork,.-__vfork
-+
-+weak_alias(__vfork,vfork)
-+libc_hidden_weak(vfork)
diff --git a/toolchain/uClibc/patches/uClibc-26042011-git.patch b/toolchain/uClibc/patches/uClibc-26042011-git.patch
new file mode 100644
index 000000000..bbf4d06f0
--- /dev/null
+++ b/toolchain/uClibc/patches/uClibc-26042011-git.patch
@@ -0,0 +1,2506 @@
+diff -Nur uClibc-0.9.32-rc3/extra/Configs/Config.in uClibc/extra/Configs/Config.in
+--- uClibc-0.9.32-rc3/extra/Configs/Config.in 2011-03-16 20:11:13.000000000 +0100
++++ uClibc/extra/Configs/Config.in 2011-04-26 16:18:21.707661578 +0200
+@@ -1898,6 +1898,18 @@
+ This interface is rarely used, and adds around 4.5k. Unless you have
+ a pressing need for ftw(), you should probably answer N.
+
++config UCLIBC_HAS_FTS
++ bool "Support the fts() interface (bsd-compat)"
++ default n
++ help
++ The fts functions are provided for traversing UNIX file hierarchies.
++
++ This interface is currently used by the elfutils and adds
++ around 7.5k.
++ You should port your application to use the POSIX nftw()
++ interface.
++
++ Unless you need to build/use elfutils, you should prolly answer N.
+
+ config UCLIBC_HAS_GLOB
+ bool "Support the glob() interface"
+@@ -2322,7 +2334,7 @@
+
+ config UCLIBC_HAS_BACKTRACE
+ bool "Add support for application self-debugging"
+- depends on HAVE_SHARED && TARGET_sh
++ depends on HAVE_SHARED
+ default n
+ help
+ Answer Y here to compile support for application self-debugging, by adding
+diff -Nur uClibc-0.9.32-rc3/include/fts.h uClibc/include/fts.h
+--- uClibc-0.9.32-rc3/include/fts.h 1970-01-01 01:00:00.000000000 +0100
++++ uClibc/include/fts.h 2011-04-26 16:18:21.727663221 +0200
+@@ -0,0 +1,131 @@
++/*
++ * Copyright (c) 1989, 1993
++ * The Regents of the University of California. 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.
++ * 4. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
++ *
++ * @(#)fts.h 8.3 (Berkeley) 8/14/94
++ */
++
++#ifndef _FTS_H
++#define _FTS_H 1
++
++#include <features.h>
++#include <sys/types.h>
++
++/* The fts interface is incompatible with the LFS interface which
++ transparently uses the 64-bit file access functions. */
++#ifdef __USE_FILE_OFFSET64
++# error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
++#endif
++
++
++typedef struct {
++ struct _ftsent *fts_cur; /* current node */
++ struct _ftsent *fts_child; /* linked list of children */
++ struct _ftsent **fts_array; /* sort array */
++ dev_t fts_dev; /* starting device # */
++ char *fts_path; /* path for this descent */
++ int fts_rfd; /* fd for root */
++ int fts_pathlen; /* sizeof(path) */
++ int fts_nitems; /* elements in the sort array */
++ int (*fts_compar) (const void *, const void *); /* compare fn */
++
++#define FTS_COMFOLLOW 0x0001 /* follow command line symlinks */
++#define FTS_LOGICAL 0x0002 /* logical walk */
++#define FTS_NOCHDIR 0x0004 /* don't change directories */
++#define FTS_NOSTAT 0x0008 /* don't get stat info */
++#define FTS_PHYSICAL 0x0010 /* physical walk */
++#define FTS_SEEDOT 0x0020 /* return dot and dot-dot */
++#define FTS_XDEV 0x0040 /* don't cross devices */
++#define FTS_WHITEOUT 0x0080 /* return whiteout information */
++#define FTS_OPTIONMASK 0x00ff /* valid user option mask */
++
++#define FTS_NAMEONLY 0x0100 /* (private) child names only */
++#define FTS_STOP 0x0200 /* (private) unrecoverable error */
++ int fts_options; /* fts_open options, global flags */
++} FTS;
++
++typedef struct _ftsent {
++ struct _ftsent *fts_cycle; /* cycle node */
++ struct _ftsent *fts_parent; /* parent directory */
++ struct _ftsent *fts_link; /* next file in directory */
++ long fts_number; /* local numeric value */
++ void *fts_pointer; /* local address value */
++ char *fts_accpath; /* access path */
++ char *fts_path; /* root path */
++ int fts_errno; /* errno for this node */
++ int fts_symfd; /* fd for symlink */
++ u_short fts_pathlen; /* strlen(fts_path) */
++ u_short fts_namelen; /* strlen(fts_name) */
++
++ ino_t fts_ino; /* inode */
++ dev_t fts_dev; /* device */
++ nlink_t fts_nlink; /* link count */
++
++#define FTS_ROOTPARENTLEVEL -1
++#define FTS_ROOTLEVEL 0
++ short fts_level; /* depth (-1 to N) */
++
++#define FTS_D 1 /* preorder directory */
++#define FTS_DC 2 /* directory that causes cycles */
++#define FTS_DEFAULT 3 /* none of the above */
++#define FTS_DNR 4 /* unreadable directory */
++#define FTS_DOT 5 /* dot or dot-dot */
++#define FTS_DP 6 /* postorder directory */
++#define FTS_ERR 7 /* error; errno is set */
++#define FTS_F 8 /* regular file */
++#define FTS_INIT 9 /* initialized only */
++#define FTS_NS 10 /* stat(2) failed */
++#define FTS_NSOK 11 /* no stat(2) requested */
++#define FTS_SL 12 /* symbolic link */
++#define FTS_SLNONE 13 /* symbolic link without target */
++#define FTS_W 14 /* whiteout object */
++ u_short fts_info; /* user flags for FTSENT structure */
++
++#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
++#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
++ u_short fts_flags; /* private flags for FTSENT structure */
++
++#define FTS_AGAIN 1 /* read node again */
++#define FTS_FOLLOW 2 /* follow symbolic link */
++#define FTS_NOINSTR 3 /* no instructions */
++#define FTS_SKIP 4 /* discard node */
++ u_short fts_instr; /* fts_set() instructions */
++
++ struct stat *fts_statp; /* stat(2) information */
++ char fts_name[1]; /* file name */
++} FTSENT;
++
++__BEGIN_DECLS
++FTSENT *fts_children (FTS *, int);
++int fts_close (FTS *);
++FTS *fts_open (char * const *, int,
++ int (*)(const FTSENT **, const FTSENT **));
++FTSENT *fts_read (FTS *);
++int fts_set (FTS *, FTSENT *, int) __THROW;
++__END_DECLS
++
++#endif /* fts.h */
+diff -Nur uClibc-0.9.32-rc3/ldso/include/dl-elf.h uClibc/ldso/include/dl-elf.h
+--- uClibc-0.9.32-rc3/ldso/include/dl-elf.h 2011-03-16 20:11:13.000000000 +0100
++++ uClibc/ldso/include/dl-elf.h 2011-04-26 16:18:21.747664948 +0200
+@@ -184,7 +184,7 @@
+ ADJUST_DYN_INFO(DT_DSBT_BASE_IDX, load_off);
+
+ /* Initialize loadmap dsbt info. */
+- load_off.map->dsbt_table = dynamic_info[DT_DSBT_BASE_IDX];
++ load_off.map->dsbt_table = (void *)dynamic_info[DT_DSBT_BASE_IDX];
+ load_off.map->dsbt_size = dynamic_info[DT_DSBT_SIZE_IDX];
+ load_off.map->dsbt_index = dynamic_info[DT_DSBT_INDEX_IDX];
+ #endif
+diff -Nur uClibc-0.9.32-rc3/ldso/include/ldso.h uClibc/ldso/include/ldso.h
+--- uClibc-0.9.32-rc3/ldso/include/ldso.h 2011-03-16 20:11:13.000000000 +0100
++++ uClibc/ldso/include/ldso.h 2011-04-26 16:18:21.747664948 +0200
+@@ -34,6 +34,8 @@
+ #include <sys/types.h>
+ /* Pull in the arch specific page size */
+ #include <bits/uClibc_page.h>
++/* Pull in the MIN macro */
++#include <sys/param.h>
+ /* Pull in the ldso syscalls and string functions */
+ #ifndef __ARCH_HAS_NO_SHARED__
+ #include <dl-syscall.h>
+diff -Nur uClibc-0.9.32-rc3/ldso/ldso/bfin/dl-inlines.h uClibc/ldso/ldso/bfin/dl-inlines.h
+--- uClibc-0.9.32-rc3/ldso/ldso/bfin/dl-inlines.h 2011-03-16 20:11:13.000000000 +0100
++++ uClibc/ldso/ldso/bfin/dl-inlines.h 2011-04-26 16:18:21.747664948 +0200
+@@ -88,14 +88,39 @@
+ segdata->p_memsz = phdr->p_memsz;
+
+ #if defined (__SUPPORT_LD_DEBUG__)
+- {
+- extern char *_dl_debug;
+- extern int _dl_debug_file;
+- if (_dl_debug)
+- _dl_dprintf(_dl_debug_file, "%i: mapped %x at %x, size %x\n",
+- loadaddr.map->nsegs-1,
+- segdata->p_vaddr, segdata->addr, segdata->p_memsz);
+- }
++ if (_dl_debug)
++ _dl_dprintf(_dl_debug_file, "%i: mapped %x at %x, size %x\n",
++ loadaddr.map->nsegs-1,
++ segdata->p_vaddr, segdata->addr, segdata->p_memsz);
++#endif
++}
++
++/* Replace an existing entry in the load map. */
++static __always_inline void
++__dl_update_loadaddr_hdr (struct elf32_fdpic_loadaddr loadaddr, void *addr,
++ Elf32_Phdr *phdr)
++{
++ struct elf32_fdpic_loadseg *segdata;
++ void *oldaddr;
++ int i;
++
++ for (i = 0; i < loadaddr.map->nsegs; i++)
++ if (loadaddr.map->segs[i].p_vaddr == phdr->p_vaddr
++ && loadaddr.map->segs[i].p_memsz == phdr->p_memsz)
++ break;
++ if (i == loadaddr.map->nsegs)
++ _dl_exit (-1);
++
++ segdata = loadaddr.map->segs + i;
++ oldaddr = (void *)segdata->addr;
++ _dl_munmap (oldaddr, segdata->p_memsz);
++ segdata->addr = (Elf32_Addr) addr;
++
++#if defined (__SUPPORT_LD_DEBUG__)
++ if (_dl_debug)
++ _dl_dprintf(_dl_debug_file, "%i: changed mapping %x at %x (old %x), size %x\n",
++ loadaddr.map->nsegs-1,
++ segdata->p_vaddr, segdata->addr, oldaddr, segdata->p_memsz);
+ #endif
+ }
+
+diff -Nur uClibc-0.9.32-rc3/ldso/ldso/bfin/dl-sysdep.h uClibc/ldso/ldso/bfin/dl-sysdep.h
+--- uClibc-0.9.32-rc3/ldso/ldso/bfin/dl-sysdep.h 2011-03-16 20:11:13.000000000 +0100
++++ uClibc/ldso/ldso/bfin/dl-sysdep.h 2011-04-26 16:18:21.747664948 +0200
+@@ -120,6 +120,8 @@
+ #define DL_INIT_LOADADDR_HDR(LOADADDR, ADDR, PHDR) \
+ (__dl_init_loadaddr_hdr ((LOADADDR), (ADDR), (PHDR), \
+ dl_init_loadaddr_load_count))
++#define DL_UPDATE_LOADADDR_HDR(LOADADDR, ADDR, PHDR) \
++ (__dl_update_loadaddr_hdr ((LOADADDR), (ADDR), (PHDR)))
+ #define DL_LOADADDR_UNMAP(LOADADDR, LEN) \
+ (__dl_loadaddr_unmap ((LOADADDR), (NULL)))
+ #define DL_LIB_UNMAP(LIB, LEN) \
+diff -Nur uClibc-0.9.32-rc3/ldso/ldso/c6x/dl-inlines.h uClibc/ldso/ldso/c6x/dl-inlines.h
+--- uClibc-0.9.32-rc3/ldso/ldso/c6x/dl-inlines.h 2011-03-16 20:11:13.000000000 +0100
++++ uClibc/ldso/ldso/c6x/dl-inlines.h 2011-04-26 16:18:21.747664948 +0200
+@@ -74,6 +74,35 @@
+ #endif
+ }
+
++/* Replace an existing entry in the load map. */
++static __always_inline void
++__dl_update_loadaddr_hdr (struct elf32_dsbt_loadaddr loadaddr, void *addr,
++ Elf32_Phdr *phdr)
++{
++ struct elf32_dsbt_loadseg *segdata;
++ void *oldaddr;
++ int i;
++
++ for (i = 0; i < loadaddr.map->nsegs; i++)
++ if (loadaddr.map->segs[i].p_vaddr == phdr->p_vaddr
++ && loadaddr.map->segs[i].p_memsz == phdr->p_memsz)
++ break;
++ if (i == loadaddr.map->nsegs)
++ _dl_exit (-1);
++
++ segdata = loadaddr.map->segs + i;
++ oldaddr = (void *)segdata->addr;
++ _dl_munmap (oldaddr, segdata->p_memsz);
++ segdata->addr = (Elf32_Addr) addr;
++
++#if defined (__SUPPORT_LD_DEBUG__)
++ if (_dl_debug)
++ _dl_dprintf(_dl_debug_file, "%i: changed mapping %x at %x (old %x), size %x\n",
++ loadaddr.map->nsegs-1,
++ segdata->p_vaddr, segdata->addr, oldaddr, segdata->p_memsz);
++#endif
++}
++
+ static __always_inline void
+ __dl_loadaddr_unmap (struct elf32_dsbt_loadaddr loadaddr)
+ {
+diff -Nur uClibc-0.9.32-rc3/ldso/ldso/c6x/dl-sysdep.h uClibc/ldso/ldso/c6x/dl-sysdep.h
+--- uClibc-0.9.32-rc3/ldso/ldso/c6x/dl-sysdep.h 2011-03-16 20:11:13.000000000 +0100
++++ uClibc/ldso/ldso/c6x/dl-sysdep.h 2011-04-26 16:18:21.747664948 +0200
+@@ -104,6 +104,9 @@
+ (__dl_init_loadaddr_hdr ((LOADADDR), (ADDR), (PHDR), \
+ dl_init_loadaddr_load_count))
+
++#define DL_UPDATE_LOADADDR_HDR(LOADADDR, ADDR, PHDR) \
++ (__dl_update_loadaddr_hdr ((LOADADDR), (ADDR), (PHDR)))
++
+ #define DL_LOADADDR_UNMAP(LOADADDR, LEN) \
+ (__dl_loadaddr_unmap ((LOADADDR)))
+
+diff -Nur uClibc-0.9.32-rc3/ldso/ldso/c6x/elfinterp.c uClibc/ldso/ldso/c6x/elfinterp.c
+--- uClibc-0.9.32-rc3/ldso/ldso/c6x/elfinterp.c 2011-03-16 20:11:13.000000000 +0100
++++ uClibc/ldso/ldso/c6x/elfinterp.c 2011-04-26 16:18:21.747664948 +0200
+@@ -198,6 +198,10 @@
+ new_val = sym_val;
+ *reloc_addr = sym_val;
+ break;
++ case R_C6000_DSBT_INDEX:
++ new_val = (old_val & ~0x007fff00) | ((tpnt->loadaddr.map->dsbt_index & 0x7fff) << 8);
++ *reloc_addr = new_val;
++ break;
+ case R_C6000_ABS_L16:
+ new_val = (old_val & ~0x007fff80) | ((sym_val & 0xffff) << 7);
+ *reloc_addr = new_val;
+@@ -224,7 +228,7 @@
+ (char *)symbol_addr,
+ symtab[symtab_index].st_size);
+ }
+- break;
++ return 0;
+ default:
+ return -1; /*call _dl_exit(1) */
+ }
+diff -Nur uClibc-0.9.32-rc3/ldso/ldso/dl-elf.c uClibc/ldso/ldso/dl-elf.c
+--- uClibc-0.9.32-rc3/ldso/ldso/dl-elf.c 2011-03-16 20:11:13.000000000 +0100
++++ uClibc/ldso/ldso/dl-elf.c 2011-04-26 16:18:21.747664948 +0200
+@@ -314,6 +314,121 @@
+ return NULL;
+ }
+
++/*
++ * Make a writeable mapping of a segment, regardless of whether PF_W is
++ * set or not.
++ */
++static void *
++map_writeable (int infile, ElfW(Phdr) *ppnt, int piclib, int flags,
++ unsigned long libaddr)
++{
++ int prot_flags = ppnt->p_flags | PF_W;
++ char *status, *retval;
++ char *tryaddr;
++ ssize_t size;
++ unsigned long map_size;
++ char *cpnt;
++ char *piclib2map = NULL;
++
++ if (piclib == 2 &&
++ /* We might be able to avoid this call if memsz doesn't
++ require an additional page, but this would require mmap
++ to always return page-aligned addresses and a whole
++ number of pages allocated. Unfortunately on uClinux
++ may return misaligned addresses and may allocate
++ partial pages, so we may end up doing unnecessary mmap
++ calls.
++
++ This is what we could do if we knew mmap would always
++ return aligned pages:
++
++ ((ppnt->p_vaddr + ppnt->p_filesz + ADDR_ALIGN) &
++ PAGE_ALIGN) < ppnt->p_vaddr + ppnt->p_memsz)
++
++ Instead, we have to do this: */
++ ppnt->p_filesz < ppnt->p_memsz)
++ {
++ piclib2map = (char *)
++ _dl_mmap(0, (ppnt->p_vaddr & ADDR_ALIGN) + ppnt->p_memsz,
++ LXFLAGS(prot_flags), flags | MAP_ANONYMOUS, -1, 0);
++ if (_dl_mmap_check_error(piclib2map))
++ return 0;
++ }
++
++ tryaddr = piclib == 2 ? piclib2map
++ : ((char*) (piclib ? libaddr : 0) +
++ (ppnt->p_vaddr & PAGE_ALIGN));
++
++ size = (ppnt->p_vaddr & ADDR_ALIGN) + ppnt->p_filesz;
++
++ /* For !MMU, mmap to fixed address will fail.
++ So instead of desperately call mmap and fail,
++ we set status to MAP_FAILED to save a call
++ to mmap (). */
++#ifndef __ARCH_USE_MMU__
++ if (piclib2map == 0)
++#endif
++ status = (char *) _dl_mmap
++ (tryaddr, size, LXFLAGS(prot_flags),
++ flags | (piclib2map ? MAP_FIXED : 0),
++ infile, ppnt->p_offset & OFFS_ALIGN);
++#ifndef __ARCH_USE_MMU__
++ else
++ status = MAP_FAILED;
++#endif
++#ifdef _DL_PREAD
++ if (_dl_mmap_check_error(status) && piclib2map
++ && (_DL_PREAD (infile, tryaddr, size,
++ ppnt->p_offset & OFFS_ALIGN) == size))
++ status = tryaddr;
++#endif
++ if (_dl_mmap_check_error(status) || (tryaddr && tryaddr != status))
++ return 0;
++
++ if (piclib2map)
++ retval = piclib2map;
++ else
++ retval = status;
++
++ /* Now we want to allocate and zero-out any data from the end
++ of the region we mapped in from the file (filesz) to the
++ end of the loadable segment (memsz). We may need
++ additional pages for memsz, that we map in below, and we
++ can count on the kernel to zero them out, but we have to
++ zero out stuff in the last page that we mapped in from the
++ file. However, we can't assume to have actually obtained
++ full pages from the kernel, since we didn't ask for them,
++ and uClibc may not give us full pages for small
++ allocations. So only zero out up to memsz or the end of
++ the page, whichever comes first. */
++
++ /* CPNT is the beginning of the memsz portion not backed by
++ filesz. */
++ cpnt = (char *) (status + size);
++
++ /* MAP_SIZE is the address of the
++ beginning of the next page. */
++ map_size = (ppnt->p_vaddr + ppnt->p_filesz
++ + ADDR_ALIGN) & PAGE_ALIGN;
++
++ _dl_memset (cpnt, 0,
++ MIN (map_size
++ - (ppnt->p_vaddr
++ + ppnt->p_filesz),
++ ppnt->p_memsz
++ - ppnt->p_filesz));
++
++ if (map_size < ppnt->p_vaddr + ppnt->p_memsz && !piclib2map) {
++ tryaddr = map_size + (char*)(piclib ? libaddr : 0);
++ status = (char *) _dl_mmap(tryaddr,
++ ppnt->p_vaddr + ppnt->p_memsz - map_size,
++ LXFLAGS(prot_flags),
++ flags | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
++ if (_dl_mmap_check_error(status) || tryaddr != status)
++ return NULL;
++ }
++ return retval;
++}
+
+ /*
+ * Read one ELF library into memory, mmap it into the correct locations and
+@@ -475,6 +590,7 @@
+ status = (char *) _dl_mmap((char *) (piclib ? 0 : minvma),
+ maxvma - minvma, PROT_NONE, flags | MAP_ANONYMOUS, -1, 0);
+ if (_dl_mmap_check_error(status)) {
++ cant_map:
+ _dl_dprintf(2, "%s:%i: can't map '%s'\n", _dl_progname, __LINE__, libname);
+ _dl_internal_error_number = LD_ERROR_MMAP_FAILED;
+ _dl_close(infile);
+@@ -495,8 +611,11 @@
+ char *addr;
+
+ addr = DL_MAP_SEGMENT (epnt, ppnt, infile, flags);
+- if (addr == NULL)
++ if (addr == NULL) {
++ cant_map1:
++ DL_LOADADDR_UNMAP (lib_loadaddr, maxvma - minvma);
+ goto cant_map;
++ }
+
+ DL_INIT_LOADADDR_HDR (lib_loadaddr, addr, ppnt);
+ ppnt++;
+@@ -517,141 +636,9 @@
+ }
+
+ if (ppnt->p_flags & PF_W) {
+- unsigned long map_size;
+- char *cpnt;
+- char *piclib2map = 0;
+-
+- if (piclib == 2 &&
+- /* We might be able to avoid this
+- call if memsz doesn't require
+- an additional page, but this
+- would require mmap to always
+- return page-aligned addresses
+- and a whole number of pages
+- allocated. Unfortunately on
+- uClinux may return misaligned
+- addresses and may allocate
+- partial pages, so we may end up
+- doing unnecessary mmap calls.
+-
+- This is what we could do if we
+- knew mmap would always return
+- aligned pages:
+-
+- ((ppnt->p_vaddr + ppnt->p_filesz
+- + ADDR_ALIGN)
+- & PAGE_ALIGN)
+- < ppnt->p_vaddr + ppnt->p_memsz)
+-
+- Instead, we have to do this: */
+- ppnt->p_filesz < ppnt->p_memsz)
+- {
+- piclib2map = (char *)