Pārlūkot izejas kodu

Merge branch 'master' of git+ssh://openadk.org/git/openadk

Waldemar Brodkorb 14 gadi atpakaļ
vecāks
revīzija
8a56c55457

+ 1 - 0
jtools/Makefile

@@ -5,6 +5,7 @@ include $(TOPDIR)/rules.mk
 
 
 TARGETS:=
 TARGETS:=
 ifneq ($(ADK_PACKAGE_OPENJDK),)
 ifneq ($(ADK_PACKAGE_OPENJDK),)
+# jikes is for ant
 TARGETS+=fastjar gcj ecj jikes classpath jamvm ant openjdk
 TARGETS+=fastjar gcj ecj jikes classpath jamvm ant openjdk
 endif
 endif
 
 

+ 1 - 0
mk/build.mk

@@ -19,6 +19,7 @@ DEFCONFIG=		ADK_DEBUG=n \
 			ADK_PACKAGE_ALSA_UTILS_WITH_ALSAMIXER=n \
 			ADK_PACKAGE_ALSA_UTILS_WITH_ALSAMIXER=n \
 			ADK_PACKAGE_GRUB=n \
 			ADK_PACKAGE_GRUB=n \
 			ADK_PACKAGE_BASE_FILES=y \
 			ADK_PACKAGE_BASE_FILES=y \
+			ADK_PACKAGE_CRYPTINIT=n \
 			ADK_PACKAGE_PYTHON=n \
 			ADK_PACKAGE_PYTHON=n \
 			ADK_PKG_LAPTOP=n \
 			ADK_PKG_LAPTOP=n \
 			ADK_PKG_DEVELOPMENT=n \
 			ADK_PKG_DEVELOPMENT=n \

+ 1 - 1
package/firefox/Makefile

@@ -9,7 +9,7 @@ PKG_RELEASE:=		1
 PKG_MD5SUM:=		6d1f43e402cec84459a3d7f950bd5192
 PKG_MD5SUM:=		6d1f43e402cec84459a3d7f950bd5192
 PKG_DESCR:=		graphical webbrowser
 PKG_DESCR:=		graphical webbrowser
 PKG_SECTION:=		x11/apps
 PKG_SECTION:=		x11/apps
-PKG_DEPENDS:=		libpthread alsa-lib dbus-glib glib libgtk libpng libtiff
+PKG_DEPENDS:=		libpthread alsa-lib dbus-glib glib libgtk libpng libtiff libxcursor
 PKG_DEPENDS+=		nspr nss libjpeg libatk pango cairo libxt libx11 libstdcxx hicolor-icon-theme
 PKG_DEPENDS+=		nspr nss libjpeg libatk pango cairo libxt libx11 libstdcxx hicolor-icon-theme
 PKG_DEPENDS+=		libxdamage libxfixes libidl libsqlite libxcomposite gdk-pixbuf libintl
 PKG_DEPENDS+=		libxdamage libxfixes libidl libsqlite libxcomposite gdk-pixbuf libintl
 PKG_BUILDDEP:=		alsa-lib dbus-glib glib gtk+ libIDL libX11 MesaLib libtiff gdk-pixbuf
 PKG_BUILDDEP:=		alsa-lib dbus-glib glib gtk+ libIDL libX11 MesaLib libtiff gdk-pixbuf

+ 3 - 1
package/mplayer/Makefile

@@ -10,8 +10,9 @@ PKG_MD5SUM:=		aadc5d8cca503c8b18b3ed00b3a52cf5
 PKG_DESCR:=		popular video player
 PKG_DESCR:=		popular video player
 PKG_SECTION:=		multimedia
 PKG_SECTION:=		multimedia
 PKG_DEPENDS:=		alsa-lib libjpeg libfaad2 libmad libncurses
 PKG_DEPENDS:=		alsa-lib libjpeg libfaad2 libmad libncurses
-PKG_DEPENDS+=		libogg libpng libpthread libvorbis
+PKG_DEPENDS+=		libogg libpng libpthread libvorbis giflib
 PKG_DEPENDS+=		libx11 libxau libxdmcp libxext libxv zlib
 PKG_DEPENDS+=		libx11 libxau libxdmcp libxext libxv zlib
+PKG_DEPENDS+=		libxscrnsaver
 PKG_BUILDDEP:=		alsa-lib libmad libvorbis faad2 ncurses zlib
 PKG_BUILDDEP:=		alsa-lib libmad libvorbis faad2 ncurses zlib
 PKG_BUILDDEP+=		libX11 libXv libpng libXext jpeg
 PKG_BUILDDEP+=		libX11 libXv libpng libXext jpeg
 PKG_URL:=		http://www.mplayerhq.hu/
 PKG_URL:=		http://www.mplayerhq.hu/
@@ -100,6 +101,7 @@ CONFIGURE_ARGS:=	--prefix=/usr \
 			--disable-iconv \
 			--disable-iconv \
 			--disable-lirc \
 			--disable-lirc \
 			--disable-radio-v4l2 \
 			--disable-radio-v4l2 \
+			--disable-speex \
 			--disable-faac \
 			--disable-faac \
 			--disable-libdv \
 			--disable-libdv \
 			--disable-live \
 			--disable-live \

+ 5 - 1
package/openjdk/Makefile

@@ -24,7 +24,7 @@ PKG_SITES:=		http://download.java.net/openjdk/jdk6/promoted/b22/ \
 			http://icedtea.classpath.org/download/drops/ \
 			http://icedtea.classpath.org/download/drops/ \
 			http://icedtea.classpath.org/download/source/
 			http://icedtea.classpath.org/download/source/
 
 
-PKG_CFLINE_OPENJDK:=	depends on ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC && !ADK_TARGET_SYSTEM_LEMOTE_YEELONG
+#PKG_CFLINE_OPENJDK:=	depends on ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC && !ADK_TARGET_SYSTEM_LEMOTE_YEELONG
 PKG_HOST_DEPENDS:=	!darwin !cygwin !openbsd !netbsd !freebsd
 PKG_HOST_DEPENDS:=	!darwin !cygwin !openbsd !netbsd !freebsd
 
 
 # autotools infrastructure for OpenJDK
 # autotools infrastructure for OpenJDK
@@ -106,6 +106,10 @@ OPENJDK_NATIVE_ENV+=	ALT_COMPILER_PATH=$(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAM
 			TARGET_ALIAS=$(GNU_TARGET_NAME) BUILD_ALIAS=$(GNU_HOST_NAME) HOST_ALIAS=$(GNU_TARGET_NAME)
 			TARGET_ALIAS=$(GNU_TARGET_NAME) BUILD_ALIAS=$(GNU_HOST_NAME) HOST_ALIAS=$(GNU_TARGET_NAME)
 ALL_TARGET:=		icedtea
 ALL_TARGET:=		icedtea
 
 
+# add include path for Xrender.h from staging directory
+post-patch:
+	$(SED) "s#@ADK_TARGETDIR@#$(STAGING_TARGET_DIR)#" ${WRKDIST}/$(PKG_NAME)-$(PKG_VERSION)/jdk/make/sun/xawt/Makefile
+
 do-extract:
 do-extract:
 	cd ${WRKDIST}; mkdir $(PKG_NAME)-$(PKG_VERSION); \
 	cd ${WRKDIST}; mkdir $(PKG_NAME)-$(PKG_VERSION); \
 		tar xzf $(TOPDIR)/dl/$(PKG_NAME)-$(PKG_VERSION)-src-$(PKG_EXTRAVER).tar.gz -C $(PKG_NAME)-$(PKG_VERSION)
 		tar xzf $(TOPDIR)/dl/$(PKG_NAME)-$(PKG_VERSION)-src-$(PKG_EXTRAVER).tar.gz -C $(PKG_NAME)-$(PKG_VERSION)

+ 53 - 0
package/openjdk/patches/cross-compile.patch

@@ -0,0 +1,53 @@
+--- w-openjdk-6-1.orig/openjdk-6/jdk/make/sun/awt/Makefile	2011-02-28 17:06:11.000000000 +0100
++++ w-openjdk-6-1/openjdk-6/jdk/make/sun/awt/Makefile	2011-08-07 17:00:37.676468717 +0200
+@@ -509,10 +509,7 @@
+ #
+ 
+ ifeq ($(PLATFORM), linux)
+-CPPFLAGS += -I$(MOTIF_DIR)/include \
+-            -I$(OPENWIN_HOME)/include \
+-            -I$(OPENWIN_HOME)/include/X11/extensions \
+-            -I$(PLATFORM_SRC)/native/$(PKGDIR)/font 
++CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/font 
+ endif
+ CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
+             -I$(SHARE_SRC)/native/$(PKGDIR)/../font \
+@@ -535,10 +532,6 @@
+             -I$(PLATFORM_SRC)/native/$(PKGDIR) \
+ 	    $(EVENT_MODEL)
+ 
+-ifeq ($(PLATFORM), linux)
+-LDFLAGS += -L$(MOTIF_LIB) -L$(OPENWIN_LIB)
+-endif
+-
+ LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/$(TSOBJDIR) \
+ 	   $(AWT_RUNPATH)
+ 
+--- w-openjdk-6-1.orig/openjdk-6/jdk/make/sun/xawt/Makefile	2011-02-28 17:06:12.000000000 +0100
++++ w-openjdk-6-1/openjdk-6/jdk/make/sun/xawt/Makefile	2011-08-07 18:31:08.635355054 +0200
+@@ -96,6 +96,10 @@
+ 
+ CPPFLAGS += -I$(CUPS_HEADERS_PATH)
+ 
++ifeq ($(PLATFORM), linux)
++CPPFLAGS += -I@ADK_TARGETDIR@/usr/include/X11/extensions
++endif
++
+ CPPFLAGS += -DXAWT -DXAWT_HACK \
+         -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders \
+         -I$(PLATFORM_SRC)/native/sun/awt \
+@@ -122,14 +126,6 @@
+         -I$(SHARE_SRC)/native/sun/awt \
+         -I$(PLATFORM_SRC)/native/sun/awt 
+ 
+-ifeq ($(PLATFORM), linux)
+-# Allows for builds on Debian GNU Linux, X11 is in a different place 
+-  CPPFLAGS += -I/usr/X11R6/include/X11/extensions \
+-              -I/usr/include/X11/extensions \
+-              -I$(MOTIF_DIR)/include \
+-              -I$(OPENWIN_HOME)/include 
+-endif
+-
+ ifeq ($(PLATFORM), solaris)
+   CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions -I$(MOTIF_DIR)/include 
+ endif

+ 12 - 2
package/openjdk/patches/disable-backtrace.patch

@@ -1,6 +1,16 @@
 --- w-openjdk-6-1.orig/openjdk-6/jdk/src/solaris/native/sun/xawt/XToolkit.c	2011-02-28 17:06:50.000000000 +0100
 --- w-openjdk-6-1.orig/openjdk-6/jdk/src/solaris/native/sun/xawt/XToolkit.c	2011-02-28 17:06:50.000000000 +0100
-+++ w-openjdk-6-1/openjdk-6/jdk/src/solaris/native/sun/xawt/XToolkit.c	2011-04-10 22:33:28.481412674 +0200
-@@ -689,7 +689,7 @@
++++ w-openjdk-6-1/openjdk-6/jdk/src/solaris/native/sun/xawt/XToolkit.c	2011-08-08 10:45:01.445330729 +0200
+@@ -27,9 +27,6 @@
+ #include <X11/Xutil.h>
+ #include <X11/Xos.h>
+ #include <X11/Xatom.h>
+-#ifdef __linux__
+-#include <execinfo.h>
+-#endif
+ 
+ #include <jvm.h>
+ #include <jni.h>
+@@ -689,7 +686,7 @@
      return ret;
      return ret;
  }
  }
  
  

+ 22 - 0
package/openjdk/patches/inc-path.patch

@@ -0,0 +1,22 @@
+--- w-openjdk-6-1.orig/openjdk-6/jdk/make/common/Defs.gmk	2011-02-28 17:06:10.000000000 +0100
++++ w-openjdk-6-1/openjdk-6/jdk/make/common/Defs.gmk	2011-08-07 21:21:49.335286149 +0200
+@@ -173,7 +173,7 @@
+     ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
+       FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include
+     else
+-      FREETYPE_HEADERS_PATH = /usr/include
++      FREETYPE_HEADERS_PATH = /usr/include/disabled
+     endif
+   endif
+ endif
+--- w-openjdk-6-1.orig/openjdk-6/jdk/make/common/shared/Defs-linux.gmk	2011-02-28 17:06:10.000000000 +0100
++++ w-openjdk-6-1/openjdk-6/jdk/make/common/shared/Defs-linux.gmk	2011-08-08 10:07:58.975256728 +0200
+@@ -170,7 +170,7 @@
+   GCC29_COMPILER_PATH = $(JDK_DEVTOOLS_DIR)/$(PLATFORM)/gcc29/usr/
+ endif
+ 
+-_CUPS_HEADERS_PATH=/usr/include
++_CUPS_HEADERS_PATH=/usr/include/disabled
+ 
+ # Import JDK images allow for partial builds, components not built are
+ #    imported (or copied from) these import areas when needed.

+ 92 - 0
package/openjdk/patches/uClibc-compat.patch

@@ -0,0 +1,92 @@
+--- w-openjdk-6-1.orig/openjdk-6/hotspot/src/os/linux/vm/os_linux.cpp	2011-02-28 17:03:14.000000000 +0100
++++ w-openjdk-6-1/openjdk-6/hotspot/src/os/linux/vm/os_linux.cpp	2011-08-07 14:30:00.195403776 +0200
+@@ -53,7 +53,6 @@
+ # include <string.h>
+ # include <syscall.h>
+ # include <sys/sysinfo.h>
+-# include <gnu/libc-version.h>
+ # include <sys/ipc.h>
+ # include <sys/shm.h>
+ # include <link.h>
+@@ -553,9 +552,10 @@
+      os::Linux::set_glibc_version(str);
+   } else {
+      // _CS_GNU_LIBC_VERSION is not supported, try gnu_get_libc_version()
+-     static char _gnu_libc_version[32];
+-     jio_snprintf(_gnu_libc_version, sizeof(_gnu_libc_version),
+-              "glibc %s %s", gnu_get_libc_version(), gnu_get_libc_release());
++     // static char _gnu_libc_version[32];
++     // jio_snprintf(_gnu_libc_version, sizeof(_gnu_libc_version),
++     //       "glibc %s %s", gnu_get_libc_version(), gnu_get_libc_release());
++     static char _gnu_libc_version[32] = "2.12";
+      os::Linux::set_glibc_version(_gnu_libc_version);
+   }
+
+@@ -2434,10 +2434,8 @@
+ // If we are running with earlier version, which did not have symbol versions,
+ // we should use the base version.
+ void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
+-  void *f = dlvsym(handle, name, "libnuma_1.1");
+-  if (f == NULL) {
+-    f = dlsym(handle, name);
+-  }
++  void *f;
++  f = dlsym(handle, name);
+   return f;
+ }
+ 
+@@ -4446,7 +4444,21 @@
+ // Linux doesn't yet have a (official) notion of processor sets,
+ // so just return the system wide load average.
+ int os::loadavg(double loadavg[], int nelem) {
+-  return ::getloadavg(loadavg, nelem);
++ FILE *LOADAVG;
++ double avg[3] = { 0.0, 0.0, 0.0 };
++ int i, res = -1;;
++
++ if ((LOADAVG = fopen("/proc/loadavg", "r"))) {
++ fscanf(LOADAVG, "%lf %lf %lf", &avg[0], &avg[1], &avg[2]);
++ res = 0;
++ fclose(LOADAVG);
++ }
++
++ for (i = 0; (i < nelem) && (i < 3); i++) {
++ loadavg[i] = avg[i];
++ }
++
++ return res;
+ }
+ 
+ void os::pause() {
+
+--- w-openjdk-6-1.orig/openjdk-6/hotspot/make/linux/platform_zero.in	2011-02-28 17:03:13.000000000 +0100
++++ w-openjdk-6-1/openjdk-6/hotspot/make/linux/platform_zero.in	2011-08-07 13:56:56.875281880 +0200
+@@ -14,4 +14,4 @@
+ 
+ gnu_dis_arch = zero
+ 
+-sysdefs = -DLINUX -D_GNU_SOURCE -DCC_INTERP -DZERO -D@ZERO_ARCHDEF@ -DZERO_LIBARCH=\"@ZERO_LIBARCH@\"
++sysdefs = -DLINUX -D_GNU_SOURCE -DCC_INTERP -DZERO -D@ZERO_ARCHDEF@ -DZERO_LIBARCH=\"@ZERO_LIBARCH@\" -D__STDC_LIMIT_MACROS
+
+--- w-openjdk-6-1.orig/openjdk-6/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2011-02-28 17:03:22.000000000 +0100
++++ w-openjdk-6-1/openjdk-6/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2011-08-07 12:32:09.325489647 +0200
+@@ -238,7 +238,7 @@
+ #endif
+ inline int g_isnan(double f) { return isnand(f); }
+ #elif LINUX
+-inline int g_isnan(float  f) { return isnanf(f); }
++inline int g_isnan(float  f) { return __isnanf(f); }
+ inline int g_isnan(double f) { return isnan(f); }
+ #else
+ #error "missing platform-specific definition here"
+@@ -252,8 +252,8 @@
+ 
+ // Checking for finiteness
+ 
+-inline int g_isfinite(jfloat  f)                 { return finite(f); }
+-inline int g_isfinite(jdouble f)                 { return finite(f); }
++inline int g_isfinite(jfloat  f)                 { return isfinite(f); }
++inline int g_isfinite(jdouble f)                 { return isfinite(f); }
+ 
+ 
+ // Wide characters

+ 2 - 2
package/rsync/Makefile

@@ -4,9 +4,9 @@
 include ${TOPDIR}/rules.mk
 include ${TOPDIR}/rules.mk
 
 
 PKG_NAME:=		rsync
 PKG_NAME:=		rsync
-PKG_VERSION:=		3.0.7
+PKG_VERSION:=		3.0.8
 PKG_RELEASE:=		1
 PKG_RELEASE:=		1
-PKG_MD5SUM:=		b53525900817cf1ba7ad3a516ab5bfe9
+PKG_MD5SUM:=		0ee8346ce16bdfe4c88a236e94c752b4
 PKG_DESCR:=		utility that provides fast incremental file transfer
 PKG_DESCR:=		utility that provides fast incremental file transfer
 PKG_SECTION:=		net/misc
 PKG_SECTION:=		net/misc
 PKG_DEPENDS:=		libpopt
 PKG_DEPENDS:=		libpopt

+ 2 - 2
package/screen/Makefile

@@ -9,8 +9,8 @@ PKG_RELEASE:=		2
 PKG_MD5SUM:=		8506fd205028a96c741e4037de6e3c42
 PKG_MD5SUM:=		8506fd205028a96c741e4037de6e3c42
 PKG_DESCR:=		A window manager for the terminal session
 PKG_DESCR:=		A window manager for the terminal session
 PKG_SECTION:=		misc
 PKG_SECTION:=		misc
-PKG_DEPENDS:=		libncurses
-PKG_BUILDDEP:=		ncurses
+PKG_DEPENDS:=		libncurses libelf
+PKG_BUILDDEP:=		ncurses libelf
 PKG_URL:=		http://www.gnu.org/software/screen/
 PKG_URL:=		http://www.gnu.org/software/screen/
 PKG_SITES:=		${MASTER_SITE_GNU:=screen/}
 PKG_SITES:=		${MASTER_SITE_GNU:=screen/}
 
 

+ 1 - 1
target/linux/config/Config.in.debug

@@ -36,7 +36,7 @@ config ADK_KERNEL_MAGIC_SYSRQ
 config ADK_KERNEL_DEBUG_FS
 config ADK_KERNEL_DEBUG_FS
 	prompt "Debug Filesystem"
 	prompt "Debug Filesystem"
 	boolean
 	boolean
-	default n
+	default y
 	help
 	help
 	  debugfs is a virtual file system that kernel developers use to put
 	  debugfs is a virtual file system that kernel developers use to put
 	  debugging files into.  Enable this option to be able to read and
 	  debugging files into.  Enable this option to be able to read and

+ 5 - 0
target/linux/config/Config.in.fs

@@ -1,7 +1,12 @@
 menu "Filesystems support"
 menu "Filesystems support"
 
 
+config ADK_KERNEL_FSNOTIFY
+	boolean
+	default y
+
 config ADK_KERNEL_EXPORTFS
 config ADK_KERNEL_EXPORTFS
 	boolean
 	boolean
+	default y
 
 
 config ADK_KERNEL_YAFFS_FS
 config ADK_KERNEL_YAFFS_FS
 	tristate
 	tristate

+ 1 - 0
target/linux/config/Config.in.fsnet

@@ -107,6 +107,7 @@ config ADK_KPACKAGE_KMOD_NFSD
 	select ADK_KERNEL_NFSD_V4
 	select ADK_KERNEL_NFSD_V4
 	select ADK_KERNEL_DNOTIFY
 	select ADK_KERNEL_DNOTIFY
 	select ADK_KPACKAGE_KMOD_SUNRPC
 	select ADK_KPACKAGE_KMOD_SUNRPC
+	select ADK_KPACKAGE_KMOD_SUNRPC_GSS
 	select ADK_KPACKAGE_KMOD_LOCKD
 	select ADK_KPACKAGE_KMOD_LOCKD
 	select ADK_KERNEL_NETWORK_FILESYSTEMS
 	select ADK_KERNEL_NETWORK_FILESYSTEMS
 	depends on !ADK_TARGET_ROOTFS_NFSROOT
 	depends on !ADK_TARGET_ROOTFS_NFSROOT

+ 1 - 1
target/linux/config/Config.in.netfilter

@@ -2,7 +2,7 @@ menu "Netfilter (Firewall/Filtering)"
 
 
 config ADK_KERNEL_NETFILTER
 config ADK_KERNEL_NETFILTER
 	bool
 	bool
-	default n
+	default y
 
 
 config ADK_KERNEL_NETFILTER_ADVANCED
 config ADK_KERNEL_NETFILTER_ADVANCED
 	bool
 	bool

+ 26 - 0
target/linux/patches/2.6.39/defaults.patch

@@ -0,0 +1,26 @@
+diff -Nur linux-2.6.39.orig/fs/Kconfig linux-2.6.39/fs/Kconfig
+--- linux-2.6.39.orig/fs/Kconfig	2011-05-19 06:06:34.000000000 +0200
++++ linux-2.6.39/fs/Kconfig	2011-08-08 20:33:22.618014757 +0200
+@@ -44,10 +44,10 @@
+ # this symbol for ifdefs in core code.
+ #
+ config FS_POSIX_ACL
+-	def_bool n
++	def_bool y
+ 
+ config EXPORTFS
+-	bool
++	def_bool y
+ 
+ config FILE_LOCKING
+ 	bool "Enable POSIX file locking API" if EXPERT
+diff -Nur linux-2.6.39.orig/fs/notify/Kconfig linux-2.6.39/fs/notify/Kconfig
+--- linux-2.6.39.orig/fs/notify/Kconfig	2011-05-19 06:06:34.000000000 +0200
++++ linux-2.6.39/fs/notify/Kconfig	2011-08-08 20:33:38.328017344 +0200
+@@ -1,5 +1,5 @@
+ config FSNOTIFY
+-	def_bool n
++	def_bool y
+ 
+ source "fs/notify/dnotify/Kconfig"
+ source "fs/notify/inotify/Kconfig"

+ 174 - 0
toolchain/uClibc/patches/rpath-origin.patch

@@ -0,0 +1,174 @@
+diff -Nur uClibc-0.9.32.orig//ldso/ldso/dl-elf.c uClibc-0.9.32/ldso/ldso/dl-elf.c
+--- uClibc-0.9.32.orig//ldso/ldso/dl-elf.c	2011-06-08 21:35:20.000000000 +0200
++++ uClibc-0.9.32/ldso/ldso/dl-elf.c	2011-08-09 11:19:18.325314589 +0200
+@@ -133,53 +133,59 @@
+  * in uClibc/ldso/util/ldd.c */
+ static struct elf_resolve *
+ search_for_named_library(const char *name, int secure, const char *path_list,
+-	struct dyn_elf **rpnt)
++	struct dyn_elf **rpnt, const char *origin)
+ {
+-	char *path, *path_n, *mylibname;
++	char *mylibname;
++	const char *p, *pn;
+ 	struct elf_resolve *tpnt;
+-	int done;
++	int plen;
+ 
+ 	if (path_list==NULL)
+ 		return NULL;
+ 
+-	/* We need a writable copy of this string, but we don't
+-	 * need this allocated permanently since we don't want
+-	 * to leak memory, so use alloca to put path on the stack */
+-	done = _dl_strlen(path_list);
+-	path = alloca(done + 1);
+-
+ 	/* another bit of local storage */
+ 	mylibname = alloca(2050);
+ 
+-	_dl_memcpy(path, path_list, done+1);
+-
+ 	/* Unlike ldd.c, don't bother to eliminate double //s */
+ 
+ 	/* Replace colons with zeros in path_list */
+ 	/* : at the beginning or end of path maps to CWD */
+ 	/* :: anywhere maps CWD */
+ 	/* "" maps to CWD */
+-	done = 0;
+-	path_n = path;
+-	do {
+-		if (*path == 0) {
+-			*path = ':';
+-			done = 1;
++	for (p = path_list; p != NULL; p = pn) { 
++		pn = _dl_strchr(p + 1, ':');
++		if (pn != NULL) {
++			plen = pn - p;
++			pn++;
++		} else
++			plen = _dl_strlen(p);
++
++		if (plen >= 7 && _dl_memcmp(p, "$ORIGIN", 7) == 0) {
++			int olen;
++			if (secure && plen != 7)
++				continue;
++			if (origin == NULL)
++				continue;
++			for (olen = _dl_strlen(origin) - 1; olen >= 0 && origin[olen] != '/'; olen--)
++				;
++			if (olen <= 0)
++				continue;
++			_dl_memcpy(&mylibname[0], origin, olen);
++			_dl_memcpy(&mylibname[olen], p + 7, plen - 7);
++			mylibname[olen + plen - 7] = 0;
++		} else if (plen != 0) {
++			_dl_memcpy(mylibname, p, plen);
++			mylibname[plen] = 0; 
++		} else {
++			_dl_strcpy(mylibname, ".");
+ 		}
+-		if (*path == ':') {
+-			*path = 0;
+-			if (*path_n)
+-				_dl_strcpy(mylibname, path_n);
+-			else
+-				_dl_strcpy(mylibname, "."); /* Assume current dir if empty path */
+-			_dl_strcat(mylibname, "/");
+-			_dl_strcat(mylibname, name);
+-			if ((tpnt = _dl_load_elf_shared_library(secure, rpnt, mylibname)) != NULL)
+-				return tpnt;
+-			path_n = path+1;
+-		}
+-		path++;
+-	} while (!done);
++		_dl_strcat(mylibname, "/");
++		_dl_strcat(mylibname, name); 
++		
++		tpnt = _dl_load_elf_shared_library(secure, rpnt, mylibname);
++		if (tpnt != NULL)
++			return tpnt;
++	}
+ 	return NULL;
+ }
+ 
+@@ -231,7 +237,7 @@
+ 	if (pnt) {
+ 		pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
+ 		_dl_if_debug_dprint("\tsearching RPATH='%s'\n", pnt);
+-		if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt)) != NULL)
++		if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt, tpnt->libname)) != NULL)
+ 			return tpnt1;
+ 	}
+ #endif
+@@ -239,7 +245,7 @@
+ 	/* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */
+ 	if (_dl_library_path) {
+ 		_dl_if_debug_dprint("\tsearching LD_LIBRARY_PATH='%s'\n", _dl_library_path);
+-		if ((tpnt1 = search_for_named_library(libname, secure, _dl_library_path, rpnt)) != NULL)
++		if ((tpnt1 = search_for_named_library(libname, secure, _dl_library_path, rpnt, NULL)) != NULL)
+ 		{
+ 			return tpnt1;
+ 		}
+@@ -253,7 +259,7 @@
+ 	if (pnt) {
+ 		pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
+ 		_dl_if_debug_dprint("\tsearching RUNPATH='%s'\n", pnt);
+-		if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt)) != NULL)
++		if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt, NULL)) != NULL)
+ 			return tpnt1;
+ 	}
+ #endif
+@@ -287,7 +293,7 @@
+ 	/* Look for libraries wherever the shared library loader
+ 	 * was installed */
+ 	_dl_if_debug_dprint("\tsearching ldso dir='%s'\n", _dl_ldsopath);
+-	tpnt1 = search_for_named_library(libname, secure, _dl_ldsopath, rpnt);
++	tpnt1 = search_for_named_library(libname, secure, _dl_ldsopath, rpnt, NULL);
+ 	if (tpnt1 != NULL)
+ 		return tpnt1;
+ 
+@@ -300,7 +306,7 @@
+ #ifndef __LDSO_CACHE_SUPPORT__
+ 					":" UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib"
+ #endif
+-					, rpnt);
++					, rpnt, NULL);
+ 	if (tpnt1 != NULL)
+ 		return tpnt1;
+ 
+diff -Nur uClibc-0.9.32.orig//ldso/ldso/ldso.c uClibc-0.9.32/ldso/ldso/ldso.c
+--- uClibc-0.9.32.orig//ldso/ldso/ldso.c	2011-06-08 21:35:20.000000000 +0200
++++ uClibc-0.9.32/ldso/ldso/ldso.c	2011-08-09 11:15:04.135386129 +0200
+@@ -272,6 +272,20 @@
+ 	}
+ }
+ 
++static void _dl_setup_progname(const char *argv0)
++{
++	char image[PATH_MAX];
++	ssize_t s;
++
++	s = _dl_readlink("/proc/self/exe", image, sizeof(image));
++	if (s > 0 && image[0] == '/') {
++	 image[s] = 0;
++	 _dl_progname = _dl_strdup(image);
++	} else if (argv0) {
++	 _dl_progname = argv0;
++	}
++}
++
+ void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
+ 			  ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp,
+ 			  char **argv
+@@ -321,9 +335,7 @@
+ 	 * been fixed up by now.  Still no function calls outside of this
+ 	 * library, since the dynamic resolver is not yet ready.
+ 	 */
+-	if (argv[0]) {
+-		_dl_progname = argv[0];
+-	}
++	_dl_setup_progname(argv[0]);
+ 
+ 	if (_start == (void *) auxvt[AT_ENTRY].a_un.a_val) {
+ 		_dl_dprintf(_dl_debug_file, "Standalone execution is not supported yet\n");