aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/eglibc/patches
diff options
context:
space:
mode:
authorJames <>2013-03-17 12:16:37 +0000
committerJames <>2013-03-17 12:16:37 +0000
commit27b76ab0671089c47506615a796a261e993896a7 (patch)
tree61213d67e7fa87b20356b23798558e2c4212c42f /toolchain/eglibc/patches
downloadtrunk-36060-master.tar.gz
trunk-36060-master.tar.bz2
trunk-36060-master.zip
Diffstat (limited to 'toolchain/eglibc/patches')
-rw-r--r--toolchain/eglibc/patches/.svn/entries34
-rw-r--r--toolchain/eglibc/patches/2.15/.svn/entries198
-rw-r--r--toolchain/eglibc/patches/2.15/.svn/text-base/001-fix_autoconf_macro.patch.svn-base48
-rw-r--r--toolchain/eglibc/patches/2.15/.svn/text-base/100-fix_cross_rpcgen.patch.svn-base71
-rw-r--r--toolchain/eglibc/patches/2.15/.svn/text-base/110-fix_cross_zic.patch.svn-base27
-rw-r--r--toolchain/eglibc/patches/2.15/.svn/text-base/120-use_host_cflags.patch.svn-base22
-rw-r--r--toolchain/eglibc/patches/2.15/.svn/text-base/200-add-dl-search-paths.patch.svn-base14
-rw-r--r--toolchain/eglibc/patches/2.15/001-fix_autoconf_macro.patch48
-rw-r--r--toolchain/eglibc/patches/2.15/100-fix_cross_rpcgen.patch71
-rw-r--r--toolchain/eglibc/patches/2.15/110-fix_cross_zic.patch27
-rw-r--r--toolchain/eglibc/patches/2.15/120-use_host_cflags.patch22
-rw-r--r--toolchain/eglibc/patches/2.15/200-add-dl-search-paths.patch14
-rw-r--r--toolchain/eglibc/patches/2.16/.svn/entries164
-rw-r--r--toolchain/eglibc/patches/2.16/.svn/text-base/001-Avoid-use-of-libgcc_s-and-libgcc_eh-when-building-gl.patch.svn-base343
-rw-r--r--toolchain/eglibc/patches/2.16/.svn/text-base/002-Add-ARM-specific-static-stubs.c.patch.svn-base27
-rw-r--r--toolchain/eglibc/patches/2.16/.svn/text-base/003-mips-rld-map-check.patch.svn-base26
-rw-r--r--toolchain/eglibc/patches/2.16/.svn/text-base/200-add-dl-search-paths.patch.svn-base14
-rw-r--r--toolchain/eglibc/patches/2.16/001-Avoid-use-of-libgcc_s-and-libgcc_eh-when-building-gl.patch343
-rw-r--r--toolchain/eglibc/patches/2.16/002-Add-ARM-specific-static-stubs.c.patch27
-rw-r--r--toolchain/eglibc/patches/2.16/003-mips-rld-map-check.patch26
-rw-r--r--toolchain/eglibc/patches/2.16/200-add-dl-search-paths.patch14
21 files changed, 1580 insertions, 0 deletions
diff --git a/toolchain/eglibc/patches/.svn/entries b/toolchain/eglibc/patches/.svn/entries
new file mode 100644
index 0000000..e66707e
--- /dev/null
+++ b/toolchain/eglibc/patches/.svn/entries
@@ -0,0 +1,34 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/toolchain/eglibc/patches
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-11-21T20:26:47.618715Z
+34290
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+2.15
+dir
+
+2.16
+dir
+
diff --git a/toolchain/eglibc/patches/2.15/.svn/entries b/toolchain/eglibc/patches/2.15/.svn/entries
new file mode 100644
index 0000000..98a3bf7
--- /dev/null
+++ b/toolchain/eglibc/patches/2.15/.svn/entries
@@ -0,0 +1,198 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/toolchain/eglibc/patches/2.15
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-10-31T00:24:00.834736Z
+34026
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+001-fix_autoconf_macro.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+c09a6b07a644207f59c3a1a944cd4c67
+2012-06-07T12:24:25.679910Z
+32101
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1539
+
+110-fix_cross_zic.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+2434691b4892a595eddbdebe794a4d79
+2012-06-07T12:24:25.679910Z
+32101
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+708
+
+200-add-dl-search-paths.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+4257f0c32830da279484205acedf96f6
+2012-06-07T12:24:25.679910Z
+32101
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+367
+
+120-use_host_cflags.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+48a5b72a8700222dec9127b76f503d4f
+2012-10-31T00:24:00.834736Z
+34026
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+885
+
+100-fix_cross_rpcgen.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+7a4618804cc8cf88daff0246a4f791bd
+2012-06-07T12:24:25.679910Z
+32101
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2090
+
diff --git a/toolchain/eglibc/patches/2.15/.svn/text-base/001-fix_autoconf_macro.patch.svn-base b/toolchain/eglibc/patches/2.15/.svn/text-base/001-fix_autoconf_macro.patch.svn-base
new file mode 100644
index 0000000..55b26c7
--- /dev/null
+++ b/toolchain/eglibc/patches/2.15/.svn/text-base/001-fix_autoconf_macro.patch.svn-base
@@ -0,0 +1,48 @@
+--- a/libc/aclocal.m4
++++ b/libc/aclocal.m4
+@@ -88,6 +88,12 @@
+ fi
+ rm -fr contest*])
+
++dnl Test a compiler option or options with an empty input file.
++dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false])
++AC_DEFUN([LIBC_TRY_CC_OPTION],
++[AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])],
++ [$2], [$3])])
++
+ AC_DEFUN([LIBC_PROG_BINUTILS],
+ [# Was a --with-binutils option given?
+ if test -n "$path_binutils"; then
+--- a/libc/configure
++++ b/libc/configure
+@@ -7404,7 +7404,14 @@
+ else
+ libc_cv_cc_nofma=
+ for opt in -ffp-contract=off -mno-fused-madd; do
+- LIBC_TRY_CC_OPTION($opt, libc_cv_cc_nofma=$opt; break)
++ if { ac_try='${CC-cc} $opt -xc /dev/null -S -o /dev/null'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; }; then :
++ libc_cv_cc_nofma=$opt; break
++fi
+ done
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_nofma" >&5
+--- a/libc/configure.in
++++ b/libc/configure.in
+@@ -2238,10 +2238,9 @@
+ libc_cv_cc_submachine, [dnl
+ libc_cv_cc_submachine=no
+ for opt in "-march=$submachine" "-mcpu=$submachine"; do
+- if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
++ LIBC_TRY_CC_OPTION([$opt], [
+ libc_cv_cc_submachine="$opt"
+- break
+- fi
++ break], [])
+ done])
+ if test "x$libc_cv_cc_submachine" = xno; then
+ AC_MSG_ERROR([${CC-cc} does not support $submachine])
diff --git a/toolchain/eglibc/patches/2.15/.svn/text-base/100-fix_cross_rpcgen.patch.svn-base b/toolchain/eglibc/patches/2.15/.svn/text-base/100-fix_cross_rpcgen.patch.svn-base
new file mode 100644
index 0000000..8fe5cf3
--- /dev/null
+++ b/toolchain/eglibc/patches/2.15/.svn/text-base/100-fix_cross_rpcgen.patch.svn-base
@@ -0,0 +1,71 @@
+--- a/libc/sunrpc/proto.h
++++ b/libc/sunrpc/proto.h
+@@ -56,12 +56,14 @@ void add_type(int len, const char *type)
+ $build's C library and $host's GLIBC. */
+ #ifdef _CROSS_RPCGEN_
+
++#undef stpcpy
++
+ /* Rather then defining _GNU_SOURCE before including $build's <string.h>
+ we just declare stpcpy here. */
+ extern char *stpcpy (char *, const char *);
+
+-/* Use $build's i18n support as we can't use $host's. */
+-#define _(X) (gettext (X))
++/* Do not use i18n support */
++#define _(X) (X)
+
+ /* rpcgen sources check for __GNU_LIBRARY__ to tweak for GLIBC code
+ that rpcgen generates. The proper fix would be to rename all those checks
+--- a/libc/sunrpc/rpc/types.h
++++ b/libc/sunrpc/rpc/types.h
+@@ -70,18 +70,23 @@ typedef unsigned long rpcport_t;
+ #endif
+
+ #ifndef __u_char_defined
+-typedef __u_char u_char;
+-typedef __u_short u_short;
+-typedef __u_int u_int;
+-typedef __u_long u_long;
+-typedef __quad_t quad_t;
+-typedef __u_quad_t u_quad_t;
+-typedef __fsid_t fsid_t;
++typedef unsigned char u_char;
++typedef unsigned short u_short;
++typedef unsigned int u_int;
++typedef unsigned long u_long;
++#if __WORDSIZE == 64
++typedef long int quad_t;
++typedef unsigned long int u_quad_t;
++#elif defined __GLIBC_HAVE_LONG_LONG
++typedef long long int quad_t;
++typedef unsigned long long int u_quad_t;
++#endif
++typedef u_quad_t fsid_t;
+ # define __u_char_defined
+ #endif
+-#ifndef __daddr_t_defined
+-typedef __daddr_t daddr_t;
+-typedef __caddr_t caddr_t;
++#if !defined(__daddr_t_defined) && defined(linux)
++typedef long int daddr_t;
++typedef char *caddr_t;
+ # define __daddr_t_defined
+ #endif
+
+--- a/libc/sunrpc/rpc_main.c
++++ b/libc/sunrpc/rpc_main.c
+@@ -997,9 +997,10 @@ mkfile_output (struct commandline *cmd)
+ abort ();
+ temp = rindex (cmd->infile, '.');
+ cp = stpcpy (mkfilename, "Makefile.");
+- if (temp != NULL)
+- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
+- else
++ if (temp != NULL) {
++ strncpy(cp, cmd->infile, temp - cmd->infile);
++ cp[temp - cmd->infile - 1] = 0;
++ } else
+ stpcpy (cp, cmd->infile);
+
+ }
diff --git a/toolchain/eglibc/patches/2.15/.svn/text-base/110-fix_cross_zic.patch.svn-base b/toolchain/eglibc/patches/2.15/.svn/text-base/110-fix_cross_zic.patch.svn-base
new file mode 100644
index 0000000..221eb28
--- /dev/null
+++ b/toolchain/eglibc/patches/2.15/.svn/text-base/110-fix_cross_zic.patch.svn-base
@@ -0,0 +1,27 @@
+--- a/libc/timezone/zic.c
++++ b/libc/timezone/zic.c
+@@ -8,6 +8,8 @@ static char elsieid[] = "@(#)zic.c 8.19"
+ #ifdef CROSS_ZIC
+ #define REPORT_BUGS_TO ""
+ #define PKGVERSION ""
++#undef _
++#define _(X) (X)
+ #else
+ #include "config.h"
+ #endif
+@@ -490,6 +492,7 @@ char * argv[];
+ #ifdef unix
+ (void) umask(umask(S_IWGRP | S_IWOTH) | (S_IWGRP | S_IWOTH));
+ #endif /* defined unix */
++#ifndef CROSS_ZIC
+ #if HAVE_GETTEXT
+ (void) setlocale(LC_ALL, "");
+ #ifdef TZ_DOMAINDIR
+@@ -497,6 +500,7 @@ char * argv[];
+ #endif /* defined TEXTDOMAINDIR */
+ (void) textdomain(TZ_DOMAIN);
+ #endif /* HAVE_GETTEXT */
++#endif
+ progname = argv[0];
+ if (TYPE_BIT(zic_t) < 64) {
+ (void) fprintf(stderr, "%s: %s\n", progname,
diff --git a/toolchain/eglibc/patches/2.15/.svn/text-base/120-use_host_cflags.patch.svn-base b/toolchain/eglibc/patches/2.15/.svn/text-base/120-use_host_cflags.patch.svn-base
new file mode 100644
index 0000000..4c58fb4
--- /dev/null
+++ b/toolchain/eglibc/patches/2.15/.svn/text-base/120-use_host_cflags.patch.svn-base
@@ -0,0 +1,22 @@
+--- a/libc/sunrpc/Makefile
++++ b/libc/sunrpc/Makefile
+@@ -175,7 +175,7 @@ $(objpfx)rpcgen: $(addprefix $(objpfx),$
+ $(+link)
+
+ $(addprefix $(objpfx)cross-,$(rpcgen-objs)): $(objpfx)cross-%.o: %.c
+- gcc $< -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ \
++ gcc $< -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ $(HOST_CFLAGS) \
+ $(OUTPUT_OPTION) $(compile-mkdep-flags)
+
+ $(objpfx)cross-rpcgen: $(addprefix $(objpfx)cross-,$(rpcgen-objs))
+--- a/libc/timezone/Makefile
++++ b/libc/timezone/Makefile
+@@ -182,7 +182,7 @@ $(objpfx)zic: $(addprefix $(objpfx), $(z
+
+ $(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c
+ gcc $< -c $(OUTPUT_OPTION) $(CFLAGS-$*.c) $(CPPFLAGS-$*) \
+- -DCROSS_ZIC $(compile-mkdep-flags)
++ -DCROSS_ZIC $(HOST_CFLAGS) $(compile-mkdep-flags)
+
+ $(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))
+ gcc $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@
diff --git a/toolchain/eglibc/patches/2.15/.svn/text-base/200-add-dl-search-paths.patch.svn-base b/toolchain/eglibc/patches/2.15/.svn/text-base/200-add-dl-search-paths.patch.svn-base
new file mode 100644
index 0000000..70e7e60
--- /dev/null
+++ b/toolchain/eglibc/patches/2.15/.svn/text-base/200-add-dl-search-paths.patch.svn-base
@@ -0,0 +1,14 @@
+add /usr/lib to default search path for the dynamic linker
+
+--- a/libc/Makeconfig
++++ b/libc/Makeconfig
+@@ -539,6 +539,9 @@
+ default-rpath = $(libdir)
+ endif
+
++# Add /usr/lib to default search path for the dynamic linker
++user-defined-trusted-dirs := /usr/lib
++
+ ifndef link-extra-libs
+ link-extra-libs = $(LDLIBS-$(@F))
+ link-extra-libs-static = $(link-extra-libs)
diff --git a/toolchain/eglibc/patches/2.15/001-fix_autoconf_macro.patch b/toolchain/eglibc/patches/2.15/001-fix_autoconf_macro.patch
new file mode 100644
index 0000000..55b26c7
--- /dev/null
+++ b/toolchain/eglibc/patches/2.15/001-fix_autoconf_macro.patch
@@ -0,0 +1,48 @@
+--- a/libc/aclocal.m4
++++ b/libc/aclocal.m4
+@@ -88,6 +88,12 @@
+ fi
+ rm -fr contest*])
+
++dnl Test a compiler option or options with an empty input file.
++dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false])
++AC_DEFUN([LIBC_TRY_CC_OPTION],
++[AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])],
++ [$2], [$3])])
++
+ AC_DEFUN([LIBC_PROG_BINUTILS],
+ [# Was a --with-binutils option given?
+ if test -n "$path_binutils"; then
+--- a/libc/configure
++++ b/libc/configure
+@@ -7404,7 +7404,14 @@
+ else
+ libc_cv_cc_nofma=
+ for opt in -ffp-contract=off -mno-fused-madd; do
+- LIBC_TRY_CC_OPTION($opt, libc_cv_cc_nofma=$opt; break)
++ if { ac_try='${CC-cc} $opt -xc /dev/null -S -o /dev/null'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; }; then :
++ libc_cv_cc_nofma=$opt; break
++fi
+ done
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_nofma" >&5
+--- a/libc/configure.in
++++ b/libc/configure.in
+@@ -2238,10 +2238,9 @@
+ libc_cv_cc_submachine, [dnl
+ libc_cv_cc_submachine=no
+ for opt in "-march=$submachine" "-mcpu=$submachine"; do
+- if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
++ LIBC_TRY_CC_OPTION([$opt], [
+ libc_cv_cc_submachine="$opt"
+- break
+- fi
++ break], [])
+ done])
+ if test "x$libc_cv_cc_submachine" = xno; then
+ AC_MSG_ERROR([${CC-cc} does not support $submachine])
diff --git a/toolchain/eglibc/patches/2.15/100-fix_cross_rpcgen.patch b/toolchain/eglibc/patches/2.15/100-fix_cross_rpcgen.patch
new file mode 100644
index 0000000..8fe5cf3
--- /dev/null
+++ b/toolchain/eglibc/patches/2.15/100-fix_cross_rpcgen.patch
@@ -0,0 +1,71 @@
+--- a/libc/sunrpc/proto.h
++++ b/libc/sunrpc/proto.h
+@@ -56,12 +56,14 @@ void add_type(int len, const char *type)
+ $build's C library and $host's GLIBC. */
+ #ifdef _CROSS_RPCGEN_
+
++#undef stpcpy
++
+ /* Rather then defining _GNU_SOURCE before including $build's <string.h>
+ we just declare stpcpy here. */
+ extern char *stpcpy (char *, const char *);
+
+-/* Use $build's i18n support as we can't use $host's. */
+-#define _(X) (gettext (X))
++/* Do not use i18n support */
++#define _(X) (X)
+
+ /* rpcgen sources check for __GNU_LIBRARY__ to tweak for GLIBC code
+ that rpcgen generates. The proper fix would be to rename all those checks
+--- a/libc/sunrpc/rpc/types.h
++++ b/libc/sunrpc/rpc/types.h
+@@ -70,18 +70,23 @@ typedef unsigned long rpcport_t;
+ #endif
+
+ #ifndef __u_char_defined
+-typedef __u_char u_char;
+-typedef __u_short u_short;
+-typedef __u_int u_int;
+-typedef __u_long u_long;
+-typedef __quad_t quad_t;
+-typedef __u_quad_t u_quad_t;
+-typedef __fsid_t fsid_t;
++typedef unsigned char u_char;
++typedef unsigned short u_short;
++typedef unsigned int u_int;
++typedef unsigned long u_long;
++#if __WORDSIZE == 64
++typedef long int quad_t;
++typedef unsigned long int u_quad_t;
++#elif defined __GLIBC_HAVE_LONG_LONG
++typedef long long int quad_t;
++typedef unsigned long long int u_quad_t;
++#endif
++typedef u_quad_t fsid_t;
+ # define __u_char_defined
+ #endif
+-#ifndef __daddr_t_defined
+-typedef __daddr_t daddr_t;
+-typedef __caddr_t caddr_t;
++#if !defined(__daddr_t_defined) && defined(linux)
++typedef long int daddr_t;
++typedef char *caddr_t;
+ # define __daddr_t_defined
+ #endif
+
+--- a/libc/sunrpc/rpc_main.c
++++ b/libc/sunrpc/rpc_main.c
+@@ -997,9 +997,10 @@ mkfile_output (struct commandline *cmd)
+ abort ();
+ temp = rindex (cmd->infile, '.');
+ cp = stpcpy (mkfilename, "Makefile.");
+- if (temp != NULL)
+- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
+- else
++ if (temp != NULL) {
++ strncpy(cp, cmd->infile, temp - cmd->infile);
++ cp[temp - cmd->infile - 1] = 0;
++ } else
+ stpcpy (cp, cmd->infile);
+
+ }
diff --git a/toolchain/eglibc/patches/2.15/110-fix_cross_zic.patch b/toolchain/eglibc/patches/2.15/110-fix_cross_zic.patch
new file mode 100644
index 0000000..221eb28
--- /dev/null
+++ b/toolchain/eglibc/patches/2.15/110-fix_cross_zic.patch
@@ -0,0 +1,27 @@
+--- a/libc/timezone/zic.c
++++ b/libc/timezone/zic.c
+@@ -8,6 +8,8 @@ static char elsieid[] = "@(#)zic.c 8.19"
+ #ifdef CROSS_ZIC
+ #define REPORT_BUGS_TO ""
+ #define PKGVERSION ""
++#undef _
++#define _(X) (X)
+ #else
+ #include "config.h"
+ #endif
+@@ -490,6 +492,7 @@ char * argv[];
+ #ifdef unix
+ (void) umask(umask(S_IWGRP | S_IWOTH) | (S_IWGRP | S_IWOTH));
+ #endif /* defined unix */
++#ifndef CROSS_ZIC
+ #if HAVE_GETTEXT
+ (void) setlocale(LC_ALL, "");
+ #ifdef TZ_DOMAINDIR
+@@ -497,6 +500,7 @@ char * argv[];
+ #endif /* defined TEXTDOMAINDIR */
+ (void) textdomain(TZ_DOMAIN);
+ #endif /* HAVE_GETTEXT */
++#endif
+ progname = argv[0];
+ if (TYPE_BIT(zic_t) < 64) {
+ (void) fprintf(stderr, "%s: %s\n", progname,
diff --git a/toolchain/eglibc/patches/2.15/120-use_host_cflags.patch b/toolchain/eglibc/patches/2.15/120-use_host_cflags.patch
new file mode 100644
index 0000000..4c58fb4
--- /dev/null
+++ b/toolchain/eglibc/patches/2.15/120-use_host_cflags.patch
@@ -0,0 +1,22 @@
+--- a/libc/sunrpc/Makefile
++++ b/libc/sunrpc/Makefile
+@@ -175,7 +175,7 @@ $(objpfx)rpcgen: $(addprefix $(objpfx),$
+ $(+link)
+
+ $(addprefix $(objpfx)cross-,$(rpcgen-objs)): $(objpfx)cross-%.o: %.c
+- gcc $< -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ \
++ gcc $< -c -D_RPC_THREAD_SAFE_ -D_CROSS_RPCGEN_ $(HOST_CFLAGS) \
+ $(OUTPUT_OPTION) $(compile-mkdep-flags)
+
+ $(objpfx)cross-rpcgen: $(addprefix $(objpfx)cross-,$(rpcgen-objs))
+--- a/libc/timezone/Makefile
++++ b/libc/timezone/Makefile
+@@ -182,7 +182,7 @@ $(objpfx)zic: $(addprefix $(objpfx), $(z
+
+ $(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c
+ gcc $< -c $(OUTPUT_OPTION) $(CFLAGS-$*.c) $(CPPFLAGS-$*) \
+- -DCROSS_ZIC $(compile-mkdep-flags)
++ -DCROSS_ZIC $(HOST_CFLAGS) $(compile-mkdep-flags)
+
+ $(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))
+ gcc $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@
diff --git a/toolchain/eglibc/patches/2.15/200-add-dl-search-paths.patch b/toolchain/eglibc/patches/2.15/200-add-dl-search-paths.patch
new file mode 100644
index 0000000..70e7e60
--- /dev/null
+++ b/toolchain/eglibc/patches/2.15/200-add-dl-search-paths.patch
@@ -0,0 +1,14 @@
+add /usr/lib to default search path for the dynamic linker
+
+--- a/libc/Makeconfig
++++ b/libc/Makeconfig
+@@ -539,6 +539,9 @@
+ default-rpath = $(libdir)
+ endif
+
++# Add /usr/lib to default search path for the dynamic linker
++user-defined-trusted-dirs := /usr/lib
++
+ ifndef link-extra-libs
+ link-extra-libs = $(LDLIBS-$(@F))
+ link-extra-libs-static = $(link-extra-libs)
diff --git a/toolchain/eglibc/patches/2.16/.svn/entries b/toolchain/eglibc/patches/2.16/.svn/entries
new file mode 100644
index 0000000..8413976
--- /dev/null
+++ b/toolchain/eglibc/patches/2.16/.svn/entries
@@ -0,0 +1,164 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/toolchain/eglibc/patches/2.16
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-11-21T20:26:47.618715Z
+34290
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+200-add-dl-search-paths.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+4257f0c32830da279484205acedf96f6
+2012-11-21T20:26:47.618715Z
+34290
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+367
+
+001-Avoid-use-of-libgcc_s-and-libgcc_eh-when-building-gl.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+e7d580d7d2dc9169d5443029b94f4648
+2012-10-12T14:42:38.132478Z
+33738
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+14041
+
+002-Add-ARM-specific-static-stubs.c.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+e16c99d0277d43a6ca339d78586de414
+2012-10-12T14:42:38.132478Z
+33738
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1024
+
+003-mips-rld-map-check.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+e120abc1d31d068753d7712e9165d54d
+2012-10-12T14:42:38.132478Z
+33738
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1082
+
diff --git a/toolchain/eglibc/patches/2.16/.svn/text-base/001-Avoid-use-of-libgcc_s-and-libgcc_eh-when-building-gl.patch.svn-base b/toolchain/eglibc/patches/2.16/.svn/text-base/001-Avoid-use-of-libgcc_s-and-libgcc_eh-when-building-gl.patch.svn-base
new file mode 100644
index 0000000..e1444aa
--- /dev/null
+++ b/toolchain/eglibc/patches/2.16/.svn/text-base/001-Avoid-use-of-libgcc_s-and-libgcc_eh-when-building-gl.patch.svn-base
@@ -0,0 +1,343 @@
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+From 95f5a9a866695da4e038aa4e6ccbbfd5d9cf63b7 Mon Sep 17 00:00:00 2001
+From: Joseph Myers <joseph@codesourcery.com>
+Date: Tue, 3 Jul 2012 19:14:59 +0000
+Subject: [PATCH] Avoid use of libgcc_s and libgcc_eh when building glibc.
+
+---
+ ChangeLog | 47 ++++++++++++++++++++++++++++++
+ Makeconfig | 68 ++++++++++++++++++++++++++++++++++++++------
+ Rules | 45 ++++++++++++++++++++++-------
+ elf/Makefile | 6 +++-
+ elf/static-stubs.c | 46 ++++++++++++++++++++++++++++++
+ ports/ChangeLog.arm | 7 +++++
+ ports/sysdeps/arm/Makefile | 8 ++++++
+ 7 files changed, 206 insertions(+), 21 deletions(-)
+ create mode 100644 elf/static-stubs.c
+
+Index: a/libc/Makeconfig
+===================================================================
+--- a/libc/Makeconfig 2012-07-04 18:26:22.000000000 -0700
++++ b/libc/Makeconfig 2012-08-14 20:16:10.197093639 -0700
+@@ -415,9 +415,9 @@
+ LDFLAGS-rtld += $(hashstyle-LDFLAGS)
+ endif
+
+-# Command for linking programs with the C library.
++# Commands for linking programs with the C library.
+ ifndef +link
+-+link = $(CC) -nostdlib -nostartfiles -o $@ \
+++link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
+ $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
+ $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
+ $(addprefix $(csu-objpfx),$(start-installed-name)) \
+@@ -426,7 +426,10 @@
+ $(start-installed-name))\
+ $(+preinit) $(link-extra-libs) \
+ $(common-objpfx)libc% $(+postinit),$^) \
+- $(link-extra-libs) $(link-libc) $(+postctor) $(+postinit)
++ $(link-extra-libs)
+++link-after-libc = $(+postctor) $(+postinit)
+++link = $(+link-before-libc) $(link-libc) $(+link-after-libc)
+++link-tests = $(+link-before-libc) $(link-libc-tests) $(+link-after-libc)
+ endif
+ # Command for linking PIE programs with the C library.
+ ifndef +link-pie
+@@ -443,7 +446,7 @@
+ endif
+ # Command for statically linking programs with the C library.
+ ifndef +link-static
+-+link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \
+++link-static-before-libc = $(CC) -nostdlib -nostartfiles -static -o $@ \
+ $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
+ $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
+ $(+preinit) $(+prector) \
+@@ -451,7 +454,12 @@
+ $(start-installed-name))\
+ $(+preinit) $(link-extra-libs-static) \
+ $(common-objpfx)libc% $(+postinit),$^) \
+- $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
++ $(link-extra-libs-static) $(link-libc-static)
+++link-static-after-libc = $(+postctor) $(+postinit)
+++link-static = $(+link-static-before-libc) $(link-libc-static) \
++ $(+link-static-after-libc)
+++link-static-tests = $(+link-static-before-libc) $(link-libc-static-tests) \
++ $(+link-static-after-libc)
+ endif
+ # Command for statically linking bounded-pointer programs with the C library.
+ ifndef +link-bounded
+@@ -475,10 +483,12 @@
+ # We need the versioned name of libc.so in the deps of $(others) et al
+ # so that the symlink to libc.so is created before anything tries to
+ # run the linked programs.
+-link-libc = -Wl,-rpath-link=$(rpath-link) \
++link-libc-before-gnulib = -Wl,-rpath-link=$(rpath-link) \
+ $(common-objpfx)libc.so$(libc.so-version) \
+ $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
+- $(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed) $(gnulib)
++ $(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed)
++link-libc = $(link-libc-before-gnulib) $(gnulib)
++link-libc-tests = $(link-libc-before-gnulib) $(gnulib-tests)
+ # This is how to find at build-time things that will be installed there.
+ rpath-dirs = math elf dlfcn nss nis rt resolv crypt
+ rpath-link = \
+@@ -488,6 +498,7 @@
+ nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
+ resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
+ link-libc = $(common-objpfx)libc.a $(otherlibs) $(gnulib) $(common-objpfx)libc.a $(gnulib)
++link-libc-tests = $(common-objpfx)libc.a $(otherlibs) $(gnulib-tests) $(common-objpfx)libc.a $(gnulib-tests)
+ endif
+ endif
+
+@@ -513,8 +524,43 @@
+
+ # The static libraries.
+ link-libc-static = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib) -Wl,--end-group
++link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib-tests) -Wl,--end-group
+ link-libc-bounded = $(common-objpfx)libc_b.a $(gnulib) $(common-objpfx)libc_b.a
+
++# How to link against libgcc. Some libgcc functions, such as those
++# for "long long" arithmetic or software floating point, can always be
++# built without use of C library headers and do not have any global
++# state so can safely be linked statically into any executable or
++# shared library requiring them; these functions are in libgcc.a.
++# Other functions, relating to exception handling, may require C
++# library headers to build and it may not be safe to have more than
++# one copy of them in a process; these functions are only in
++# libgcc_s.so and libgcc_eh.a.
++#
++# To avoid circular dependencies when bootstrapping, it is desirable
++# to avoid use of libgcc_s and libgcc_eh in building glibc. Where any
++# glibc functionality (in particular, thread cancellation) requires
++# exception handling, this is implemented through dlopen of libgcc_s
++# to avoid unnecessary dependencies on libgcc_s by programs not using
++# that functionality; executables built with glibc do not use
++# exception handling other than through thread cancellation.
++#
++# Undefined references to functions from libgcc_eh or libgcc_s may
++# arise for code built with -fexceptions. In the case of statically
++# linked programs installed by glibc, unwinding will never actually
++# occur at runtime and the use of elf/static-stubs.c to resolve these
++# references is safe. In the case of statically linked test programs
++# and test programs built with -fexceptions, unwinding may occur in
++# some cases and it is preferable to link with libgcc_eh or libgcc_s
++# so that the testing is as similar as possible to how programs will
++# be built with the installed glibc.
++#
++# Some architectures have architecture-specific systems for exception
++# handling that may involve undefined references to
++# architecture-specific functions. On those architectures,
++# gnulib-arch and static-gnulib-arch may be defined in sysdeps
++# makefiles to use additional libraries for linking executables and
++# shared libraries built by glibc.
+ ifndef gnulib
+ ifneq ($(have-cc-with-libunwind),yes)
+ libunwind =
+@@ -522,8 +568,12 @@
+ libunwind = -lunwind
+ endif
+ libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed
+-gnulib := -lgcc $(libgcc_eh)
+-static-gnulib := -lgcc -lgcc_eh $(libunwind)
++gnulib-arch =
++gnulib = -lgcc $(gnulib-arch)
++gnulib-tests := -lgcc $(libgcc_eh)
++static-gnulib-arch =
++static-gnulib = -lgcc $(static-gnulib-arch)
++static-gnulib-tests := -lgcc -lgcc_eh $(libunwind)
+ libc.so-gnulib := -lgcc
+ endif
+ +preinit = $(addprefix $(csu-objpfx),crti.o)
+Index: a/libc/Rules
+===================================================================
+--- a/libc/Rules 2012-07-04 18:25:47.000000000 -0700
++++ b/libc/Rules 2012-08-14 20:16:10.197093639 -0700
+@@ -1,5 +1,4 @@
+-# Copyright (C) 1991-2000,2002,2003,2004,2005,2006,2011
+-# Free Software Foundation, Inc.
++# Copyright (C) 1991-2012 Free Software Foundation, Inc.
+ # This file is part of the GNU C Library.
+
+ # The GNU C Library is free software; you can redistribute it and/or
+@@ -103,29 +102,46 @@
+ # eglibc: endif
+
+ ifeq ($(build-programs),yes)
+-binaries-all = $(others) $(sysdep-others) $(tests) $(xtests) $(test-srcs)
+-binaries-static = $(others-static) $(tests-static) $(xtests-static)
++binaries-all-notests = $(others) $(sysdep-others)
++binaries-all-tests = $(tests) $(xtests) $(test-srcs)
++binaries-all = $(binaries-all-notests) $(binaries-all-tests)
++binaries-static-notests = $(others-static)
++binaries-static-tests = $(tests-static) $(xtests-static)
++binaries-static = $(binaries-static-notests) $(binaries-static-tests)
+ ifeq (yesyes,$(have-fpie)$(build-shared))
+ binaries-pie = $(others-pie) $(tests-pie) $(xtests-pie)
+ else
+ binaries-pie =
+ endif
+ else
+-binaries-all = $(tests) $(xtests) $(test-srcs)
++binaries-all-notests =
++binaries-all-tests = $(tests) $(xtests) $(test-srcs)
++binaries-all = $(binaries-all-tests)
++binaries-static-notests =
++binaries-static-tests =
+ binaries-static =
+ binaries-pie =
+ endif
+
+-binaries-shared = $(filter-out $(binaries-pie) $(binaries-static), \
+- $(binaries-all))
++binaries-shared-tests = $(filter-out $(binaries-pie) $(binaries-static), \
++ $(binaries-all-tests))
++binaries-shared-notests = $(filter-out $(binaries-pie) $(binaries-static), \
++ $(binaries-all-notests))
+
+-ifneq "$(strip $(binaries-shared))" ""
+-$(addprefix $(objpfx),$(binaries-shared)): %: %.o \
++ifneq "$(strip $(binaries-shared-notests))" ""
++$(addprefix $(objpfx),$(binaries-shared-notests)): %: %.o \
+ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
+ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
+ $(+link)
+ endif
+
++ifneq "$(strip $(binaries-shared-tests))" ""
++$(addprefix $(objpfx),$(binaries-shared-tests)): %: %.o \
++ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
++ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
++ $(+link-tests)
++endif
++
+ ifneq "$(strip $(binaries-pie))" ""
+ $(addprefix $(objpfx),$(binaries-pie)): %: %.o \
+ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
+@@ -133,13 +149,20 @@
+ $(+link-pie)
+ endif
+
+-ifneq "$(strip $(binaries-static))" ""
+-$(addprefix $(objpfx),$(binaries-static)): %: %.o \
++ifneq "$(strip $(binaries-static-notests))" ""
++$(addprefix $(objpfx),$(binaries-static-notests)): %: %.o \
+ $(sort $(filter $(common-objpfx)lib%,$(link-libc-static))) \
+ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
+ $(+link-static)
+ endif
+
++ifneq "$(strip $(binaries-static-tests))" ""
++$(addprefix $(objpfx),$(binaries-static-tests)): %: %.o \
++ $(sort $(filter $(common-objpfx)lib%,$(link-libc-static-tests))) \
++ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
++ $(+link-static-tests)
++endif
++
+ ifeq ($(build-bounded),yes)
+ binaries-bounded = $(addsuffix -bp,$(tests) $(xtests) $(test-srcs))
+ $(addprefix $(objpfx),$(binaries-bounded)): %-bp: %.ob \
+Index: a/libc/elf/Makefile
+===================================================================
+--- a/libc/elf/Makefile 2012-07-04 18:26:34.000000000 -0700
++++ b/libc/elf/Makefile 2012-08-14 20:16:10.197093639 -0700
+@@ -71,6 +71,8 @@
+ install-bin = sprof pldd
+ others-static = sln
+ install-rootsbin = sln
++sln-modules := static-stubs
++extra-objs += $(sln-modules:=.o)
+
+ ifeq (yes,$(use-ldconfig))
+ ifeq (yes,$(build-shared))
+@@ -78,7 +80,7 @@
+ others += ldconfig
+ install-rootsbin += ldconfig
+
+-ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon
++ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon static-stubs
+ extra-objs += $(ldconfig-modules:=.o)
+ endif
+ endif
+@@ -417,6 +419,8 @@
+
+ $(objpfx)sprof: $(libdl)
+
++$(objpfx)sln: $(sln-modules:%=$(objpfx)%.o)
++
+ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
+
+ $(objpfx)pldd: $(pldd-modules:%=$(objpfx)%.o)
+Index: a/libc/elf/static-stubs.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ a/libc/elf/static-stubs.c 2012-08-14 20:16:10.197093639 -0700
+@@ -0,0 +1,46 @@
++/* Stub implementations of functions to link into statically linked
++ programs without needing libgcc_eh.
++ Copyright (C) 2012 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <http://www.gnu.org/licenses/>. */
++
++/* Avoid backtrace (and so _Unwind_Backtrace) dependencies from
++ sysdeps/unix/sysv/linux/libc_fatal.c. */
++#include <sysdeps/posix/libc_fatal.c>
++
++#include <stdlib.h>
++#include <unwind.h>
++
++/* These programs do not use thread cancellation, so _Unwind_Resume
++ and the personality routine are never actually called. */
++
++void
++_Unwind_Resume (struct _Unwind_Exception *exc __attribute__ ((unused)))
++{
++ abort ();
++}
++
++_Unwind_Reason_Code
++__gcc_personality_v0 (int version __attribute__ ((unused)),
++ _Unwind_Action actions __attribute__ ((unused)),
++ _Unwind_Exception_Class exception_class
++ __attribute__ ((unused)),
++ struct _Unwind_Exception *ue_header
++ __attribute__ ((unused)),
++ struct _Unwind_Context *context __attribute__ ((unused)))
++{
++ abort ();
++}
+Index: a/ports/sysdeps/arm/Makefile
+===================================================================
+--- a/ports/sysdeps/arm/Makefile 2012-07-04 18:25:41.000000000 -0700
++++ b/ports/sysdeps/arm/Makefile 2012-08-14 20:16:10.201093638 -0700
+@@ -1,8 +1,16 @@
++gnulib-arch = $(elfobjdir)/libgcc-stubs.a
++static-gnulib-arch = $(elfobjdir)/libgcc-stubs.a
++
+ ifeq ($(subdir),elf)
+ sysdep-dl-routines += tlsdesc dl-tlsdesc
+ sysdep_routines += aeabi_unwind_cpp_pr1 find_exidx tlsdesc dl-tlsdesc
+ sysdep-rtld-routines += aeabi_unwind_cpp_pr1 tlsdesc dl-tlsdesc
+ shared-only-routines += aeabi_unwind_cpp_pr1
++
++$(objpfx)libgcc-stubs.a: $(objpfx)aeabi_unwind_cpp_pr1.os
++ $(build-extra-lib)
++
++lib-noranlib: $(objpfx)libgcc-stubs.a
+ endif
+
+ ifeq ($(subdir),csu)
diff --git a/toolchain/eglibc/patches/2.16/.svn/text-base/002-Add-ARM-specific-static-stubs.c.patch.svn-base b/toolchain/eglibc/patches/2.16/.svn/text-base/002-Add-ARM-specific-static-stubs.c.patch.svn-base
new file mode 100644
index 0000000..3a30621
--- /dev/null
+++ b/toolchain/eglibc/patches/2.16/.svn/text-base/002-Add-ARM-specific-static-stubs.c.patch.svn-base
@@ -0,0 +1,27 @@
+Upstream-Status: Backport
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+From c57a67e03368687fc0d2ae8354cd1b347a61ea44 Mon Sep 17 00:00:00 2001
+From: Joseph Myers <joseph@codesourcery.com>
+Date: Thu, 5 Jul 2012 22:16:03 +0000
+Subject: [PATCH] Add ARM-specific static-stubs.c.
+
+---
+ ports/ChangeLog.arm | 4 ++++
+ ports/sysdeps/arm/static-stubs.c | 7 +++++++
+ 2 files changed, 11 insertions(+)
+ create mode 100644 ports/sysdeps/arm/static-stubs.c
+
+Index: a/ports/sysdeps/arm/static-stubs.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ b/ports/sysdeps/arm/static-stubs.c 2012-08-15 15:04:59.687669241 -0700
+@@ -0,0 +1,7 @@
++/* When building with GCC with static-only libgcc, the dummy
++ _Unwind_Resume from static-stubs.c needs to be used together with
++ the dummy __aeabi_unwind_cpp_pr* from aeabi_unwind_cpp_pr1.c
++ instead of the copies from libgcc. */
++
++#include <elf/static-stubs.c>
++#include <aeabi_unwind_cpp_pr1.c>
diff --git a/toolchain/eglibc/patches/2.16/.svn/text-base/003-mips-rld-map-check.patch.svn-base b/toolchain/eglibc/patches/2.16/.svn/text-base/003-mips-rld-map-check.patch.svn-base
new file mode 100644
index 0000000..9b646fe
--- /dev/null
+++ b/toolchain/eglibc/patches/2.16/.svn/text-base/003-mips-rld-map-check.patch.svn-base
@@ -0,0 +1,26 @@
+
+On mips target, binutils currently sets DT_MIPS_RLD_MAP to 0 in dynamic
+section if a --version-script sets _RLD_MAP to local. This is apparently
+a binutils bug, but libc shouldn't segfault in this case.
+
+see also: http://sourceware.org/bugilla/show_bug.cgi?id=11615
+
+Upstream-Status: Pending
+
+9/19/2010 - added by Qing He <qing.he@intel.com>
+
+
+---
+diff -ru glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h glibc-2.10.1/ports/sysdeps/mips/dl-machine.h
+--- glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h 2009-05-16 16:36:20.000000000 +0800
++++ glibc-2.10.1/ports/sysdeps/mips/dl-machine.h 2010-09-19 09:11:53.000000000 +0800
+@@ -70,7 +70,8 @@
+ /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in
+ with the run-time address of the r_debug structure */
+ #define ELF_MACHINE_DEBUG_SETUP(l,r) \
+-do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
++do { if ((l)->l_info[DT_MIPS (RLD_MAP)] && \
++ (l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) \
+ *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \
+ (ElfW(Addr)) (r); \
+ } while (0)
diff --git a/toolchain/eglibc/patches/2.16/.svn/text-base/200-add-dl-search-paths.patch.svn-base b/toolchain/eglibc/patches/2.16/.svn/text-base/200-add-dl-search-paths.patch.svn-base
new file mode 100644
index 0000000..70e7e60
--- /dev/null
+++ b/toolchain/eglibc/patches/2.16/.svn/text-base/200-add-dl-search-paths.patch.svn-base
@@ -0,0 +1,14 @@
+add /usr/lib to default search path for the dynamic linker
+
+--- a/libc/Makeconfig
++++ b/libc/Makeconfig
+@@ -539,6 +539,9 @@
+ default-rpath = $(libdir)
+ endif
+
++# Add /usr/lib to default search path for the dynamic linker
++user-defined-trusted-dirs := /usr/lib
++
+ ifndef link-extra-libs
+ link-extra-libs = $(LDLIBS-$(@F))
+ link-extra-libs-static = $(link-extra-libs)
diff --git a/toolchain/eglibc/patches/2.16/001-Avoid-use-of-libgcc_s-and-libgcc_eh-when-building-gl.patch b/toolchain/eglibc/patches/2.16/001-Avoid-use-of-libgcc_s-and-libgcc_eh-when-building-gl.patch
new file mode 100644
index 0000000..e1444aa
--- /dev/null
+++ b/toolchain/eglibc/patches/2.16/001-Avoid-use-of-libgcc_s-and-libgcc_eh-when-building-gl.patch
@@ -0,0 +1,343 @@
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+From 95f5a9a866695da4e038aa4e6ccbbfd5d9cf63b7 Mon Sep 17 00:00:00 2001
+From: Joseph Myers <joseph@codesourcery.com>
+Date: Tue, 3 Jul 2012 19:14:59 +0000
+Subject: [PATCH] Avoid use of libgcc_s and libgcc_eh when building glibc.
+
+---
+ ChangeLog | 47 ++++++++++++++++++++++++++++++
+ Makeconfig | 68 ++++++++++++++++++++++++++++++++++++++------
+ Rules | 45 ++++++++++++++++++++++-------
+ elf/Makefile | 6 +++-
+ elf/static-stubs.c | 46 ++++++++++++++++++++++++++++++
+ ports/ChangeLog.arm | 7 +++++
+ ports/sysdeps/arm/Makefile | 8 ++++++
+ 7 files changed, 206 insertions(+), 21 deletions(-)
+ create mode 100644 elf/static-stubs.c
+
+Index: a/libc/Makeconfig
+===================================================================
+--- a/libc/Makeconfig 2012-07-04 18:26:22.000000000 -0700
++++ b/libc/Makeconfig 2012-08-14 20:16:10.197093639 -0700
+@@ -415,9 +415,9 @@
+ LDFLAGS-rtld += $(hashstyle-LDFLAGS)
+ endif
+
+-# Command for linking programs with the C library.
++# Commands for linking programs with the C library.
+ ifndef +link
+-+link = $(CC) -nostdlib -nostartfiles -o $@ \
+++link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
+ $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
+ $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
+ $(addprefix $(csu-objpfx),$(start-installed-name)) \
+@@ -426,7 +426,10 @@
+ $(start-installed-name))\
+ $(+preinit) $(link-extra-libs) \
+ $(common-objpfx)libc% $(+postinit),$^) \
+- $(link-extra-libs) $(link-libc) $(+postctor) $(+postinit)
++ $(link-extra-libs)
+++link-after-libc = $(+postctor) $(+postinit)
+++link = $(+link-before-libc) $(link-libc) $(+link-after-libc)
+++link-tests = $(+link-before-libc) $(link-libc-tests) $(+link-after-libc)
+ endif
+ # Command for linking PIE programs with the C library.
+ ifndef +link-pie
+@@ -443,7 +446,7 @@
+ endif
+ # Command for statically linking programs with the C library.
+ ifndef +link-static
+-+link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \
+++link-static-before-libc = $(CC) -nostdlib -nostartfiles -static -o $@ \
+ $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
+ $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
+ $(+preinit) $(+prector) \
+@@ -451,7 +454,12 @@
+ $(start-installed-name))\
+ $(+preinit) $(link-extra-libs-static) \
+ $(common-objpfx)libc% $(+postinit),$^) \
+- $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
++ $(link-extra-libs-static) $(link-libc-static)
+++link-static-after-libc = $(+postctor) $(+postinit)
+++link-static = $(+link-static-before-libc) $(link-libc-static) \
++ $(+link-static-after-libc)
+++link-static-tests = $(+link-static-before-libc) $(link-libc-static-tests) \
++ $(+link-static-after-libc)
+ endif
+ # Command for statically linking bounded-pointer programs with the C library.
+ ifndef +link-bounded
+@@ -475,10 +483,12 @@
+ # We need the versioned name of libc.so in the deps of $(others) et al
+ # so that the symlink to libc.so is created before anything tries to
+ # run the linked programs.
+-link-libc = -Wl,-rpath-link=$(rpath-link) \
++link-libc-before-gnulib = -Wl,-rpath-link=$(rpath-link) \
+ $(common-objpfx)libc.so$(libc.so-version) \
+ $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
+- $(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed) $(gnulib)
++ $(as-needed) $(common-objpfx)elf/ld.so $(no-as-needed)
++link-libc = $(link-libc-before-gnulib) $(gnulib)
++link-libc-tests = $(link-libc-before-gnulib) $(gnulib-tests)
+ # This is how to find at build-time things that will be installed there.
+ rpath-dirs = math elf dlfcn nss nis rt resolv crypt
+ rpath-link = \
+@@ -488,6 +498,7 @@
+ nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
+ resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
+ link-libc = $(common-objpfx)libc.a $(otherlibs) $(gnulib) $(common-objpfx)libc.a $(gnulib)
++link-libc-tests = $(common-objpfx)libc.a $(otherlibs) $(gnulib-tests) $(common-objpfx)libc.a $(gnulib-tests)
+ endif
+ endif
+
+@@ -513,8 +524,43 @@
+
+ # The static libraries.
+ link-libc-static = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib) -Wl,--end-group
++link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib-tests) -Wl,--end-group
+ link-libc-bounded = $(common-objpfx)libc_b.a $(gnulib) $(common-objpfx)libc_b.a
+
++# How to link against libgcc. Some libgcc functions, such as those
++# for "long long" arithmetic or software floating point, can always be
++# built without use of C library headers and do not have any global
++# state so can safely be linked statically into any executable or
++# shared library requiring them; these functions are in libgcc.a.
++# Other functions, relating to exception handling, may require C
++# library headers to build and it may not be safe to have more than
++# one copy of them in a process; these functions are only in
++# libgcc_s.so and libgcc_eh.a.
++#
++# To avoid circular dependencies when bootstrapping, it is desirable
++# to avoid use of libgcc_s and libgcc_eh in building glibc. Where any
++# glibc functionality (in particular, thread cancellation) requires
++# exception handling, this is implemented through dlopen of libgcc_s
++# to avoid unnecessary dependencies on libgcc_s by programs not using
++# that functionality; executables built with glibc do not use
++# exception handling other than through thread cancellation.
++#
++# Undefined references to functions from libgcc_eh or libgcc_s may
++# arise for code built with -fexceptions. In the case of statically
++# linked programs installed by glibc, unwinding will never actually
++# occur at runtime and the use of elf/static-stubs.c to resolve these
++# references is safe. In the case of statically linked test programs
++# and test programs built with -fexceptions, unwinding may occur in
++# some cases and it is preferable to link with libgcc_eh or libgcc_s
++# so that the testing is as similar as possible to how programs will
++# be built with the installed glibc.
++#
++# Some architectures have architecture-specific systems for exception
++# handling that may involve undefined references to
++# architecture-specific functions. On those architectures,
++# gnulib-arch and static-gnulib-arch may be defined in sysdeps
++# makefiles to use additional libraries for linking executables and
++# shared libraries built by glibc.
+ ifndef gnulib
+ ifneq ($(have-cc-with-libunwind),yes)
+ libunwind =
+@@ -522,8 +568,12 @@
+ libunwind = -lunwind
+ endif
+ libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed
+-gnulib := -lgcc $(libgcc_eh)
+-static-gnulib := -lgcc -lgcc_eh $(libunwind)
++gnulib-arch =
++gnulib = -lgcc $(gnulib-arch)
++gnulib-tests := -lgcc $(libgcc_eh)
++static-gnulib-arch =
++static-gnulib = -lgcc $(static-gnulib-arch)
++static-gnulib-tests := -lgcc -lgcc_eh $(libunwind)
+ libc.so-gnulib := -lgcc
+ endif
+ +preinit = $(addprefix $(csu-objpfx),crti.o)
+Index: a/libc/Rules
+===================================================================
+--- a/libc/Rules 2012-07-04 18:25:47.000000000 -0700
++++ b/libc/Rules 2012-08-14 20:16:10.197093639 -0700
+@@ -1,5 +1,4 @@
+-# Copyright (C) 1991-2000,2002,2003,2004,2005,2006,2011
+-# Free Software Foundation, Inc.
++# Copyright (C) 1991-2012 Free Software Foundation, Inc.
+ # This file is part of the GNU C Library.
+
+ # The GNU C Library is free software; you can redistribute it and/or
+@@ -103,29 +102,46 @@
+ # eglibc: endif
+
+ ifeq ($(build-programs),yes)
+-binaries-all = $(others) $(sysdep-others) $(tests) $(xtests) $(test-srcs)
+-binaries-static = $(others-static) $(tests-static) $(xtests-static)
++binaries-all-notests = $(others) $(sysdep-others)
++binaries-all-tests = $(tests) $(xtests) $(test-srcs)
++binaries-all = $(binaries-all-notests) $(binaries-all-tests)
++binaries-static-notests = $(others-static)
++binaries-static-tests = $(tests-static) $(xtests-static)
++binaries-static = $(binaries-static-notests) $(binaries-static-tests)
+ ifeq (yesyes,$(have-fpie)$(build-shared))
+ binaries-pie = $(others-pie) $(tests-pie) $(xtests-pie)
+ else
+ binaries-pie =
+ endif
+ else
+-binaries-all = $(tests) $(xtests) $(test-srcs)
++binaries-all-notests =
++binaries-all-tests = $(tests) $(xtests) $(test-srcs)
++binaries-all = $(binaries-all-tests)
++binaries-static-notests =
++binaries-static-tests =
+ binaries-static =
+ binaries-pie =
+ endif
+
+-binaries-shared = $(filter-out $(binaries-pie) $(binaries-static), \
+- $(binaries-all))
++binaries-shared-tests = $(filter-out $(binaries-pie) $(binaries-static), \
++ $(binaries-all-tests))
++binaries-shared-notests = $(filter-out $(binaries-pie) $(binaries-static), \
++ $(binaries-all-notests))
+
+-ifneq "$(strip $(binaries-shared))" ""
+-$(addprefix $(objpfx),$(binaries-shared)): %: %.o \
++ifneq "$(strip $(binaries-shared-notests))" ""
++$(addprefix $(objpfx),$(binaries-shared-notests)): %: %.o \
+ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
+ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
+ $(+link)
+ endif
+
++ifneq "$(strip $(binaries-shared-tests))" ""
++$(addprefix $(objpfx),$(binaries-shared-tests)): %: %.o \
++ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
++ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
++ $(+link-tests)
++endif
++
+ ifneq "$(strip $(binaries-pie))" ""
+ $(addprefix $(objpfx),$(binaries-pie)): %: %.o \
+ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
+@@ -133,13 +149,20 @@
+ $(+link-pie)
+ endif
+
+-ifneq "$(strip $(binaries-static))" ""
+-$(addprefix $(objpfx),$(binaries-static)): %: %.o \
++ifneq "$(strip $(binaries-static-notests))" ""
++$(addprefix $(objpfx),$(binaries-static-notests)): %: %.o \
+ $(sort $(filter $(common-objpfx)lib%,$(link-libc-static))) \
+ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
+ $(+link-static)
+ endif
+
++ifneq "$(strip $(binaries-static-tests))" ""
++$(addprefix $(objpfx),$(binaries-static-tests)): %: %.o \
++ $(sort $(filter $(common-objpfx)lib%,$(link-libc-static-tests))) \
++ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
++ $(+link-static-tests)
++endif
++
+ ifeq ($(build-bounded),yes)
+ binaries-bounded = $(addsuffix -bp,$(tests) $(xtests) $(test-srcs))
+ $(addprefix $(objpfx),$(binaries-bounded)): %-bp: %.ob \
+Index: a/libc/elf/Makefile
+===================================================================
+--- a/libc/elf/Makefile 2012-07-04 18:26:34.000000000 -0700
++++ b/libc/elf/Makefile 2012-08-14 20:16:10.197093639 -0700
+@@ -71,6 +71,8 @@
+ install-bin = sprof pldd
+ others-static = sln
+ install-rootsbin = sln
++sln-modules := static-stubs
++extra-objs += $(sln-modules:=.o)
+
+ ifeq (yes,$(use-ldconfig))
+ ifeq (yes,$(build-shared))
+@@ -78,7 +80,7 @@
+ others += ldconfig
+ install-rootsbin += ldconfig
+
+-ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon
++ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon static-stubs
+ extra-objs += $(ldconfig-modules:=.o)
+ endif
+ endif
+@@ -417,6 +419,8 @@
+
+ $(objpfx)sprof: $(libdl)
+
++$(objpfx)sln: $(sln-modules:%=$(objpfx)%.o)
++
+ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
+
+ $(objpfx)pldd: $(pldd-modules:%=$(objpfx)%.o)
+Index: a/libc/elf/static-stubs.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ a/libc/elf/static-stubs.c 2012-08-14 20:16:10.197093639 -0700
+@@ -0,0 +1,46 @@
++/* Stub implementations of functions to link into statically linked
++ programs without needing libgcc_eh.
++ Copyright (C) 2012 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <http://www.gnu.org/licenses/>. */
++
++/* Avoid backtrace (and so _Unwind_Backtrace) dependencies from
++ sysdeps/unix/sysv/linux/libc_fatal.c. */
++#include <sysdeps/posix/libc_fatal.c>
++
++#include <stdlib.h>
++#include <unwind.h>
++
++/* These programs do not use thread cancellation, so _Unwind_Resume
++ and the personality routine are never actually called. */
++
++void
++_Unwind_Resume (struct _Unwind_Exception *exc __attribute__ ((unused)))
++{
++ abort ();
++}
++
++_Unwind_Reason_Code
++__gcc_personality_v0 (int version __attribute__ ((unused)),
++ _Unwind_Action actions __attribute__ ((unused)),
++ _Unwind_Exception_Class exception_class
++ __attribute__ ((unused)),
++ struct _Unwind_Exception *ue_header
++ __attribute__ ((unused)),
++ struct _Unwind_Context *context __attribute__ ((unused)))
++{
++ abort ();
++}
+Index: a/ports/sysdeps/arm/Makefile
+===================================================================
+--- a/ports/sysdeps/arm/Makefile 2012-07-04 18:25:41.000000000 -0700
++++ b/ports/sysdeps/arm/Makefile 2012-08-14 20:16:10.201093638 -0700
+@@ -1,8 +1,16 @@
++gnulib-arch = $(elfobjdir)/libgcc-stubs.a
++static-gnulib-arch = $(elfobjdir)/libgcc-stubs.a
++
+ ifeq ($(subdir),elf)
+ sysdep-dl-routines += tlsdesc dl-tlsdesc
+ sysdep_routines += aeabi_unwind_cpp_pr1 find_exidx tlsdesc dl-tlsdesc
+ sysdep-rtld-routines += aeabi_unwind_cpp_pr1 tlsdesc dl-tlsdesc
+ shared-only-routines += aeabi_unwind_cpp_pr1
++
++$(objpfx)libgcc-stubs.a: $(objpfx)aeabi_unwind_cpp_pr1.os
++ $(build-extra-lib)
++
++lib-noranlib: $(objpfx)libgcc-stubs.a
+ endif
+
+ ifeq ($(subdir),csu)
diff --git a/toolchain/eglibc/patches/2.16/002-Add-ARM-specific-static-stubs.c.patch b/toolchain/eglibc/patches/2.16/002-Add-ARM-specific-static-stubs.c.patch
new file mode 100644
index 0000000..3a30621
--- /dev/null
+++ b/toolchain/eglibc/patches/2.16/002-Add-ARM-specific-static-stubs.c.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Backport
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+From c57a67e03368687fc0d2ae8354cd1b347a61ea44 Mon Sep 17 00:00:00 2001
+From: Joseph Myers <joseph@codesourcery.com>
+Date: Thu, 5 Jul 2012 22:16:03 +0000
+Subject: [PATCH] Add ARM-specific static-stubs.c.
+
+---
+ ports/ChangeLog.arm | 4 ++++
+ ports/sysdeps/arm/static-stubs.c | 7 +++++++
+ 2 files changed, 11 insertions(+)
+ create mode 100644 ports/sysdeps/arm/static-stubs.c
+
+Index: a/ports/sysdeps/arm/static-stubs.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ b/ports/sysdeps/arm/static-stubs.c 2012-08-15 15:04:59.687669241 -0700
+@@ -0,0 +1,7 @@
++/* When building with GCC with static-only libgcc, the dummy
++ _Unwind_Resume from static-stubs.c needs to be used together with
++ the dummy __aeabi_unwind_cpp_pr* from aeabi_unwind_cpp_pr1.c
++ instead of the copies from libgcc. */
++
++#include <elf/static-stubs.c>
++#include <aeabi_unwind_cpp_pr1.c>
diff --git a/toolchain/eglibc/patches/2.16/003-mips-rld-map-check.patch b/toolchain/eglibc/patches/2.16/003-mips-rld-map-check.patch
new file mode 100644
index 0000000..9b646fe
--- /dev/null
+++ b/toolchain/eglibc/patches/2.16/003-mips-rld-map-check.patch
@@ -0,0 +1,26 @@
+
+On mips target, binutils currently sets DT_MIPS_RLD_MAP to 0 in dynamic
+section if a --version-script sets _RLD_MAP to local. This is apparently
+a binutils bug, but libc shouldn't segfault in this case.
+
+see also: http://sourceware.org/bugilla/show_bug.cgi?id=11615
+
+Upstream-Status: Pending
+
+9/19/2010 - added by Qing He <qing.he@intel.com>
+
+
+---
+diff -ru glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h glibc-2.10.1/ports/sysdeps/mips/dl-machine.h
+--- glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h 2009-05-16 16:36:20.000000000 +0800
++++ glibc-2.10.1/ports/sysdeps/mips/dl-machine.h 2010-09-19 09:11:53.000000000 +0800
+@@ -70,7 +70,8 @@
+ /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in
+ with the run-time address of the r_debug structure */
+ #define ELF_MACHINE_DEBUG_SETUP(l,r) \
+-do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
++do { if ((l)->l_info[DT_MIPS (RLD_MAP)] && \
++ (l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) \
+ *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \
+ (ElfW(Addr)) (r); \
+ } while (0)
diff --git a/toolchain/eglibc/patches/2.16/200-add-dl-search-paths.patch b/toolchain/eglibc/patches/2.16/200-add-dl-search-paths.patch
new file mode 100644
index 0000000..70e7e60
--- /dev/null
+++ b/toolchain/eglibc/patches/2.16/200-add-dl-search-paths.patch
@@ -0,0 +1,14 @@
+add /usr/lib to default search path for the dynamic linker
+
+--- a/libc/Makeconfig
++++ b/libc/Makeconfig
+@@ -539,6 +539,9 @@
+ default-rpath = $(libdir)
+ endif
+
++# Add /usr/lib to default search path for the dynamic linker
++user-defined-trusted-dirs := /usr/lib
++
+ ifndef link-extra-libs
+ link-extra-libs = $(LDLIBS-$(@F))
+ link-extra-libs-static = $(link-extra-libs)