summaryrefslogtreecommitdiffstats
path: root/package/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'package/gcc')
-rw-r--r--package/gcc/4.2.2-avr32-2.1.5/1001-gcc-4.2.x-inhibit-libc.patch49
-rw-r--r--package/gcc/4.2.2-avr32-2.1.5/903-avr32-fix-removal-of-redundant-cast-operations.patch16
-rw-r--r--package/gcc/4.2.2-avr32-2.1.5/904-avr32-fix-conditional-insn-which-clobbers-cc_status.patch150
-rw-r--r--package/gcc/4.2.2-avr32-2.1.5/905-avr32-optimize-movsf2-use-movh-to-move-immediates-into-register.patch31
-rw-r--r--package/gcc/4.3.6/100-uclibc-conf.patch33
-rw-r--r--package/gcc/4.3.6/104-gnuhurd-uclibc-conf.patch13
-rw-r--r--package/gcc/4.3.6/301-missing-execinfo_h.patch11
-rw-r--r--package/gcc/4.3.6/302-c99-snprintf.patch13
-rw-r--r--package/gcc/4.3.6/305-libmudflap-susv3-legacy.patch49
-rw-r--r--package/gcc/4.3.6/810-arm-softfloat-libgcc.patch29
-rw-r--r--package/gcc/4.3.6/993-arm_insn-opinit-RTX_CODE-fixup.patch41
-rw-r--r--package/gcc/4.3.6/998-gcc-4.3.0-fix-header.00.patch15
-rw-r--r--package/gcc/4.3.6/999-4.3.2-armeabi-aapcs-linux.patch18
-rw-r--r--package/gcc/4.3.6/999-4.3.3-arm-fix-for-bug-37436.patch86
-rw-r--r--package/gcc/4.3.6/999-gcc-4.3.0-cris-pragma-pack-warning-remove.patch13
-rw-r--r--package/gcc/4.3.6/gcc-43-pr39429.patch24
-rw-r--r--package/gcc/4.3.6/powerpc-link-with-math-lib.patch.conditional125
-rw-r--r--package/gcc/4.4.7-arc/fix_branch_out_of_range.patch30
-rw-r--r--package/gcc/4.4.7/100-uclibc-conf.patch33
-rw-r--r--package/gcc/4.4.7/301-missing-execinfo_h.patch11
-rw-r--r--package/gcc/4.4.7/302-c99-snprintf.patch13
-rw-r--r--package/gcc/4.4.7/305-libmudflap-susv3-legacy.patch49
-rw-r--r--package/gcc/4.4.7/810-arm-softfloat-libgcc.patch38
-rw-r--r--package/gcc/4.4.7/950-sparc-leon.patch239
-rw-r--r--package/gcc/4.4.7/gcc-44-pr39429.patch24
-rw-r--r--package/gcc/4.4.7/powerpc-link-with-math-lib.patch.conditional137
-rw-r--r--package/gcc/4.5.4/100-uclibc-conf.patch33
-rw-r--r--package/gcc/4.5.4/301-missing-execinfo_h.patch11
-rw-r--r--package/gcc/4.5.4/302-c99-snprintf.patch13
-rw-r--r--package/gcc/4.5.4/305-libmudflap-susv3-legacy.patch49
-rw-r--r--package/gcc/4.5.4/810-arm-softfloat-libgcc.patch38
-rw-r--r--package/gcc/4.5.4/820-arm-unbreak-armv4t.patch14
-rw-r--r--package/gcc/4.5.4/830-arm-pr43440.patch345
-rw-r--r--package/gcc/4.5.4/powerpc-link-with-math-lib.patch.conditional125
-rw-r--r--package/gcc/4.6.4/100-uclibc-conf.patch33
-rw-r--r--package/gcc/4.6.4/301-missing-execinfo_h.patch11
-rw-r--r--package/gcc/4.6.4/302-c99-snprintf.patch13
-rw-r--r--package/gcc/4.6.4/305-libmudflap-susv3-legacy.patch49
-rw-r--r--package/gcc/4.6.4/810-arm-softfloat-libgcc.patch38
-rw-r--r--package/gcc/4.6.4/820-arm-unbreak-armv4t.patch14
-rw-r--r--package/gcc/4.6.4/powerpc-link-with-math-lib.patch.conditional125
-rw-r--r--package/gcc/4.7.3/100-uclibc-conf.patch33
-rw-r--r--package/gcc/4.7.3/301-missing-execinfo_h.patch11
-rw-r--r--package/gcc/4.7.3/302-c99-snprintf.patch13
-rw-r--r--package/gcc/4.7.3/305-libmudflap-susv3-legacy.patch49
-rw-r--r--package/gcc/4.7.3/810-arm-softfloat-libgcc.patch25
-rw-r--r--package/gcc/4.7.3/830-arm_unbreak_armv4t.patch13
-rw-r--r--package/gcc/4.7.3/powerpc-link-with-math-lib.patch.conditional127
-rw-r--r--package/gcc/4.8.1/100-uclibc-conf.patch37
-rw-r--r--package/gcc/4.8.1/301-missing-execinfo_h.patch13
-rw-r--r--package/gcc/4.8.1/302-c99-snprintf.patch13
-rw-r--r--package/gcc/4.8.1/305-libmudflap-susv3-legacy.patch49
-rw-r--r--package/gcc/4.8.1/810-arm-softfloat-libgcc.patch30
-rw-r--r--package/gcc/4.8.1/830-arm_unbreak_armv4t.patch13
-rw-r--r--package/gcc/4.8.1/powerpc-link-with-math-lib.patch.conditional122
55 files changed, 2749 insertions, 0 deletions
diff --git a/package/gcc/4.2.2-avr32-2.1.5/1001-gcc-4.2.x-inhibit-libc.patch b/package/gcc/4.2.2-avr32-2.1.5/1001-gcc-4.2.x-inhibit-libc.patch
new file mode 100644
index 000000000..9a7c90974
--- /dev/null
+++ b/package/gcc/4.2.2-avr32-2.1.5/1001-gcc-4.2.x-inhibit-libc.patch
@@ -0,0 +1,49 @@
+--- gcc-4.2.4/gcc/unwind-sjlj.c.khem 2010-08-11 12:45:28.000000000 -0700
++++ gcc-4.2.4/gcc/unwind-sjlj.c 2010-08-11 12:45:50.000000000 -0700
+@@ -28,6 +28,8 @@
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
++#ifndef inhibit_libc
++
+ #include "tconfig.h"
+ #include "tsystem.h"
+ #include "coretypes.h"
+@@ -326,3 +328,4 @@ uw_identify_context (struct _Unwind_Cont
+ #include "unwind.inc"
+
+ #endif /* USING_SJLJ_EXCEPTIONS */
++#endif
+--- gcc-4.2.4/gcc/unwind-dw2.c.khem 2010-08-11 12:42:45.000000000 -0700
++++ gcc-4.2.4/gcc/unwind-dw2.c 2010-08-11 12:43:17.000000000 -0700
+@@ -28,6 +28,8 @@
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
++#ifndef inhibit_libc
++
+ #include "tconfig.h"
+ #include "tsystem.h"
+ #include "coretypes.h"
+@@ -1537,3 +1539,5 @@ alias (_Unwind_SetIP);
+ #endif
+
+ #endif /* !USING_SJLJ_EXCEPTIONS */
++#endif
++
+--- gcc-4.2.4/gcc/unwind-dw2-fde-glibc.c.khem 2010-08-11 12:44:25.000000000 -0700
++++ gcc-4.2.4/gcc/unwind-dw2-fde-glibc.c 2010-08-11 12:44:48.000000000 -0700
+@@ -29,6 +29,8 @@
+ segment and dl_iterate_phdr to avoid register/deregister calls at
+ DSO load/unload. */
+
++#ifndef inhibit_libc
++
+ #ifndef _GNU_SOURCE
+ #define _GNU_SOURCE 1
+ #endif
+@@ -438,3 +440,4 @@ _Unwind_Find_FDE (void *pc, struct dwarf
+ #if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS)
+ alias (_Unwind_Find_FDE);
+ #endif
++#endif
diff --git a/package/gcc/4.2.2-avr32-2.1.5/903-avr32-fix-removal-of-redundant-cast-operations.patch b/package/gcc/4.2.2-avr32-2.1.5/903-avr32-fix-removal-of-redundant-cast-operations.patch
new file mode 100644
index 000000000..59ecbff4f
--- /dev/null
+++ b/package/gcc/4.2.2-avr32-2.1.5/903-avr32-fix-removal-of-redundant-cast-operations.patch
@@ -0,0 +1,16 @@
+Index: trunk/gcc/config/avr32/avr32.c
+===================================================================
+--- trunk/gcc/config/avr32/avr32.c (revision 43495)
++++ trunk/gcc/config/avr32/avr32.c (revision 43496)
+@@ -6499,6 +6499,11 @@
+ break;
+ }
+
++ /* Check if we have a call and the register is used as an argument. */
++ if (CALL_P (scan)
++ && find_reg_fusage (scan, USE, reg) )
++ break;
++
+ if (!reg_mentioned_p (reg, PATTERN (scan)))
+ continue;
+
diff --git a/package/gcc/4.2.2-avr32-2.1.5/904-avr32-fix-conditional-insn-which-clobbers-cc_status.patch b/package/gcc/4.2.2-avr32-2.1.5/904-avr32-fix-conditional-insn-which-clobbers-cc_status.patch
new file mode 100644
index 000000000..539c666d2
--- /dev/null
+++ b/package/gcc/4.2.2-avr32-2.1.5/904-avr32-fix-conditional-insn-which-clobbers-cc_status.patch
@@ -0,0 +1,150 @@
+Index: gcc-4.2.2/gcc/config/avr32/avr32.c
+===================================================================
+--- gcc-4.2.2.orig/gcc/config/avr32/avr32.c 2008-09-19 14:29:20.000000000 +0200
++++ gcc-4.2.2/gcc/config/avr32/avr32.c 2008-09-19 14:30:02.000000000 +0200
+@@ -1788,7 +1788,7 @@
+ {
+ if (TREE_CODE (*node) != FUNCTION_DECL)
+ {
+- warning ("`%s' attribute only applies to functions",
++ warning (OPT_Wattributes,"`%s' attribute only applies to functions",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+@@ -1802,7 +1802,7 @@
+ {
+ if (avr32_isr_value (args) == AVR32_FT_UNKNOWN)
+ {
+- warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
++ warning (OPT_Wattributes,"`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+ }
+@@ -1829,7 +1829,7 @@
+ }
+ else
+ {
+- warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
++ warning (OPT_Wattributes,"`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ }
+ }
+ }
+@@ -1847,7 +1847,7 @@
+ {
+ if (TREE_CODE (*node) != FUNCTION_DECL)
+ {
+- warning ("%qs attribute only applies to functions",
++ warning (OPT_Wattributes,"%qs attribute only applies to functions",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+@@ -1866,13 +1866,13 @@
+ {
+ if (TREE_CODE (*node) == FUNCTION_TYPE || TREE_CODE (*node) == METHOD_TYPE)
+ {
+- warning ("`%s' attribute not yet supported...",
++ warning (OPT_Wattributes,"`%s' attribute not yet supported...",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ return NULL_TREE;
+ }
+
+- warning ("`%s' attribute only applies to functions",
++ warning (OPT_Wattributes,"`%s' attribute only applies to functions",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ return NULL_TREE;
+@@ -4215,51 +4215,6 @@
+
+
+ void
+-avr32_asm_output_ascii (FILE * stream, char *ptr, int len)
+-{
+- int i, i_new = 0;
+- char *new_ptr = xmalloc (4 * len);
+- if (new_ptr == NULL)
+- internal_error ("Out of memory.");
+-
+- for (i = 0; i < len; i++)
+- {
+- if (ptr[i] == '\n')
+- {
+- new_ptr[i_new++] = '\\';
+- new_ptr[i_new++] = '0';
+- new_ptr[i_new++] = '1';
+- new_ptr[i_new++] = '2';
+- }
+- else if (ptr[i] == '\"')
+- {
+- new_ptr[i_new++] = '\\';
+- new_ptr[i_new++] = '\"';
+- }
+- else if (ptr[i] == '\\')
+- {
+- new_ptr[i_new++] = '\\';
+- new_ptr[i_new++] = '\\';
+- }
+- else if (ptr[i] == '\0' && i + 1 < len)
+- {
+- new_ptr[i_new++] = '\\';
+- new_ptr[i_new++] = '0';
+- }
+- else
+- {
+- new_ptr[i_new++] = ptr[i];
+- }
+- }
+-
+- /* Terminate new_ptr. */
+- new_ptr[i_new] = '\0';
+- fprintf (stream, "\t.ascii\t\"%s\"\n", new_ptr);
+- free (new_ptr);
+-}
+-
+-
+-void
+ avr32_asm_output_label (FILE * stream, const char *name)
+ {
+ name = avr32_strip_name_encoding (name);
+@@ -4444,12 +4399,15 @@
+ rtx cmp;
+ rtx cmp_op0, cmp_op1;
+ rtx cond;
++ rtx dest;
++
+ if ( GET_CODE (exp) == COND_EXEC )
+ {
+ cmp_op0 = XEXP (COND_EXEC_TEST (exp), 0);
+ cmp_op1 = XEXP (COND_EXEC_TEST (exp), 1);
+ cond = COND_EXEC_TEST (exp);
+- }
++ dest = SET_DEST (COND_EXEC_CODE (exp));
++ }
+ else
+ {
+ /* If then else conditional. compare operands are in operands
+@@ -4457,6 +4415,7 @@
+ cmp_op0 = recog_data.operand[4];
+ cmp_op1 = recog_data.operand[5];
+ cond = recog_data.operand[1];
++ dest = SET_DEST (exp);
+ }
+
+ if ( GET_CODE (cmp_op0) == AND )
+@@ -4466,7 +4425,15 @@
+ cmp_op0,
+ cmp_op1);
+
+- if (is_compare_redundant (cmp, cond) == NULL_RTX)
++ /* Check if the conditional insns updates a register present
++ in the comparison, if so then we must reset the cc_status. */
++ if (REG_P (dest)
++ && (reg_mentioned_p (dest, cmp_op0)
++ || reg_mentioned_p (dest, cmp_op1)))
++ {
++ CC_STATUS_INIT;
++ }
++ else if (is_compare_redundant (cmp, cond) == NULL_RTX)
+ {
+ /* Reset the nonstandard flag */
+ CC_STATUS_INIT;
diff --git a/package/gcc/4.2.2-avr32-2.1.5/905-avr32-optimize-movsf2-use-movh-to-move-immediates-into-register.patch b/package/gcc/4.2.2-avr32-2.1.5/905-avr32-optimize-movsf2-use-movh-to-move-immediates-into-register.patch
new file mode 100644
index 000000000..08d972df2
--- /dev/null
+++ b/package/gcc/4.2.2-avr32-2.1.5/905-avr32-optimize-movsf2-use-movh-to-move-immediates-into-register.patch
@@ -0,0 +1,31 @@
+Index: gcc-4.2.2/gcc/config/avr32/avr32.md
+===================================================================
+--- gcc-4.2.2.orig/gcc/config/avr32/avr32.md 2008-09-19 14:23:34.000000000 +0200
++++ gcc-4.2.2/gcc/config/avr32/avr32.md 2008-09-19 14:30:18.000000000 +0200
+@@ -803,14 +803,22 @@
+ (define_insn "*movsf_internal"
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,r,r,m")
+ (match_operand:SF 1 "general_operand" "r, G,F,m,r"))]
+- "TARGET_SOFT_FLOAT
+- && (register_operand (operands[0], SFmode)
+- || register_operand (operands[1], SFmode))"
++ "(register_operand (operands[0], SFmode)
++ || register_operand (operands[1], SFmode))"
+ {
+ switch (which_alternative) {
+ case 0:
+ case 1: return "mov\t%0, %1";
+- case 2: return "mov\t%0, lo(%1)\;orh\t%0, hi(%1)";
++ case 2:
++ {
++ HOST_WIDE_INT target_float[2];
++ real_to_target (target_float, CONST_DOUBLE_REAL_VALUE (operands[1]), SFmode);
++ if ( TARGET_V2_INSNS
++ && avr32_hi16_immediate_operand (GEN_INT (target_float[0]), VOIDmode) )
++ return "movh\t%0, hi(%1)";
++ else
++ return "mov\t%0, lo(%1)\;orh\t%0, hi(%1)";
++ }
+ case 3:
+ if ( (REG_P(XEXP(operands[1], 0))
+ && REGNO(XEXP(operands[1], 0)) == SP_REGNUM)
diff --git a/package/gcc/4.3.6/100-uclibc-conf.patch b/package/gcc/4.3.6/100-uclibc-conf.patch
new file mode 100644
index 000000000..cca8c8229
--- /dev/null
+++ b/package/gcc/4.3.6/100-uclibc-conf.patch
@@ -0,0 +1,33 @@
+--- gcc/gcc/config/--- gcc/contrib/regression/objs-gcc.sh
++++ gcc/contrib/regression/objs-gcc.sh
+@@ -105,6 +105,10 @@
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+--- gcc/libjava/classpath/ltconfig
++++ gcc/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1251,7 +1251,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
diff --git a/package/gcc/4.3.6/104-gnuhurd-uclibc-conf.patch b/package/gcc/4.3.6/104-gnuhurd-uclibc-conf.patch
new file mode 100644
index 000000000..c04dd9ff0
--- /dev/null
+++ b/package/gcc/4.3.6/104-gnuhurd-uclibc-conf.patch
@@ -0,0 +1,13 @@
+diff -rdup gcc-4.2.1.oorig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
+--- gcc-4.2.1.oorig/gcc/config.gcc 2007-10-01 11:52:52.000000000 +0200
++++ gcc-4.2.1/gcc/config.gcc 2007-10-01 13:22:12.000000000 +0200
+@@ -494,6 +494,9 @@ case ${target} in
+ alpha*)
+ tm_file="${cpu_type}/${cpu_type}.h alpha/elf.h alpha/linux.h alpha/linux-elf.h gnu.h ${tm_file}"
+ ;;
++ i[34567]86-*hurd*-*)
++ tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/gnu.h gnu.h ${tm_file}"
++ ;;
+ i[34567]86-*-*)
+ tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h gnu.h ${tm_file}"
+ ;;
diff --git a/package/gcc/4.3.6/301-missing-execinfo_h.patch b/package/gcc/4.3.6/301-missing-execinfo_h.patch
new file mode 100644
index 000000000..0e2092f3f
--- /dev/null
+++ b/package/gcc/4.3.6/301-missing-execinfo_h.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500
++++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500
+@@ -500,7 +500,7 @@
+ #ifdef __linux__
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/package/gcc/4.3.6/302-c99-snprintf.patch b/package/gcc/4.3.6/302-c99-snprintf.patch
new file mode 100644
index 000000000..ba51a0e1d
--- /dev/null
+++ b/package/gcc/4.3.6/302-c99-snprintf.patch
@@ -0,0 +1,13 @@
+Index: gcc-4.3.0/libstdc++-v3/include/c_global/cstdio
+===================================================================
+--- gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (revision 129202)
++++ gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (working copy)
+@@ -144,7 +144,7 @@
+
+ _GLIBCXX_END_NAMESPACE
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined __UCLIBC__
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/package/gcc/4.3.6/305-libmudflap-susv3-legacy.patch b/package/gcc/4.3.6/305-libmudflap-susv3-legacy.patch
new file mode 100644
index 000000000..374b1f865
--- /dev/null
+++ b/package/gcc/4.3.6/305-libmudflap-susv3-legacy.patch
@@ -0,0 +1,49 @@
+Index: gcc-4.2/libmudflap/mf-hooks2.c
+===================================================================
+--- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834)
++++ gcc-4.2/libmudflap/mf-hooks2.c (working copy)
+@@ -427,7 +427,7 @@
+ {
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
+- bzero (s, n);
++ memset (s, 0, n);
+ }
+
+
+@@ -437,7 +437,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
+ MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
+- bcopy (src, dest, n);
++ memmove (dest, src, n);
+ }
+
+
+@@ -447,7 +447,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
+ MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
+- return bcmp (s1, s2, n);
++ return n == 0 ? 0 : memcmp (s1, s2, n);
+ }
+
+
+@@ -456,7 +456,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
+- return index (s, c);
++ return strchr (s, c);
+ }
+
+
+@@ -465,7 +465,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
+- return rindex (s, c);
++ return strrchr (s, c);
+ }
+
+ /* XXX: stpcpy, memccpy */
diff --git a/package/gcc/4.3.6/810-arm-softfloat-libgcc.patch b/package/gcc/4.3.6/810-arm-softfloat-libgcc.patch
new file mode 100644
index 000000000..1639c39a8
--- /dev/null
+++ b/package/gcc/4.3.6/810-arm-softfloat-libgcc.patch
@@ -0,0 +1,29 @@
+Index: gcc-4.3.0/gcc/config/arm/t-linux
+===================================================================
+--- gcc-4.3.0/gcc/config/arm/t-linux (revision 129896)
++++ gcc-4.3.0/gcc/config/arm/t-linux (working copy)
+@@ -3,7 +3,10 @@
+ TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi _floatdidf _floatundidf _floatdisf _floatundisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+Index: gcc-4.3.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.3.0/gcc/config/arm/linux-elf.h (revision 129896)
++++ gcc-4.3.0/gcc/config/arm/linux-elf.h (working copy)
+@@ -48,7 +62,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
diff --git a/package/gcc/4.3.6/993-arm_insn-opinit-RTX_CODE-fixup.patch b/package/gcc/4.3.6/993-arm_insn-opinit-RTX_CODE-fixup.patch
new file mode 100644
index 000000000..69f0c372d
--- /dev/null
+++ b/package/gcc/4.3.6/993-arm_insn-opinit-RTX_CODE-fixup.patch
@@ -0,0 +1,41 @@
+gcc/ChangeLog
+2007-11-27 Bernhard Fischer <>
+
+ * config/arm/arm-protos.h (arm_vector_mode_supported_p,
+ arm_hard_regno_mode_ok, const_ok_for_arm): Do not hide non-rtx related
+ function prototypes in RTX_CODE.
+ * genopinit.c: Include tm_p.h.
+
+Index: gcc-4.3.0/gcc/config/arm/arm-protos.h
+===================================================================
+--- gcc-4.3.0/gcc/config/arm/arm-protos.h (revision 130463)
++++ gcc-4.3.0/gcc/config/arm/arm-protos.h (working copy)
+@@ -40,15 +40,14 @@
+ unsigned int);
+ extern unsigned int arm_dbx_register_number (unsigned int);
+ extern void arm_output_fn_unwind (FILE *, bool);
+-
+
+ #ifdef TREE_CODE
+ extern int arm_return_in_memory (const_tree);
+ #endif
+-#ifdef RTX_CODE
+ extern bool arm_vector_mode_supported_p (enum machine_mode);
+ extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode);
+ extern int const_ok_for_arm (HOST_WIDE_INT);
++#ifdef RTX_CODE
+ extern int arm_split_constant (RTX_CODE, enum machine_mode, rtx,
+ HOST_WIDE_INT, rtx, rtx, int);
+ extern RTX_CODE arm_canonicalize_comparison (RTX_CODE, enum machine_mode,
+Index: gcc-4.3.0/gcc/genopinit.c
+===================================================================
+--- gcc-4.3.0/gcc/genopinit.c (revision 130463)
++++ gcc-4.3.0/gcc/genopinit.c (working copy)
+@@ -486,6 +486,7 @@
+ printf ("#include \"expr.h\"\n");
+ printf ("#include \"optabs.h\"\n");
+ printf ("#include \"reload.h\"\n\n");
++ printf ("#include \"tm_p.h\"\n\n");
+
+ printf ("void\ninit_all_optabs (void)\n{\n");
+
diff --git a/package/gcc/4.3.6/998-gcc-4.3.0-fix-header.00.patch b/package/gcc/4.3.6/998-gcc-4.3.0-fix-header.00.patch
new file mode 100644
index 000000000..7fe59d2dd
--- /dev/null
+++ b/package/gcc/4.3.6/998-gcc-4.3.0-fix-header.00.patch
@@ -0,0 +1,15 @@
+\\\\
+\\ gcc PR33200
+Index: gcc-4.3.0/gcc/config.gcc
+===================================================================
+--- gcc-4.3.0/gcc/config.gcc (revision 131628)
++++ gcc-4.3.0/gcc/config.gcc (working copy)
+@@ -2302,7 +2305,7 @@ sh-*-symbianelf* | sh[12346l]*-*-symbian
+ if test x${enable_incomplete_targets} = xyes ; then
+ tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1"
+ fi
+- use_fixproto=yes
++ # XXX: why? use_fixproto=yes
+ ;;
+ sh-*-rtemscoff*)
+ tmake_file="sh/t-sh t-rtems sh/t-rtems"
diff --git a/package/gcc/4.3.6/999-4.3.2-armeabi-aapcs-linux.patch b/package/gcc/4.3.6/999-4.3.2-armeabi-aapcs-linux.patch
new file mode 100644
index 000000000..f4b1c9c06
--- /dev/null
+++ b/package/gcc/4.3.6/999-4.3.2-armeabi-aapcs-linux.patch
@@ -0,0 +1,18 @@
+\\\\ followup of PR34205; trying to use aapcs-linux
+\\ gcc/ChangeLog
+\\
+\\ 2008-09-18 Bernhard Reutner-Fischer <aldot@>
+\\
+\\ * config.gcc (arm*-*-*): Add aapcs-linux to supported ABIs.
+\\
+--- gcc-4.3.2.orig/gcc/config.gcc 2008-09-18 20:33:55.000000000 +0200
++++ gcc-4.3.2/gcc/config.gcc 2008-09-18 21:38:52.000000000 +0200
+@@ -2921,7 +2921,7 @@
+
+ case "$with_abi" in
+ "" \
+- | apcs-gnu | atpcs | aapcs | iwmmxt )
++ | apcs-gnu | atpcs | aapcs | iwmmxt | aapcs-linux )
+ #OK
+ ;;
+ *)
diff --git a/package/gcc/4.3.6/999-4.3.3-arm-fix-for-bug-37436.patch b/package/gcc/4.3.6/999-4.3.3-arm-fix-for-bug-37436.patch
new file mode 100644
index 000000000..99a016fbe
--- /dev/null
+++ b/package/gcc/4.3.6/999-4.3.3-arm-fix-for-bug-37436.patch
@@ -0,0 +1,86 @@
+gcc svn 142778:
+
+PR target/37436
+* arm.c (arm_legitimate_index): Only accept addresses that are in
+canonical form.
+* predicates.md (arm_reg_or_extendqisi_mem_op): New predicate.
+* arm.md (extendqihi2): Use arm_reg_or_extendqisi_mem_op predicate
+for operand1.
+(extendqisi2): Likewise.
+(arm_extendqisi, arm_extendqisi_v6): Use arm_extendqisi_mem_op
+predicate for operand1.
+
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.c gcc-4.3.3/gcc/config/arm/arm.c
+--- gcc-4.3.3.orig/gcc/config/arm/arm.c 2008-06-11 07:52:55.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/arm.c 2009-05-21 16:06:45.000000000 -0300
+@@ -3769,6 +3769,7 @@
+ rtx xop1 = XEXP (x, 1);
+
+ return ((arm_address_register_rtx_p (xop0, strict_p)
++ && GET_CODE(xop1) == CONST_INT
+ && arm_legitimate_index_p (mode, xop1, outer, strict_p))
+ || (arm_address_register_rtx_p (xop1, strict_p)
+ && arm_legitimate_index_p (mode, xop0, outer, strict_p)));
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.md gcc-4.3.3/gcc/config/arm/arm.md
+--- gcc-4.3.3.orig/gcc/config/arm/arm.md 2007-09-04 01:44:47.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/arm.md 2009-05-21 16:06:45.000000000 -0300
+@@ -4199,7 +4199,7 @@
+
+ (define_expand "extendqihi2"
+ [(set (match_dup 2)
+- (ashift:SI (match_operand:QI 1 "general_operand" "")
++ (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
+ (const_int 24)))
+ (set (match_operand:HI 0 "s_register_operand" "")
+ (ashiftrt:SI (match_dup 2)
+@@ -4224,7 +4224,7 @@
+
+ (define_insn "*arm_extendqihi_insn"
+ [(set (match_operand:HI 0 "s_register_operand" "=r")
+- (sign_extend:HI (match_operand:QI 1 "memory_operand" "Uq")))]
++ (sign_extend:HI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
+ "TARGET_ARM && arm_arch4"
+ "ldr%(sb%)\\t%0, %1"
+ [(set_attr "type" "load_byte")
+@@ -4235,7 +4235,7 @@
+
+ (define_expand "extendqisi2"
+ [(set (match_dup 2)
+- (ashift:SI (match_operand:QI 1 "general_operand" "")
++ (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
+ (const_int 24)))
+ (set (match_operand:SI 0 "s_register_operand" "")
+ (ashiftrt:SI (match_dup 2)
+@@ -4267,7 +4267,7 @@
+
+ (define_insn "*arm_extendqisi"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+- (sign_extend:SI (match_operand:QI 1 "memory_operand" "Uq")))]
++ (sign_extend:SI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
+ "TARGET_ARM && arm_arch4 && !arm_arch6"
+ "ldr%(sb%)\\t%0, %1"
+ [(set_attr "type" "load_byte")
+@@ -4278,7 +4278,8 @@
+
+ (define_insn "*arm_extendqisi_v6"
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+- (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,Uq")))]
++ (sign_extend:SI
++ (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "r,Uq")))]
+ "TARGET_ARM && arm_arch6"
+ "@
+ sxtb%?\\t%0, %1
+diff -Nura gcc-4.3.3.orig/gcc/config/arm/predicates.md gcc-4.3.3/gcc/config/arm/predicates.md
+--- gcc-4.3.3.orig/gcc/config/arm/predicates.md 2007-08-02 07:49:31.000000000 -0300
++++ gcc-4.3.3/gcc/config/arm/predicates.md 2009-05-21 16:06:45.000000000 -0300
+@@ -234,6 +234,10 @@
+ (match_test "arm_legitimate_address_p (mode, XEXP (op, 0), SIGN_EXTEND,
+ 0)")))
+
++(define_special_predicate "arm_reg_or_extendqisi_mem_op"
++ (ior (match_operand 0 "arm_extendqisi_mem_op")
++ (match_operand 0 "s_register_operand")))
++
+ (define_predicate "power_of_two_operand"
+ (match_code "const_int")
+ {
diff --git a/package/gcc/4.3.6/999-gcc-4.3.0-cris-pragma-pack-warning-remove.patch b/package/gcc/4.3.6/999-gcc-4.3.0-cris-pragma-pack-warning-remove.patch
new file mode 100644
index 000000000..dcf01f24b
--- /dev/null
+++ b/package/gcc/4.3.6/999-gcc-4.3.0-cris-pragma-pack-warning-remove.patch
@@ -0,0 +1,13 @@
+diff -urN gcc-4.3.1.orig/gcc/config/cris/cris.h gcc-4.3.1/gcc/config/cris/cris.h
+--- gcc-4.3.1.orig/gcc/config/cris/cris.h 2008-02-22 12:11:01.000000000 +0100
++++ gcc-4.3.1/gcc/config/cris/cris.h 2008-07-02 10:42:42.000000000 +0200
+@@ -1529,9 +1529,6 @@
+
+ #define NO_IMPLICIT_EXTERN_C
+
+-/* No specific purpose other than warningless compatibility. */
+-#define HANDLE_PRAGMA_PACK_PUSH_POP 1
+-
+ /*
+ * Local variables:
+ * eval: (c-set-style "gnu")
diff --git a/package/gcc/4.3.6/gcc-43-pr39429.patch b/package/gcc/4.3.6/gcc-43-pr39429.patch
new file mode 100644
index 000000000..4e1dc9ef7
--- /dev/null
+++ b/package/gcc/4.3.6/gcc-43-pr39429.patch
@@ -0,0 +1,24 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Subject: Fix: compiler create bad asm codes.
+
+See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39429 for details.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+
+---
+ gcc/config/arm/arm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: b/gcc/config/arm/arm.c
+===================================================================
+--- a/gcc/config/arm/arm.c
++++ b/gcc/config/arm/arm.c
+@@ -6838,7 +6838,7 @@ adjacent_mem_locations (rtx a, rtx b)
+ /* Don't accept any offset that will require multiple
+ instructions to handle, since this would cause the
+ arith_adjacentmem pattern to output an overlong sequence. */
+- if (!const_ok_for_op (PLUS, val0) || !const_ok_for_op (PLUS, val1))
++ if (!const_ok_for_op (val0, PLUS) || !const_ok_for_op (val1, PLUS))
+ return 0;
+
+ /* Don't allow an eliminable register: register elimination can make
diff --git a/package/gcc/4.3.6/powerpc-link-with-math-lib.patch.conditional b/package/gcc/4.3.6/powerpc-link-with-math-lib.patch.conditional
new file mode 100644
index 000000000..9d01ebaf3
--- /dev/null
+++ b/package/gcc/4.3.6/powerpc-link-with-math-lib.patch.conditional
@@ -0,0 +1,125 @@
+See: http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00237.html
+Patch by: Bernhard Reutner-Fischer
+
+--- gcc-4.3.3/gcc/config/t-slibgcc-elf-ver 2005-02-20 00:44:10.000000000 +1300
++++ gcc-4.3.3-p/gcc/config/t-slibgcc-elf-ver 2009-05-06 07:05:50.000000000 +1200
+@@ -9,7 +9,7 @@
+ SHLIB_OBJS = @shlib_objs@
+ SHLIB_DIR = @multilib_dir@
+ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
+-SHLIB_LC = -lc
++SHLIB_LC = @libgcc_libm@ -lc
+
+ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,--soname=$(SHLIB_SONAME) \
+--- gcc-4.3.3/libgcc/configure 2008-11-21 06:09:53.000000000 +1300
++++ gcc-4.3.3-p/libgcc/configure 2009-05-06 07:05:50.000000000 +1200
+@@ -272,7 +272,7 @@
+ PACKAGE_BUGREPORT=''
+
+ ac_unique_file="static-object.mk"
+-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcc_topdir enable_shared slibdir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK build build_cpu build_vendor build_os host host_cpu host_vendor host_os host_noncanonical build_libsubdir build_subdir host_subdir target_subdir AR ac_ct_AR LIPO ac_ct_LIPO NM ac_ct_NM RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP decimal_float enable_decimal_float fixed_point vis_hide set_have_cc_tls tmake_file extra_parts asm_hidden_op LIBOBJS LTLIBOBJS'
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcc_topdir enable_shared slibdir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK build build_cpu build_vendor build_os host host_cpu host_vendor host_os host_noncanonical build_libsubdir build_subdir host_subdir target_subdir AR ac_ct_AR LIPO ac_ct_LIPO NM ac_ct_NM RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP decimal_float enable_decimal_float fixed_point vis_hide set_have_cc_tls LIBGCC_LIBM tmake_file extra_parts asm_hidden_op LIBOBJS LTLIBOBJS'
+ ac_subst_files=''
+
+ # Initialize some variables set by options.
+@@ -3505,6 +3505,39 @@
+ fi
+
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++echo "$as_me:$LINENO: checking for library containing copysignl" >&5
++echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
++if test "${libgcc_cv_copysignl_lib+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++
++fi
++echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
++echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
++
++
+ # Conditionalize the makefile for this target machine.
+ tmake_file_=
+ for f in ${tmake_file}
+@@ -4225,6 +4258,7 @@
+ s,@fixed_point@,$fixed_point,;t t
+ s,@vis_hide@,$vis_hide,;t t
+ s,@set_have_cc_tls@,$set_have_cc_tls,;t t
++s,@LIBGCC_LIBM@,$LIBGCC_LIBM,;t t
+ s,@tmake_file@,$tmake_file,;t t
+ s,@extra_parts@,$extra_parts,;t t
+ s,@asm_hidden_op@,$asm_hidden_op,;t t
+--- gcc-4.3.3/libgcc/configure.ac 2008-11-21 06:09:53.000000000 +1300
++++ gcc-4.3.3-p/libgcc/configure.ac 2009-05-06 07:05:50.000000000 +1200
+@@ -207,6 +207,27 @@
+ fi
+ AC_SUBST(set_have_cc_tls)
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++AC_CACHE_CHECK([for library containing copysignl],
++ libgcc_cv_copysignl_lib, [
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++ ])
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
++AC_SUBST(LIBGCC_LIBM)
++
+ # Conditionalize the makefile for this target machine.
+ tmake_file_=
+ for f in ${tmake_file}
+--- gcc-4.3.3/libgcc/Makefile.in 2008-06-17 21:32:34.000000000 +1200
++++ gcc-4.3.3-p/libgcc/Makefile.in 2009-05-06 07:05:50.000000000 +1200
+@@ -40,6 +40,7 @@
+ decimal_float = @decimal_float@
+ enable_decimal_float = @enable_decimal_float@
+ fixed_point = @fixed_point@
++LIBGCC_LIBM = @LIBGCC_LIBM@
+
+ host_noncanonical = @host_noncanonical@
+
+@@ -738,9 +739,10 @@
+ @multilib_dir@,$(MULTIDIR),$(subst \
+ @shlib_objs@,$(objects),$(subst \
+ @shlib_base_name@,libgcc_s,$(subst \
++ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
+ @shlib_map_file@,$(mapfile),$(subst \
+ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
+- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
++ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
+
+ libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
+ # @multilib_flags@ is still needed because this may use
diff --git a/package/gcc/4.4.7-arc/fix_branch_out_of_range.patch b/package/gcc/4.4.7-arc/fix_branch_out_of_range.patch
new file mode 100644
index 000000000..e39b1cc2d
--- /dev/null
+++ b/package/gcc/4.4.7-arc/fix_branch_out_of_range.patch
@@ -0,0 +1,30 @@
+arc: Fix operand-out-of-range errors
+
+brcc_s instructions can generate operand-out-of-range errors. While a
+better solution is being discussed by the compiler team, this workaround
+ensures that the chances of running into this issue are low.
+
+Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
+
+diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
+index ff602c0..b3ca4c4 100644
+--- a/gcc/config/arc/arc.c
++++ b/gcc/config/arc/arc.c
+@@ -6565,7 +6565,7 @@ estimate required size increase).
+ rtx *ccp = &XEXP (XVECEXP (pat, 0, 1), 0);
+
+ offset = branch_dest (insn) - INSN_ADDRESSES (INSN_UID (insn));
+- if ((offset >= -140 && offset < 140)
++ if ((offset >= -120 && offset < 120)
+ && rtx_equal_p (XEXP (op, 1), const0_rtx)
+ && compact_register_operand (XEXP (op, 0), VOIDmode)
+ && equality_comparison_operator (op, VOIDmode))
+@@ -6687,7 +6687,7 @@ estimate required size increase).
+
+ if (op0 != cmp0)
+ cc_clob_rtx = gen_rtx_REG (CC_ZNmode, CC_REG);
+- else if ((offset >= -140 && offset < 140)
++ else if ((offset >= -120 && offset < 120)
+ && rtx_equal_p (op1, const0_rtx)
+ && compact_register_operand (op0, VOIDmode)
+ && (GET_CODE (op) == EQ
diff --git a/package/gcc/4.4.7/100-uclibc-conf.patch b/package/gcc/4.4.7/100-uclibc-conf.patch
new file mode 100644
index 000000000..cca8c8229
--- /dev/null
+++ b/package/gcc/4.4.7/100-uclibc-conf.patch
@@ -0,0 +1,33 @@
+--- gcc/gcc/config/--- gcc/contrib/regression/objs-gcc.sh
++++ gcc/contrib/regression/objs-gcc.sh
+@@ -105,6 +105,10 @@
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+--- gcc/libjava/classpath/ltconfig
++++ gcc/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1251,7 +1251,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
diff --git a/package/gcc/4.4.7/301-missing-execinfo_h.patch b/package/gcc/4.4.7/301-missing-execinfo_h.patch
new file mode 100644
index 000000000..0e2092f3f
--- /dev/null
+++ b/package/gcc/4.4.7/301-missing-execinfo_h.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500
++++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500
+@@ -500,7 +500,7 @@
+ #ifdef __linux__
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/package/gcc/4.4.7/302-c99-snprintf.patch b/package/gcc/4.4.7/302-c99-snprintf.patch
new file mode 100644
index 000000000..ba51a0e1d
--- /dev/null
+++ b/package/gcc/4.4.7/302-c99-snprintf.patch
@@ -0,0 +1,13 @@
+Index: gcc-4.3.0/libstdc++-v3/include/c_global/cstdio
+===================================================================
+--- gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (revision 129202)
++++ gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (working copy)
+@@ -144,7 +144,7 @@
+
+ _GLIBCXX_END_NAMESPACE
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined __UCLIBC__
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/package/gcc/4.4.7/305-libmudflap-susv3-legacy.patch b/package/gcc/4.4.7/305-libmudflap-susv3-legacy.patch
new file mode 100644
index 000000000..374b1f865
--- /dev/null
+++ b/package/gcc/4.4.7/305-libmudflap-susv3-legacy.patch
@@ -0,0 +1,49 @@
+Index: gcc-4.2/libmudflap/mf-hooks2.c
+===================================================================
+--- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834)
++++ gcc-4.2/libmudflap/mf-hooks2.c (working copy)
+@@ -427,7 +427,7 @@
+ {
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
+- bzero (s, n);
++ memset (s, 0, n);
+ }
+
+
+@@ -437,7 +437,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
+ MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
+- bcopy (src, dest, n);
++ memmove (dest, src, n);
+ }
+
+
+@@ -447,7 +447,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
+ MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
+- return bcmp (s1, s2, n);
++ return n == 0 ? 0 : memcmp (s1, s2, n);
+ }
+
+
+@@ -456,7 +456,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
+- return index (s, c);
++ return strchr (s, c);
+ }
+
+
+@@ -465,7 +465,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
+- return rindex (s, c);
++ return strrchr (s, c);
+ }
+
+ /* XXX: stpcpy, memccpy */
diff --git a/package/gcc/4.4.7/810-arm-softfloat-libgcc.patch b/package/gcc/4.4.7/810-arm-softfloat-libgcc.patch
new file mode 100644
index 000000000..e6a30a3f0
--- /dev/null
+++ b/package/gcc/4.4.7/810-arm-softfloat-libgcc.patch
@@ -0,0 +1,38 @@
+[PATCH] add the correct symbols to libgcc for uclibc arm softfloat
+
+Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+---
+ gcc/config/arm/linux-elf.h | 2 +-
+ gcc/config/arm/t-linux | 6 +++++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+Index: gcc-4.4.0/gcc/config/arm/t-linux
+===================================================================
+--- gcc-4.4.0.orig/gcc/config/arm/t-linux
++++ gcc-4.4.0/gcc/config/arm/t-linux
+@@ -4,7 +4,11 @@
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+- _arm_addsubdf3 _arm_addsubsf3
++ _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
++ _arm_fixsfsi _arm_fixunssfsi
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+Index: gcc-4.4.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.4.0.orig/gcc/config/arm/linux-elf.h
++++ gcc-4.4.0/gcc/config/arm/linux-elf.h
+@@ -60,7 +60,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
diff --git a/package/gcc/4.4.7/950-sparc-leon.patch b/package/gcc/4.4.7/950-sparc-leon.patch
new file mode 100644
index 000000000..ad18607c9
--- /dev/null
+++ b/package/gcc/4.4.7/950-sparc-leon.patch
@@ -0,0 +1,239 @@
+diff -Naurb gcc-4.4.2.ori/gcc/config/sparc/leon.md gcc-4.4.2/gcc/config/sparc/leon.md
+--- gcc-4.4.2.ori/gcc/config/sparc/leon.md 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.4.2/gcc/config/sparc/leon.md 2010-10-19 11:56:58.000000000 +0200
+@@ -0,0 +1,56 @@
++;; Scheduling description for Leon.
++;; Copyright (C) 2010 Free Software Foundation, Inc.
++;;
++;; This file is part of GCC.
++;;
++;; GCC is free software; you can redistribute it and/or modify
++;; it under the terms of the GNU General Public License as published by
++;; the Free Software Foundation; either version 3, or (at your option)
++;; any later version.
++;;
++;; GCC 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 General Public License for more details.
++;;
++;; You should have received a copy of the GNU General Public License
++;; along with GCC; see the file COPYING3. If not see
++;; <http://www.gnu.org/licenses/>.
++
++
++(define_automaton "leon")
++
++(define_cpu_unit "leon_memory, leon_fpalu" "leon")
++(define_cpu_unit "leon_fpmds" "leon")
++(define_cpu_unit "write_buf" "leon")
++
++(define_insn_reservation "leon_load" 1
++ (and (eq_attr "cpu" "leon")
++ (eq_attr "type" "load,sload,fpload"))
++ "leon_memory")
++
++(define_insn_reservation "leon_store" 1
++ (and (eq_attr "cpu" "leon")
++ (eq_attr "type" "store,fpstore"))
++ "leon_memory+write_buf")
++
++(define_insn_reservation "leon_fp_alu" 1
++ (and (eq_attr "cpu" "leon")
++ (eq_attr "type" "fp,fpmove"))
++ "leon_fpalu, nothing")
++
++(define_insn_reservation "leon_fp_mult" 1
++ (and (eq_attr "cpu" "leon")
++ (eq_attr "type" "fpmul"))
++ "leon_fpmds, nothing")
++
++(define_insn_reservation "leon_fp_div" 16
++ (and (eq_attr "cpu" "leon")
++ (eq_attr "type" "fpdivs,fpdivd"))
++ "leon_fpmds, nothing*15")
++
++(define_insn_reservation "leon_fp_sqrt" 23
++ (and (eq_attr "cpu" "leon")
++ (eq_attr "type" "fpsqrts,fpsqrtd"))
++ "leon_fpmds, nothing*21")
++
+diff -Naurb gcc-4.4.2.ori/gcc/config/sparc/sparc.c gcc-4.4.2/gcc/config/sparc/sparc.c
+--- gcc-4.4.2.ori/gcc/config/sparc/sparc.c 2010-10-19 11:55:17.000000000 +0200
++++ gcc-4.4.2/gcc/config/sparc/sparc.c 2010-10-19 11:56:58.000000000 +0200
+@@ -246,6 +246,30 @@
+ 0, /* shift penalty */
+ };
+
++static const
++struct processor_costs leon_costs = {
++ COSTS_N_INSNS (1), /* int load */
++ COSTS_N_INSNS (1), /* int signed load */
++ COSTS_N_INSNS (1), /* int zeroed load */
++ COSTS_N_INSNS (1), /* float load */
++ COSTS_N_INSNS (1), /* fmov, fneg, fabs */
++ COSTS_N_INSNS (1), /* fadd, fsub */
++ COSTS_N_INSNS (1), /* fcmp */
++ COSTS_N_INSNS (1), /* fmov, fmovr */
++ COSTS_N_INSNS (1), /* fmul */
++ COSTS_N_INSNS (15), /* fdivs */
++ COSTS_N_INSNS (15), /* fdivd */
++ COSTS_N_INSNS (23), /* fsqrts */
++ COSTS_N_INSNS (23), /* fsqrtd */
++ COSTS_N_INSNS (5), /* imul */
++ COSTS_N_INSNS (5), /* imulX */
++ 0, /* imul bit factor */
++ COSTS_N_INSNS (5), /* idiv */
++ COSTS_N_INSNS (5), /* idivX */
++ COSTS_N_INSNS (1), /* movcc/movr */
++ 0, /* shift penalty */
++};
++
+ const struct processor_costs *sparc_costs = &cypress_costs;
+
+ #ifdef HAVE_AS_RELAX_OPTION
+@@ -651,6 +675,10 @@
+ { TARGET_CPU_ultrasparc3, "ultrasparc3" },
+ { TARGET_CPU_niagara, "niagara" },
+ { TARGET_CPU_niagara2, "niagara2" },
++ { TARGET_CPU_sparchfleon, "sparchfleon" },
++ { TARGET_CPU_sparchfleonv8, "sparchfleonv8" },
++ { TARGET_CPU_sparcsfleon, "sparcsfleon" },
++ { TARGET_CPU_sparcsfleonv8, "sparcsfleonv8" },
+ { 0, 0 }
+ };
+ const struct cpu_default *def;
+@@ -689,6 +717,11 @@
+ /* UltraSPARC T1 */
+ { "niagara", PROCESSOR_NIAGARA, MASK_ISA, MASK_V9|MASK_DEPRECATED_V8_INSNS},
+ { "niagara2", PROCESSOR_NIAGARA, MASK_ISA, MASK_V9},
++ /* SPARC-LEON */
++ { "sparchfleon", PROCESSOR_LEON, MASK_ISA, MASK_FPU },
++ { "sparchfleonv8", PROCESSOR_LEON, MASK_ISA & ~(MASK_V8), MASK_V8|MASK_FPU },
++ { "sparcsfleon", PROCESSOR_LEON, MASK_ISA | MASK_FPU, 0 },
++ { "sparcsfleonv8", PROCESSOR_LEON, (MASK_ISA | MASK_FPU) & ~(MASK_V8), MASK_V8 },
+ { 0, 0, 0, 0 }
+ };
+ const struct cpu_table *cpu;
+@@ -855,6 +888,9 @@
+ case PROCESSOR_NIAGARA2:
+ sparc_costs = &niagara2_costs;
+ break;
++ case PROCESSOR_LEON:
++ sparc_costs = &leon_costs;
++ break;
+ };
+
+ #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
+diff -Naurb gcc-4.4.2.ori/gcc/config/sparc/sparc.h gcc-4.4.2/gcc/config/sparc/sparc.h
+--- gcc-4.4.2.ori/gcc/config/sparc/sparc.h 2010-10-19 11:55:17.000000000 +0200
++++ gcc-4.4.2/gcc/config/sparc/sparc.h 2010-10-19 11:56:58.000000000 +0200
+@@ -243,6 +243,10 @@
+ #define TARGET_CPU_ultrasparc3 9
+ #define TARGET_CPU_niagara 10
+ #define TARGET_CPU_niagara2 11
++#define TARGET_CPU_sparchfleon 12
++#define TARGET_CPU_sparchfleonv8 13
++#define TARGET_CPU_sparcsfleon 14
++#define TARGET_CPU_sparcsfleonv8 15
+
+ #if TARGET_CPU_DEFAULT == TARGET_CPU_v9 \
+ || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc \
+@@ -299,6 +303,26 @@
+ #define ASM_CPU32_DEFAULT_SPEC "-Asparclite"
+ #endif
+
++#if TARGET_CPU_DEFAULT == TARGET_CPU_sparchfleon
++#define CPP_CPU32_DEFAULT_SPEC "-Dsparcleon"
++#define ASM_CPU32_DEFAULT_SPEC ""
++#endif
++
++#if TARGET_CPU_DEFAULT == TARGET_CPU_sparcsfleon
++#define CPP_CPU32_DEFAULT_SPEC "-Dsparcleon -D_SOFT_FLOAT"
++#define ASM_CPU32_DEFAULT_SPEC ""
++#endif
++
++#if TARGET_CPU_DEFAULT == TARGET_CPU_sparchfleonv8
++#define CPP_CPU32_DEFAULT_SPEC "-Dsparcleon -D__sparc_v8__ "
++#define ASM_CPU32_DEFAULT_SPEC ""
++#endif
++
++#if TARGET_CPU_DEFAULT == TARGET_CPU_sparcsfleonv8
++#define CPP_CPU32_DEFAULT_SPEC "-Dsparcleon -D__sparc_v8__ -D_SOFT_FLOAT"
++#define ASM_CPU32_DEFAULT_SPEC ""
++#endif
++
+ #if TARGET_CPU_DEFAULT == TARGET_CPU_supersparc
+ #define CPP_CPU32_DEFAULT_SPEC "-D__supersparc__ -D__sparc_v8__"
+ #define ASM_CPU32_DEFAULT_SPEC ""
+@@ -369,6 +393,10 @@
+ %{mcpu=ultrasparc3:-D__sparc_v9__} \
+ %{mcpu=niagara:-D__sparc_v9__} \
+ %{mcpu=niagara2:-D__sparc_v9__} \
++%{mcpu=sparchfleon:-Dsparcleon} \
++%{mcpu=sparchfleonv8:-Dsparcleon -D__sparc_v8__} \
++%{mcpu=sparcsfleon:-Dsparcleon -D_SOFT_FLOAT} \
++%{mcpu=sparcsfleonv8:-Dsparcleon -D_SOFT_FLOAT -D__sparc_v8__} \
+ %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:%(cpp_cpu_default)}}}}}}} \
+ "
+ #define CPP_ARCH32_SPEC ""
+@@ -533,6 +561,7 @@
+ PROCESSOR_V7,
+ PROCESSOR_CYPRESS,
+ PROCESSOR_V8,
++ PROCESSOR_LEON,
+ PROCESSOR_SUPERSPARC,
+ PROCESSOR_SPARCLITE,
+ PROCESSOR_F930,
+diff -Naurb gcc-4.4.2.ori/gcc/config/sparc/sparc.md gcc-4.4.2/gcc/config/sparc/sparc.md
+--- gcc-4.4.2.ori/gcc/config/sparc/sparc.md 2010-10-19 11:55:17.000000000 +0200
++++ gcc-4.4.2/gcc/config/sparc/sparc.md 2010-10-19 11:56:58.000000000 +0200
+@@ -89,6 +89,7 @@
+ "v7,
+ cypress,
+ v8,
++ leon,
+ supersparc,
+ sparclite,f930,f934,
+ hypersparc,sparclite86x,
+@@ -320,6 +321,7 @@
+ (include "ultra3.md")
+ (include "niagara.md")
+ (include "niagara2.md")
++(include "leon.md")
+
+
+ ;; Operand and operator predicates and constraints
+diff -Naurb gcc-4.4.2.ori/gcc/config/sparc/t-leon gcc-4.4.2/gcc/config/sparc/t-leon
+--- gcc-4.4.2.ori/gcc/config/sparc/t-leon 1970-01-01 01:00:00.000000000 +0100
++++ gcc-4.4.2/gcc/config/sparc/t-leon 2010-10-19 11:56:58.000000000 +0200
+@@ -0,0 +1,16 @@
++# configuration file for LEON cpu
++
++LIB1ASMSRC = sparc/lb1spc.asm
++LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3
++
++# We want fine grained libraries, so use the new code to build the
++# floating point emulation libraries.
++FPBIT = fp-bit.c
++DPBIT = dp-bit.c
++
++dp-bit.c: $(srcdir)/config/fp-bit.c
++ cat $(srcdir)/config/fp-bit.c > dp-bit.c
++
++fp-bit.c: $(srcdir)/config/fp-bit.c
++ echo '#define FLOAT' > fp-bit.c
++ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+diff -Naurb gcc-4.4.2.ori/gcc/config.gcc gcc-4.4.2/gcc/config.gcc
+--- gcc-4.4.2.ori/gcc/config.gcc 2010-10-19 11:55:17.000000000 +0200
++++ gcc-4.4.2/gcc/config.gcc 2010-10-19 11:56:11.000000000 +0200
+@@ -2978,6 +2978,9 @@
+ | v9 | ultrasparc | ultrasparc3 | niagara | niagara2)
+ # OK
+ ;;
++ sparchfleon | sparcsfleon | sparchfleonv8 | sparcsfleonv8 | leon)
++ tmake_file="${tmake_file} sparc/t-leon"
++ ;;
+ *)
+ echo "Unknown cpu used in --with-$which=$val" 1>&2
+ exit 1
diff --git a/package/gcc/4.4.7/gcc-44-pr39429.patch b/package/gcc/4.4.7/gcc-44-pr39429.patch
new file mode 100644
index 000000000..4e1dc9ef7
--- /dev/null
+++ b/package/gcc/4.4.7/gcc-44-pr39429.patch
@@ -0,0 +1,24 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Subject: Fix: compiler create bad asm codes.
+
+See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39429 for details.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+
+---
+ gcc/config/arm/arm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: b/gcc/config/arm/arm.c
+===================================================================
+--- a/gcc/config/arm/arm.c
++++ b/gcc/config/arm/arm.c
+@@ -6838,7 +6838,7 @@ adjacent_mem_locations (rtx a, rtx b)
+ /* Don't accept any offset that will require multiple
+ instructions to handle, since this would cause the
+ arith_adjacentmem pattern to output an overlong sequence. */
+- if (!const_ok_for_op (PLUS, val0) || !const_ok_for_op (PLUS, val1))
++ if (!const_ok_for_op (val0, PLUS) || !const_ok_for_op (val1, PLUS))
+ return 0;
+
+ /* Don't allow an eliminable register: register elimination can make
diff --git a/package/gcc/4.4.7/powerpc-link-with-math-lib.patch.conditional b/package/gcc/4.4.7/powerpc-link-with-math-lib.patch.conditional
new file mode 100644
index 000000000..3fe8757d7
--- /dev/null
+++ b/package/gcc/4.4.7/powerpc-link-with-math-lib.patch.conditional
@@ -0,0 +1,137 @@
+http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
+
+On glibc the libc.so carries a copy of the math function copysignl() but
+on uClibc math functions like copysignl() live in libm. Since libgcc_s
+contains unresolved symbols, any attempt to link against libgcc_s
+without explicitely specifying -lm fails, resulting in a broken
+bootstrap of the compiler.
+
+
+diff -rdup gcc-4.4.0.old/gcc/config/t-slibgcc-elf-ver gcc-4.4.0/gcc/config/t-slibgcc-elf-ver
+
+diff -durN gcc-4.4.4.orig/gcc/config/t-slibgcc-elf-ver gcc-4.4.4/gcc/config/t-slibgcc-elf-ver
+--- gcc-4.4.4.orig/gcc/config/t-slibgcc-elf-ver 2010-01-04 16:13:08.000000000 +0100
++++ gcc-4.4.4/gcc/config/t-slibgcc-elf-ver 2010-05-16 19:38:36.000000000 +0200
+@@ -9,7 +9,7 @@
+ SHLIB_OBJS = @shlib_objs@
+ SHLIB_DIR = @multilib_dir@
+ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
+-SHLIB_LC = -lc
++SHLIB_LC = @libgcc_libm@ -lc
+ SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
+ SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \
+ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+diff -durN gcc-4.4.4.orig/libgcc/Makefile.in gcc-4.4.4/libgcc/Makefile.in
+--- gcc-4.4.4.orig/libgcc/Makefile.in 2009-04-10 01:23:07.000000000 +0200
++++ gcc-4.4.4/libgcc/Makefile.in 2010-05-16 19:38:36.000000000 +0200
+@@ -39,6 +39,7 @@
+ decimal_float = @decimal_float@
+ enable_decimal_float = @enable_decimal_float@
+ fixed_point = @fixed_point@
++LIBGCC_LIBM = @LIBGCC_LIBM@
+
+ host_noncanonical = @host_noncanonical@
+
+@@ -787,9 +788,10 @@
+ @multilib_dir@,$(MULTIDIR),$(subst \
+ @shlib_objs@,$(objects),$(subst \
+ @shlib_base_name@,libgcc_s,$(subst \
++ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
+ @shlib_map_file@,$(mapfile),$(subst \
+ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
+- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
++ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
+
+ libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
+ # @multilib_flags@ is still needed because this may use
+diff -durN gcc-4.4.4.orig/libgcc/configure gcc-4.4.4/libgcc/configure
+--- gcc-4.4.4.orig/libgcc/configure 2008-11-20 18:13:01.000000000 +0100
++++ gcc-4.4.4/libgcc/configure 2010-05-16 19:38:36.000000000 +0200
+@@ -272,7 +272,7 @@
+ PACKAGE_BUGREPORT=''
+
+ ac_unique_file="static-object.mk"
+-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcc_topdir enable_shared slibdir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK build build_cpu build_vendor build_os host host_cpu host_vendor host_os host_noncanonical build_libsubdir build_subdir host_subdir target_subdir AR ac_ct_AR LIPO ac_ct_LIPO NM ac_ct_NM RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP decimal_float enable_decimal_float fixed_point vis_hide set_have_cc_tls tmake_file extra_parts asm_hidden_op LIBOBJS LTLIBOBJS'
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcc_topdir enable_shared slibdir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK build build_cpu build_vendor build_os host host_cpu host_vendor host_os host_noncanonical build_libsubdir build_subdir host_subdir target_subdir AR ac_ct_AR LIPO ac_ct_LIPO NM ac_ct_NM RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP decimal_float enable_decimal_float fixed_point vis_hide set_have_cc_tls LIBGCC_LIBM tmake_file extra_parts asm_hidden_op LIBOBJS LTLIBOBJS'
+ ac_subst_files=''
+ ac_pwd=`pwd`
+
+@@ -3547,6 +3547,39 @@
+ fi
+
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++echo "$as_me:$LINENO: checking for library containing copysignl" >&5
++echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
++if test "${libgcc_cv_copysignl_lib+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++
++fi
++echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
++echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
++
++
+ # Conditionalize the makefile for this target machine.
+ tmake_file_=
+ for f in ${tmake_file}
+@@ -4267,6 +4300,7 @@
+ s,@fixed_point@,$fixed_point,;t t
+ s,@vis_hide@,$vis_hide,;t t
+ s,@set_have_cc_tls@,$set_have_cc_tls,;t t
++s,@LIBGCC_LIBM@,$LIBGCC_LIBM,;t t
+ s,@tmake_file@,$tmake_file,;t t
+ s,@extra_parts@,$extra_parts,;t t
+ s,@asm_hidden_op@,$asm_hidden_op,;t t
+diff -durN gcc-4.4.4.orig/libgcc/configure.ac gcc-4.4.4/libgcc/configure.ac
+--- gcc-4.4.4.orig/libgcc/configure.ac 2008-11-20 18:13:01.000000000 +0100
++++ gcc-4.4.4/libgcc/configure.ac 2010-05-16 19:38:36.000000000 +0200
+@@ -223,6 +223,27 @@
+ fi
+ AC_SUBST(set_have_cc_tls)
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++AC_CACHE_CHECK
++ libgcc_cv_copysignl_lib,
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++ ])
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
++AC_SUBST(LIBGCC_LIBM)
++
+ # Conditionalize the makefile for this target machine.
+ tmake_file_=
+ for f in ${tmake_file}
diff --git a/package/gcc/4.5.4/100-uclibc-conf.patch b/package/gcc/4.5.4/100-uclibc-conf.patch
new file mode 100644
index 000000000..cca8c8229
--- /dev/null
+++ b/package/gcc/4.5.4/100-uclibc-conf.patch
@@ -0,0 +1,33 @@
+--- gcc/gcc/config/--- gcc/contrib/regression/objs-gcc.sh
++++ gcc/contrib/regression/objs-gcc.sh
+@@ -105,6 +105,10 @@
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+--- gcc/libjava/classpath/ltconfig
++++ gcc/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1251,7 +1251,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
diff --git a/package/gcc/4.5.4/301-missing-execinfo_h.patch b/package/gcc/4.5.4/301-missing-execinfo_h.patch
new file mode 100644
index 000000000..0e2092f3f
--- /dev/null
+++ b/package/gcc/4.5.4/301-missing-execinfo_h.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500
++++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500
+@@ -500,7 +500,7 @@
+ #ifdef __linux__
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/package/gcc/4.5.4/302-c99-snprintf.patch b/package/gcc/4.5.4/302-c99-snprintf.patch
new file mode 100644
index 000000000..ba51a0e1d
--- /dev/null
+++ b/package/gcc/4.5.4/302-c99-snprintf.patch
@@ -0,0 +1,13 @@
+Index: gcc-4.3.0/libstdc++-v3/include/c_global/cstdio
+===================================================================
+--- gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (revision 129202)
++++ gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (working copy)
+@@ -144,7 +144,7 @@
+
+ _GLIBCXX_END_NAMESPACE
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined __UCLIBC__
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/package/gcc/4.5.4/305-libmudflap-susv3-legacy.patch b/package/gcc/4.5.4/305-libmudflap-susv3-legacy.patch
new file mode 100644
index 000000000..374b1f865
--- /dev/null
+++ b/package/gcc/4.5.4/305-libmudflap-susv3-legacy.patch
@@ -0,0 +1,49 @@
+Index: gcc-4.2/libmudflap/mf-hooks2.c
+===================================================================
+--- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834)
++++ gcc-4.2/libmudflap/mf-hooks2.c (working copy)
+@@ -427,7 +427,7 @@
+ {
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
+- bzero (s, n);
++ memset (s, 0, n);
+ }
+
+
+@@ -437,7 +437,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
+ MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
+- bcopy (src, dest, n);
++ memmove (dest, src, n);
+ }
+
+
+@@ -447,7 +447,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
+ MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
+- return bcmp (s1, s2, n);
++ return n == 0 ? 0 : memcmp (s1, s2, n);
+ }
+
+
+@@ -456,7 +456,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
+- return index (s, c);
++ return strchr (s, c);
+ }
+
+
+@@ -465,7 +465,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
+- return rindex (s, c);
++ return strrchr (s, c);
+ }
+
+ /* XXX: stpcpy, memccpy */
diff --git a/package/gcc/4.5.4/810-arm-softfloat-libgcc.patch b/package/gcc/4.5.4/810-arm-softfloat-libgcc.patch
new file mode 100644
index 000000000..e6a30a3f0
--- /dev/null
+++ b/package/gcc/4.5.4/810-arm-softfloat-libgcc.patch
@@ -0,0 +1,38 @@
+[PATCH] add the correct symbols to libgcc for uclibc arm softfloat
+
+Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+---
+ gcc/config/arm/linux-elf.h | 2 +-
+ gcc/config/arm/t-linux | 6 +++++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+Index: gcc-4.4.0/gcc/config/arm/t-linux
+===================================================================
+--- gcc-4.4.0.orig/gcc/config/arm/t-linux
++++ gcc-4.4.0/gcc/config/arm/t-linux
+@@ -4,7 +4,11 @@
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+- _arm_addsubdf3 _arm_addsubsf3
++ _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
++ _arm_fixsfsi _arm_fixunssfsi
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+Index: gcc-4.4.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.4.0.orig/gcc/config/arm/linux-elf.h
++++ gcc-4.4.0/gcc/config/arm/linux-elf.h
+@@ -60,7 +60,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
diff --git a/package/gcc/4.5.4/820-arm-unbreak-armv4t.patch b/package/gcc/4.5.4/820-arm-unbreak-armv4t.patch
new file mode 100644
index 000000000..8651afcd8
--- /dev/null
+++ b/package/gcc/4.5.4/820-arm-unbreak-armv4t.patch
@@ -0,0 +1,14 @@
+http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
+
+diff -Nura gcc-4.5.1.orig/gcc/config/arm/linux-eabi.h gcc-4.5.1/gcc/config/arm/linux-eabi.h
+--- gcc-4.5.1.orig/gcc/config/arm/linux-eabi.h 2009-10-30 17:03:09.000000000 -0300
++++ gcc-4.5.1/gcc/config/arm/linux-eabi.h 2010-11-02 15:38:25.792208500 -0300
+@@ -44,7 +44,7 @@
+ The ARM10TDMI core is the default for armv5t, so set
+ SUBTARGET_CPU_DEFAULT to achieve this. */
+ #undef SUBTARGET_CPU_DEFAULT
+-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ /* TARGET_BIG_ENDIAN_DEFAULT is set in
+ config.gcc for big endian configurations. */
diff --git a/package/gcc/4.5.4/830-arm-pr43440.patch b/package/gcc/4.5.4/830-arm-pr43440.patch
new file mode 100644
index 000000000..811d1f249
--- /dev/null
+++ b/package/gcc/4.5.4/830-arm-pr43440.patch
@@ -0,0 +1,345 @@
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43440
+
+--- gcc-4.4.4.orig/gcc/config/arm/aout.h
++++ gcc-4.4.4/gcc/config/arm/aout.h
+@@ -163,34 +163,49 @@
+ {"mvdx12", 39}, \
+ {"mvdx13", 40}, \
+ {"mvdx14", 41}, \
+- {"mvdx15", 42}, \
+- {"d0", 63}, {"q0", 63}, \
+- {"d1", 65}, \
+- {"d2", 67}, {"q1", 67}, \
+- {"d3", 69}, \
+- {"d4", 71}, {"q2", 71}, \
+- {"d5", 73}, \
+- {"d6", 75}, {"q3", 75}, \
+- {"d7", 77}, \
+- {"d8", 79}, {"q4", 79}, \
+- {"d9", 81}, \
+- {"d10", 83}, {"q5", 83}, \
+- {"d11", 85}, \
+- {"d12", 87}, {"q6", 87}, \
+- {"d13", 89}, \
+- {"d14", 91}, {"q7", 91}, \
+- {"d15", 93}, \
+- {"q8", 95}, \
+- {"q9", 99}, \
+- {"q10", 103}, \
+- {"q11", 107}, \
+- {"q12", 111}, \
+- {"q13", 115}, \
+- {"q14", 119}, \
+- {"q15", 123} \
++ {"mvdx15", 42} \
+ }
+ #endif
+
++#ifndef OVERLAPPING_REGISTER_NAMES
++#define OVERLAPPING_REGISTER_NAMES \
++{ \
++ {"d0", 63, 2}, \
++ {"d1", 65, 2}, \
++ {"d2", 67, 2}, \
++ {"d3", 69, 2}, \
++ {"d4", 71, 2}, \
++ {"d5", 73, 2}, \
++ {"d6", 75, 2}, \
++ {"d7", 77, 2}, \
++ {"d8", 79, 2}, \
++ {"d9", 81, 2}, \
++ {"d10", 83, 2}, \
++ {"d11", 85, 2}, \
++ {"d12", 87, 2}, \
++ {"d13", 89, 2}, \
++ {"d14", 91, 2}, \
++ {"d15", 93, 2}, \
++ {"q0", 63, 4}, \
++ {"q1", 67, 4}, \
++ {"q2", 71, 4}, \
++ {"q3", 75, 4}, \
++ {"q4", 79, 4}, \
++ {"q5", 83, 4}, \
++ {"q6", 87, 4}, \
++ {"q7", 91, 4}, \
++ {"q8", 95, 4}, \
++ {"q9", 99, 4}, \
++ {"q10", 103, 4}, \
++ {"q11", 107, 4}, \
++ {"q12", 111, 4}, \
++ {"q13", 115, 4}, \
++ {"q14", 119, 4}, \
++ {"q15", 123, 4} \
++}
++#endif
++
++
+ #ifndef NO_DOLLAR_IN_LABEL
+ #define NO_DOLLAR_IN_LABEL 1
+ #endif
+--- gcc-4.4.4.orig/gcc/output.h
++++ gcc-4.4.4/gcc/output.h
+@@ -169,6 +169,11 @@
+ Prefixes such as % are optional. */
+ extern int decode_reg_name (const char *);
+
++/* Similar to decode_reg_name, but takes an extra parameter that is a
++ pointer to the number of (internal) registers described by the
++ external name. */
++extern int decode_reg_name_and_count (const char *, int *);
++
+ extern void assemble_alias (tree, tree);
+
+ extern void default_assemble_visibility (tree, int);
+--- gcc-4.4.4.orig/gcc/reginfo.c
++++ gcc-4.4.4/gcc/reginfo.c
+@@ -800,39 +800,44 @@
+ fix_register (const char *name, int fixed, int call_used)
+ {
+ int i;
++ int reg, nregs;
+
+ /* Decode the name and update the primary form of
+ the register info. */
+-
+- if ((i = decode_reg_name (name)) >= 0)
++ if ((reg = decode_reg_name_and_count (name, &nregs)) >= 0)
+ {
+- if ((i == STACK_POINTER_REGNUM
++ gcc_assert (nregs >= 1);
++ for (i = reg; i < reg + nregs; i++)
++ {
++ if ((i == STACK_POINTER_REGNUM
+ #ifdef HARD_FRAME_POINTER_REGNUM
+- || i == HARD_FRAME_POINTER_REGNUM
++ || i == HARD_FRAME_POINTER_REGNUM
+ #else
+- || i == FRAME_POINTER_REGNUM
++ || i == FRAME_POINTER_REGNUM
+ #endif
+- )
+- && (fixed == 0 || call_used == 0))
+- {
+- static const char * const what_option[2][2] = {
+- { "call-saved", "call-used" },
+- { "no-such-option", "fixed" }};
++ )
++ && (fixed == 0 || call_used == 0))
++ {
++ static const char * const what_option[2][2] = {
++ { "call-saved", "call-used" },
++ { "no-such-option", "fixed" }};
+
+- error ("can't use '%s' as a %s register", name,
+- what_option[fixed][call_used]);
+- }
+- else
+- {
+- fixed_regs[i] = fixed;
+- call_used_regs[i] = call_used;
++ error ("can't use '%s' as a %s register", name,
++ what_option[fixed][call_used]);
++ }
++ else
++ {
++ fixed_regs[i] = fixed;
++ call_used_regs[i] = call_used;
+ #ifdef CALL_REALLY_USED_REGISTERS
+- if (fixed == 0)
+- call_really_used_regs[i] = call_used;
++ if (fixed == 0)
++ call_really_used_regs[i] = call_used;
+ #endif
+- }
+- }
+- else
++ }
++ }
++ }
++ else
++
+ {
+ warning (0, "unknown register name: %s", name);
+ }
+--- gcc-4.4.4.orig/gcc/stmt.c
++++ gcc-4.4.4/gcc/stmt.c
+@@ -681,13 +681,14 @@
+ for (tail = clobbers; tail; tail = TREE_CHAIN (tail))
+ {
+ const char *regname;
++ int nregs;
+
+ if (TREE_VALUE (tail) == error_mark_node)
+ return;
+ regname = TREE_STRING_POINTER (TREE_VALUE (tail));
+
+- i = decode_reg_name (regname);
+- if (i >= 0 || i == -4)
++ i = decode_reg_name_and_count (regname, &nregs);
++ if (i == -4)
+ ++nclobbers;
+ else if (i == -2)
+ error ("unknown register name %qs in %<asm%>", regname);
+@@ -695,14 +696,21 @@
+ /* Mark clobbered registers. */
+ if (i >= 0)
+ {
+- /* Clobbering the PIC register is an error. */
+- if (i == (int) PIC_OFFSET_TABLE_REGNUM)
+- {
+- error ("PIC register %qs clobbered in %<asm%>", regname);
+- return;
+- }
++ int reg;
+
+- SET_HARD_REG_BIT (clobbered_regs, i);
++ for (reg = i; reg < i + nregs; reg++)
++ {
++ ++nclobbers;
++
++ /* Clobbering the PIC register is an error. */
++ if (reg == (int) PIC_OFFSET_TABLE_REGNUM)
++ {
++ error ("PIC register clobbered by %qs in %<asm%>", regname);
++ return;
++ }
++
++ SET_HARD_REG_BIT (clobbered_regs, reg);
++ }
+ }
+ }
+
+@@ -1012,8 +1020,9 @@
+ for (tail = clobbers; tail; tail = TREE_CHAIN (tail))
+ {
+ const char *regname = TREE_STRING_POINTER (TREE_VALUE (tail));
+- int j = decode_reg_name (regname);
+- rtx clobbered_reg;
++ int reg, nregs;
++ int j = decode_reg_name_and_count (regname, &nregs);
++ rtx clobbered_reg;
+
+ if (j < 0)
+ {
+@@ -1033,31 +1042,40 @@
+ /* Ignore unknown register, error already signaled. */
+ continue;
+ }
+-
+- /* Use QImode since that's guaranteed to clobber just one reg. */
+- clobbered_reg = gen_rtx_REG (QImode, j);
+-
+- /* Do sanity check for overlap between clobbers and respectively
+- input and outputs that hasn't been handled. Such overlap
+- should have been detected and reported above. */
+- if (!clobber_conflict_found)
+- {
+- int opno;
+-
+- /* We test the old body (obody) contents to avoid tripping
+- over the under-construction body. */
+- for (opno = 0; opno < noutputs; opno++)
+- if (reg_overlap_mentioned_p (clobbered_reg, output_rtx[opno]))
+- internal_error ("asm clobber conflict with output operand");
+-
+- for (opno = 0; opno < ninputs - ninout; opno++)
+- if (reg_overlap_mentioned_p (clobbered_reg,
+- ASM_OPERANDS_INPUT (obody, opno)))
+- internal_error ("asm clobber conflict with input operand");
++
++ for (reg = j; reg < j + nregs; reg++)
++ {
++ /* Use QImode since that's guaranteed to clobber just
++ * one reg. */
++ clobbered_reg = gen_rtx_REG (QImode, reg);
++
++ /* Do sanity check for overlap between clobbers and
++ respectively input and outputs that hasn't been
++ handled. Such overlap should have been detected and
++ reported above. */
++ if (!clobber_conflict_found)
++ {
++ int opno;
++
++ /* We test the old body (obody) contents to avoid
++ tripping over the under-construction body. */
++ for (opno = 0; opno < noutputs; opno++)
++ if (reg_overlap_mentioned_p (clobbered_reg,
++ output_rtx[opno]))
++ internal_error
++ ("asm clobber conflict with output operand");
++
++ for (opno = 0; opno < ninputs - ninout; opno++)
++ if (reg_overlap_mentioned_p (clobbered_reg,
++ ASM_OPERANDS_INPUT (obody,
++ opno)))
++ internal_error
++ ("asm clobber conflict with input operand");
++ }
++
++ XVECEXP (body, 0, i++)
++ = gen_rtx_CLOBBER (VOIDmode, clobbered_reg);
+ }
+-
+- XVECEXP (body, 0, i++)
+- = gen_rtx_CLOBBER (VOIDmode, clobbered_reg);
+ }
+
+ emit_insn (body);
+--- gcc-4.4.4.orig/gcc/varasm.c
++++ gcc-4.4.4/gcc/varasm.c
+@@ -1031,8 +1031,11 @@
+ Prefixes such as % are optional. */
+
+ int
+-decode_reg_name (const char *asmspec)
++decode_reg_name_and_count (const char *asmspec, int *pnregs)
+ {
++ /* Presume just one register is clobbered. */
++ *pnregs = 1;
++
+ if (asmspec != 0)
+ {
+ int i;
+@@ -1058,6 +1061,25 @@
+ && ! strcmp (asmspec, strip_reg_name (reg_names[i])))
+ return i;
+
++#ifdef OVERLAPPING_REGISTER_NAMES
++ {
++ static const struct
++ {
++ const char *const name;
++ const int number;
++ const int nregs;
++ } table[] = OVERLAPPING_REGISTER_NAMES;
++
++ for (i = 0; i < (int) ARRAY_SIZE (table); i++)
++ if (table[i].name[0]
++ && ! strcmp (asmspec, table[i].name))
++ {
++ *pnregs = table[i].nregs;
++ return table[i].number;
++ }
++ }
++#endif /* OVERLAPPING_REGISTER_NAMES */
++
+ #ifdef ADDITIONAL_REGISTER_NAMES
+ {
+ static const struct { const char *const name; const int number; } table[]
+@@ -1081,6 +1103,15 @@
+
+ return -1;
+ }
++
++int
++decode_reg_name (const char *name)
++{
++ int count;
++ return decode_reg_name_and_count (name, &count);
++}
++
++
+
+ /* Return true if DECL's initializer is suitable for a BSS section. */
+
diff --git a/package/gcc/4.5.4/powerpc-link-with-math-lib.patch.conditional b/package/gcc/4.5.4/powerpc-link-with-math-lib.patch.conditional
new file mode 100644
index 000000000..7e75e87f2
--- /dev/null
+++ b/package/gcc/4.5.4/powerpc-link-with-math-lib.patch.conditional
@@ -0,0 +1,125 @@
+http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
+
+On glibc the libc.so carries a copy of the math function copysignl() but
+on uClibc math functions like copysignl() live in libm. Since libgcc_s
+contains unresolved symbols, any attempt to link against libgcc_s
+without explicitely specifying -lm fails, resulting in a broken
+bootstrap of the compiler.
+
+Forward port to gcc 4.5.1 by Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+diff -Nura gcc-4.5.1.orig/gcc/config/t-slibgcc-elf-ver gcc-4.5.1/gcc/config/t-slibgcc-elf-ver
+--- gcc-4.5.1.orig/gcc/config/t-slibgcc-elf-ver 2010-11-03 14:35:08.644904042 -0300
++++ gcc-4.5.1/gcc/config/t-slibgcc-elf-ver 2010-11-03 14:35:56.332904024 -0300
+@@ -27,7 +27,7 @@
+ SHLIB_OBJS = @shlib_objs@
+ SHLIB_DIR = @multilib_dir@
+ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
+-SHLIB_LC = -lc
++SHLIB_LC = @libgcc_libm@ -lc
+ SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
+ SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \
+ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+diff -Nura gcc-4.5.1.orig/libgcc/Makefile.in gcc-4.5.1/libgcc/Makefile.in
+--- gcc-4.5.1.orig/libgcc/Makefile.in 2010-11-03 14:32:44.272904042 -0300
++++ gcc-4.5.1/libgcc/Makefile.in 2010-11-03 14:37:03.893904042 -0300
+@@ -39,6 +39,7 @@
+ decimal_float = @decimal_float@
+ enable_decimal_float = @enable_decimal_float@
+ fixed_point = @fixed_point@
++LIBGCC_LIBM = @LIBGCC_LIBM@
+
+ host_noncanonical = @host_noncanonical@
+
+@@ -798,9 +799,10 @@
+ @multilib_dir@,$(MULTIDIR),$(subst \
+ @shlib_objs@,$(objects),$(subst \
+ @shlib_base_name@,libgcc_s,$(subst \
++ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
+ @shlib_map_file@,$(mapfile),$(subst \
+ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
+- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
++ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
+
+ libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
+ # @multilib_flags@ is still needed because this may use
+diff -Nura gcc-4.5.1.orig/libgcc/configure gcc-4.5.1/libgcc/configure
+--- gcc-4.5.1.orig/libgcc/configure 2010-11-03 14:32:44.283904042 -0300
++++ gcc-4.5.1/libgcc/configure 2010-11-03 14:39:48.685904042 -0300
+@@ -557,6 +557,7 @@
+ extra_parts
+ tmake_file
+ set_use_emutls
++LIBGCC_LIBM
+ set_have_cc_tls
+ vis_hide
+ fixed_point
+@@ -3847,6 +3848,37 @@
+ set_use_emutls="-DUSE_EMUTLS"
+ fi
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++echo "$as_me:$LINENO: checking for library containing copysignl" >&5
++echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
++if test "${libgcc_cv_copysignl_lib+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++
++fi
++echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
++echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
+
+ # Conditionalize the makefile for this target machine.
+ tmake_file_=
+diff -Nura gcc-4.5.1.orig/libgcc/configure.ac gcc-4.5.1/libgcc/configure.ac
+--- gcc-4.5.1.orig/libgcc/configure.ac 2010-11-03 14:32:44.735904042 -0300
++++ gcc-4.5.1/libgcc/configure.ac 2010-11-03 14:42:11.278904045 -0300
+@@ -238,6 +238,27 @@
+ fi
+ AC_SUBST(set_have_cc_tls)
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++AC_CACHE_CHECK
++ libgcc_cv_copysignl_lib,
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++ ])
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
++AC_SUBST(LIBGCC_LIBM)
++
+ # See if we have emulated thread-local storage.
+ GCC_CHECK_EMUTLS
+ set_use_emutls=
diff --git a/package/gcc/4.6.4/100-uclibc-conf.patch b/package/gcc/4.6.4/100-uclibc-conf.patch
new file mode 100644
index 000000000..cca8c8229
--- /dev/null
+++ b/package/gcc/4.6.4/100-uclibc-conf.patch
@@ -0,0 +1,33 @@
+--- gcc/gcc/config/--- gcc/contrib/regression/objs-gcc.sh
++++ gcc/contrib/regression/objs-gcc.sh
+@@ -105,6 +105,10 @@
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+--- gcc/libjava/classpath/ltconfig
++++ gcc/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1251,7 +1251,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
diff --git a/package/gcc/4.6.4/301-missing-execinfo_h.patch b/package/gcc/4.6.4/301-missing-execinfo_h.patch
new file mode 100644
index 000000000..0e2092f3f
--- /dev/null
+++ b/package/gcc/4.6.4/301-missing-execinfo_h.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500
++++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500
+@@ -500,7 +500,7 @@
+ #ifdef __linux__
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/package/gcc/4.6.4/302-c99-snprintf.patch b/package/gcc/4.6.4/302-c99-snprintf.patch
new file mode 100644
index 000000000..ba51a0e1d
--- /dev/null
+++ b/package/gcc/4.6.4/302-c99-snprintf.patch
@@ -0,0 +1,13 @@
+Index: gcc-4.3.0/libstdc++-v3/include/c_global/cstdio
+===================================================================
+--- gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (revision 129202)
++++ gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (working copy)
+@@ -144,7 +144,7 @@
+
+ _GLIBCXX_END_NAMESPACE
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined __UCLIBC__
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/package/gcc/4.6.4/305-libmudflap-susv3-legacy.patch b/package/gcc/4.6.4/305-libmudflap-susv3-legacy.patch
new file mode 100644
index 000000000..374b1f865
--- /dev/null
+++ b/package/gcc/4.6.4/305-libmudflap-susv3-legacy.patch
@@ -0,0 +1,49 @@
+Index: gcc-4.2/libmudflap/mf-hooks2.c
+===================================================================
+--- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834)
++++ gcc-4.2/libmudflap/mf-hooks2.c (working copy)
+@@ -427,7 +427,7 @@
+ {
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
+- bzero (s, n);
++ memset (s, 0, n);
+ }
+
+
+@@ -437,7 +437,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
+ MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
+- bcopy (src, dest, n);
++ memmove (dest, src, n);
+ }
+
+
+@@ -447,7 +447,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
+ MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
+- return bcmp (s1, s2, n);
++ return n == 0 ? 0 : memcmp (s1, s2, n);
+ }
+
+
+@@ -456,7 +456,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
+- return index (s, c);
++ return strchr (s, c);
+ }
+
+
+@@ -465,7 +465,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
+- return rindex (s, c);
++ return strrchr (s, c);
+ }
+
+ /* XXX: stpcpy, memccpy */
diff --git a/package/gcc/4.6.4/810-arm-softfloat-libgcc.patch b/package/gcc/4.6.4/810-arm-softfloat-libgcc.patch
new file mode 100644
index 000000000..e6a30a3f0
--- /dev/null
+++ b/package/gcc/4.6.4/810-arm-softfloat-libgcc.patch
@@ -0,0 +1,38 @@
+[PATCH] add the correct symbols to libgcc for uclibc arm softfloat
+
+Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+---
+ gcc/config/arm/linux-elf.h | 2 +-
+ gcc/config/arm/t-linux | 6 +++++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+Index: gcc-4.4.0/gcc/config/arm/t-linux
+===================================================================
+--- gcc-4.4.0.orig/gcc/config/arm/t-linux
++++ gcc-4.4.0/gcc/config/arm/t-linux
+@@ -4,7 +4,11 @@
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+- _arm_addsubdf3 _arm_addsubsf3
++ _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
++ _arm_fixsfsi _arm_fixunssfsi
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+Index: gcc-4.4.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.4.0.orig/gcc/config/arm/linux-elf.h
++++ gcc-4.4.0/gcc/config/arm/linux-elf.h
+@@ -60,7 +60,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
diff --git a/package/gcc/4.6.4/820-arm-unbreak-armv4t.patch b/package/gcc/4.6.4/820-arm-unbreak-armv4t.patch
new file mode 100644
index 000000000..8651afcd8
--- /dev/null
+++ b/package/gcc/4.6.4/820-arm-unbreak-armv4t.patch
@@ -0,0 +1,14 @@
+http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
+
+diff -Nura gcc-4.5.1.orig/gcc/config/arm/linux-eabi.h gcc-4.5.1/gcc/config/arm/linux-eabi.h
+--- gcc-4.5.1.orig/gcc/config/arm/linux-eabi.h 2009-10-30 17:03:09.000000000 -0300
++++ gcc-4.5.1/gcc/config/arm/linux-eabi.h 2010-11-02 15:38:25.792208500 -0300
+@@ -44,7 +44,7 @@
+ The ARM10TDMI core is the default for armv5t, so set
+ SUBTARGET_CPU_DEFAULT to achieve this. */
+ #undef SUBTARGET_CPU_DEFAULT
+-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ /* TARGET_BIG_ENDIAN_DEFAULT is set in
+ config.gcc for big endian configurations. */
diff --git a/package/gcc/4.6.4/powerpc-link-with-math-lib.patch.conditional b/package/gcc/4.6.4/powerpc-link-with-math-lib.patch.conditional
new file mode 100644
index 000000000..7e75e87f2
--- /dev/null
+++ b/package/gcc/4.6.4/powerpc-link-with-math-lib.patch.conditional
@@ -0,0 +1,125 @@
+http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
+
+On glibc the libc.so carries a copy of the math function copysignl() but
+on uClibc math functions like copysignl() live in libm. Since libgcc_s
+contains unresolved symbols, any attempt to link against libgcc_s
+without explicitely specifying -lm fails, resulting in a broken
+bootstrap of the compiler.
+
+Forward port to gcc 4.5.1 by Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+diff -Nura gcc-4.5.1.orig/gcc/config/t-slibgcc-elf-ver gcc-4.5.1/gcc/config/t-slibgcc-elf-ver
+--- gcc-4.5.1.orig/gcc/config/t-slibgcc-elf-ver 2010-11-03 14:35:08.644904042 -0300
++++ gcc-4.5.1/gcc/config/t-slibgcc-elf-ver 2010-11-03 14:35:56.332904024 -0300
+@@ -27,7 +27,7 @@
+ SHLIB_OBJS = @shlib_objs@
+ SHLIB_DIR = @multilib_dir@
+ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
+-SHLIB_LC = -lc
++SHLIB_LC = @libgcc_libm@ -lc
+ SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
+ SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \
+ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+diff -Nura gcc-4.5.1.orig/libgcc/Makefile.in gcc-4.5.1/libgcc/Makefile.in
+--- gcc-4.5.1.orig/libgcc/Makefile.in 2010-11-03 14:32:44.272904042 -0300
++++ gcc-4.5.1/libgcc/Makefile.in 2010-11-03 14:37:03.893904042 -0300
+@@ -39,6 +39,7 @@
+ decimal_float = @decimal_float@
+ enable_decimal_float = @enable_decimal_float@
+ fixed_point = @fixed_point@
++LIBGCC_LIBM = @LIBGCC_LIBM@
+
+ host_noncanonical = @host_noncanonical@
+
+@@ -798,9 +799,10 @@
+ @multilib_dir@,$(MULTIDIR),$(subst \
+ @shlib_objs@,$(objects),$(subst \
+ @shlib_base_name@,libgcc_s,$(subst \
++ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
+ @shlib_map_file@,$(mapfile),$(subst \
+ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
+- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
++ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
+
+ libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
+ # @multilib_flags@ is still needed because this may use
+diff -Nura gcc-4.5.1.orig/libgcc/configure gcc-4.5.1/libgcc/configure
+--- gcc-4.5.1.orig/libgcc/configure 2010-11-03 14:32:44.283904042 -0300
++++ gcc-4.5.1/libgcc/configure 2010-11-03 14:39:48.685904042 -0300
+@@ -557,6 +557,7 @@
+ extra_parts
+ tmake_file
+ set_use_emutls
++LIBGCC_LIBM
+ set_have_cc_tls
+ vis_hide
+ fixed_point
+@@ -3847,6 +3848,37 @@
+ set_use_emutls="-DUSE_EMUTLS"
+ fi
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++echo "$as_me:$LINENO: checking for library containing copysignl" >&5
++echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
++if test "${libgcc_cv_copysignl_lib+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++
++fi
++echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
++echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
+
+ # Conditionalize the makefile for this target machine.
+ tmake_file_=
+diff -Nura gcc-4.5.1.orig/libgcc/configure.ac gcc-4.5.1/libgcc/configure.ac
+--- gcc-4.5.1.orig/libgcc/configure.ac 2010-11-03 14:32:44.735904042 -0300
++++ gcc-4.5.1/libgcc/configure.ac 2010-11-03 14:42:11.278904045 -0300
+@@ -238,6 +238,27 @@
+ fi
+ AC_SUBST(set_have_cc_tls)
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++AC_CACHE_CHECK
++ libgcc_cv_copysignl_lib,
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++ ])
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
++AC_SUBST(LIBGCC_LIBM)
++
+ # See if we have emulated thread-local storage.
+ GCC_CHECK_EMUTLS
+ set_use_emutls=
diff --git a/package/gcc/4.7.3/100-uclibc-conf.patch b/package/gcc/4.7.3/100-uclibc-conf.patch
new file mode 100644
index 000000000..cca8c8229
--- /dev/null
+++ b/package/gcc/4.7.3/100-uclibc-conf.patch
@@ -0,0 +1,33 @@
+--- gcc/gcc/config/--- gcc/contrib/regression/objs-gcc.sh
++++ gcc/contrib/regression/objs-gcc.sh
+@@ -105,6 +105,10 @@
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+--- gcc/libjava/classpath/ltconfig
++++ gcc/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1251,7 +1251,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
diff --git a/package/gcc/4.7.3/301-missing-execinfo_h.patch b/package/gcc/4.7.3/301-missing-execinfo_h.patch
new file mode 100644
index 000000000..0e2092f3f
--- /dev/null
+++ b/package/gcc/4.7.3/301-missing-execinfo_h.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500
++++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500
+@@ -500,7 +500,7 @@
+ #ifdef __linux__
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/package/gcc/4.7.3/302-c99-snprintf.patch b/package/gcc/4.7.3/302-c99-snprintf.patch
new file mode 100644
index 000000000..ba51a0e1d
--- /dev/null
+++ b/package/gcc/4.7.3/302-c99-snprintf.patch
@@ -0,0 +1,13 @@
+Index: gcc-4.3.0/libstdc++-v3/include/c_global/cstdio
+===================================================================
+--- gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (revision 129202)
++++ gcc-4.3.0/libstdc++-v3/include/c_global/cstdio (working copy)
+@@ -144,7 +144,7 @@
+
+ _GLIBCXX_END_NAMESPACE
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined __UCLIBC__
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/package/gcc/4.7.3/305-libmudflap-susv3-legacy.patch b/package/gcc/4.7.3/305-libmudflap-susv3-legacy.patch
new file mode 100644
index 000000000..374b1f865
--- /dev/null
+++ b/package/gcc/4.7.3/305-libmudflap-susv3-legacy.patch
@@ -0,0 +1,49 @@
+Index: gcc-4.2/libmudflap/mf-hooks2.c
+===================================================================
+--- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834)
++++ gcc-4.2/libmudflap/mf-hooks2.c (working copy)
+@@ -427,7 +427,7 @@
+ {
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
+- bzero (s, n);
++ memset (s, 0, n);
+ }
+
+
+@@ -437,7 +437,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
+ MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
+- bcopy (src, dest, n);
++ memmove (dest, src, n);
+ }
+
+
+@@ -447,7 +447,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
+ MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
+- return bcmp (s1, s2, n);
++ return n == 0 ? 0 : memcmp (s1, s2, n);
+ }
+
+
+@@ -456,7 +456,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
+- return index (s, c);
++ return strchr (s, c);
+ }
+
+
+@@ -465,7 +465,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
+- return rindex (s, c);
++ return strrchr (s, c);
+ }
+
+ /* XXX: stpcpy, memccpy */
diff --git a/package/gcc/4.7.3/810-arm-softfloat-libgcc.patch b/package/gcc/4.7.3/810-arm-softfloat-libgcc.patch
new file mode 100644
index 000000000..a3d7db014
--- /dev/null
+++ b/package/gcc/4.7.3/810-arm-softfloat-libgcc.patch
@@ -0,0 +1,25 @@
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -57,7 +57,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
+--- a/libgcc/config/arm/t-linux
++++ b/libgcc/config/arm/t-linux
+@@ -1,6 +1,10 @@
+ LIB1ASMSRC = arm/lib1funcs.S
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+- _arm_addsubdf3 _arm_addsubsf3
++ _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
++ _arm_fixsfsi _arm_fixunssfsi
+
+ # Just for these, we omit the frame pointer since it makes such a big
+ # difference.
diff --git a/package/gcc/4.7.3/830-arm_unbreak_armv4t.patch b/package/gcc/4.7.3/830-arm_unbreak_armv4t.patch
new file mode 100644
index 000000000..37f8f2a54
--- /dev/null
+++ b/package/gcc/4.7.3/830-arm_unbreak_armv4t.patch
@@ -0,0 +1,13 @@
+http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
+
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -45,7 +45,7 @@
+ The ARM10TDMI core is the default for armv5t, so set
+ SUBTARGET_CPU_DEFAULT to achieve this. */
+ #undef SUBTARGET_CPU_DEFAULT
+-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ /* TARGET_BIG_ENDIAN_DEFAULT is set in
+ config.gcc for big endian configurations. */
diff --git a/package/gcc/4.7.3/powerpc-link-with-math-lib.patch.conditional b/package/gcc/4.7.3/powerpc-link-with-math-lib.patch.conditional
new file mode 100644
index 000000000..2554263a0
--- /dev/null
+++ b/package/gcc/4.7.3/powerpc-link-with-math-lib.patch.conditional
@@ -0,0 +1,127 @@
+http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
+
+On glibc the libc.so carries a copy of the math function copysignl() but
+on uClibc math functions like copysignl() live in libm. Since libgcc_s
+contains unresolved symbols, any attempt to link against libgcc_s
+without explicitely specifying -lm fails, resulting in a broken
+bootstrap of the compiler.
+
+Forward ported to gcc 4.7.3
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+diff -Nura gcc-4.7.3.orig/libgcc/config/t-slibgcc gcc-4.7.3/libgcc/config/t-slibgcc
+--- gcc-4.7.3.orig/libgcc/config/t-slibgcc 2013-04-11 15:23:46.491571116 -0300
++++ gcc-4.7.3/libgcc/config/t-slibgcc 2013-04-11 15:25:06.241141824 -0300
+@@ -27,7 +27,7 @@
+ SHLIB_OBJS = @shlib_objs@
+ SHLIB_DIR = @multilib_dir@
+ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
+-SHLIB_LC = -lc
++SHLIB_LC = @libgcc_libm@ -lc
+ SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
+ SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \
+ $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+diff -Nura gcc-4.7.3.orig/libgcc/configure gcc-4.7.3/libgcc/configure
+--- gcc-4.7.3.orig/libgcc/configure 2013-04-11 15:23:46.551573051 -0300
++++ gcc-4.7.3/libgcc/configure 2013-04-11 15:25:06.243141875 -0300
+@@ -563,6 +563,7 @@
+ tmake_file
+ sfp_machine_header
+ set_use_emutls
++LIBGCC_LIBM
+ set_have_cc_tls
+ vis_hide
+ fixed_point
+@@ -4445,6 +4446,37 @@
+ fi
+ fi
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++echo "$as_me:$LINENO: checking for library containing copysignl" >&5
++echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
++if test "${libgcc_cv_copysignl_lib+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++
++fi
++echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
++echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
+
+ # Conditionalize the makefile for this target machine.
+ tmake_file_=
+diff -Nura gcc-4.7.3.orig/libgcc/configure.ac gcc-4.7.3/libgcc/configure.ac
+--- gcc-4.7.3.orig/libgcc/configure.ac 2013-04-11 15:23:46.551573051 -0300
++++ gcc-4.7.3/libgcc/configure.ac 2013-04-11 15:25:06.244141901 -0300
+@@ -324,6 +324,27 @@
+ fi
+ AC_SUBST(set_have_cc_tls)
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++AC_CACHE_CHECK
++ libgcc_cv_copysignl_lib,
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++ ])
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
++AC_SUBST(LIBGCC_LIBM)
++
+ # See if we have emulated thread-local storage.
+ GCC_CHECK_EMUTLS
+ set_use_emutls=
+diff -Nura gcc-4.7.3.orig/libgcc/Makefile.in gcc-4.7.3/libgcc/Makefile.in
+--- gcc-4.7.3.orig/libgcc/Makefile.in 2013-04-11 15:23:46.537572599 -0300
++++ gcc-4.7.3/libgcc/Makefile.in 2013-04-11 15:25:06.241141824 -0300
+@@ -41,6 +41,7 @@
+ decimal_float = @decimal_float@
+ enable_decimal_float = @enable_decimal_float@
+ fixed_point = @fixed_point@
++LIBGCC_LIBM = @LIBGCC_LIBM@
+
+ host_noncanonical = @host_noncanonical@
+ target_noncanonical = @target_noncanonical@
+@@ -928,9 +929,10 @@
+ @multilib_dir@,$(MULTIDIR),$(subst \
+ @shlib_objs@,$(objects) libgcc.a,$(subst \
+ @shlib_base_name@,libgcc_s,$(subst \
++ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
+ @shlib_map_file@,$(mapfile),$(subst \
+ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
+- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
++ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
+
+ libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
+ # @multilib_flags@ is still needed because this may use
diff --git a/package/gcc/4.8.1/100-uclibc-conf.patch b/package/gcc/4.8.1/100-uclibc-conf.patch
new file mode 100644
index 000000000..d855b30ee
--- /dev/null
+++ b/package/gcc/4.8.1/100-uclibc-conf.patch
@@ -0,0 +1,37 @@
+Index: gcc-4.8.0/contrib/regression/objs-gcc.sh
+===================================================================
+--- gcc-4.8.0.orig/contrib/regression/objs-gcc.sh 2009-04-09 17:00:19.000000000 +0200
++++ gcc-4.8.0/contrib/regression/objs-gcc.sh 2013-03-23 17:39:04.000000000 +0100
+@@ -106,6 +106,10 @@
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+Index: gcc-4.8.0/libjava/classpath/ltconfig
+===================================================================
+--- gcc-4.8.0.orig/libjava/classpath/ltconfig 2011-02-13 12:45:53.000000000 +0100
++++ gcc-4.8.0/libjava/classpath/ltconfig 2013-03-23 17:39:04.000000000 +0100
+@@ -603,7 +603,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1247,7 +1247,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
diff --git a/package/gcc/4.8.1/301-missing-execinfo_h.patch b/package/gcc/4.8.1/301-missing-execinfo_h.patch
new file mode 100644
index 000000000..00efda24a
--- /dev/null
+++ b/package/gcc/4.8.1/301-missing-execinfo_h.patch
@@ -0,0 +1,13 @@
+Index: gcc-4.8.0/boehm-gc/include/gc.h
+===================================================================
+--- gcc-4.8.0.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
++++ gcc-4.8.0/boehm-gc/include/gc.h 2013-03-23 17:39:20.000000000 +0100
+@@ -503,7 +503,7 @@
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/package/gcc/4.8.1/302-c99-snprintf.patch b/package/gcc/4.8.1/302-c99-snprintf.patch
new file mode 100644
index 000000000..cd4d2ccfb
--- /dev/null
+++ b/package/gcc/4.8.1/302-c99-snprintf.patch
@@ -0,0 +1,13 @@
+Index: gcc-4.8.0/libstdc++-v3/include/c_global/cstdio
+===================================================================
+--- gcc-4.8.0.orig/libstdc++-v3/include/c_global/cstdio 2013-02-03 18:54:05.000000000 +0100
++++ gcc-4.8.0/libstdc++-v3/include/c_global/cstdio 2013-03-23 17:39:32.000000000 +0100
+@@ -138,7 +138,7 @@
+ using ::vsprintf;
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined __UCLIBC__
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/package/gcc/4.8.1/305-libmudflap-susv3-legacy.patch b/package/gcc/4.8.1/305-libmudflap-susv3-legacy.patch
new file mode 100644
index 000000000..35d5f5020
--- /dev/null
+++ b/package/gcc/4.8.1/305-libmudflap-susv3-legacy.patch
@@ -0,0 +1,49 @@
+Index: gcc-4.8.0/libmudflap/mf-hooks2.c
+===================================================================
+--- gcc-4.8.0.orig/libmudflap/mf-hooks2.c 2013-02-03 18:48:05.000000000 +0100
++++ gcc-4.8.0/libmudflap/mf-hooks2.c 2013-03-23 17:39:43.000000000 +0100
+@@ -424,7 +424,7 @@
+ {
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
+- bzero (s, n);
++ memset (s, 0, n);
+ }
+
+
+@@ -434,7 +434,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
+ MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
+- bcopy (src, dest, n);
++ memmove (dest, src, n);
+ }
+
+
+@@ -444,7 +444,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
+ MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
+- return bcmp (s1, s2, n);
++ return n == 0 ? 0 : memcmp (s1, s2, n);
+ }
+
+
+@@ -453,7 +453,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
+- return index (s, c);
++ return strchr (s, c);
+ }
+
+
+@@ -462,7 +462,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
+- return rindex (s, c);
++ return strrchr (s, c);
+ }
+
+ /* XXX: stpcpy, memccpy */
diff --git a/package/gcc/4.8.1/810-arm-softfloat-libgcc.patch b/package/gcc/4.8.1/810-arm-softfloat-libgcc.patch
new file mode 100644
index 000000000..c8cb377d5
--- /dev/null
+++ b/package/gcc/4.8.1/810-arm-softfloat-libgcc.patch
@@ -0,0 +1,30 @@
+Index: gcc-4.8.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.8.0.orig/gcc/config/arm/linux-elf.h 2013-01-10 21:38:27.000000000 +0100
++++ gcc-4.8.0/gcc/config/arm/linux-elf.h 2013-03-23 17:40:00.000000000 +0100
+@@ -55,7 +55,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
+Index: gcc-4.8.0/libgcc/config/arm/t-linux
+===================================================================
+--- gcc-4.8.0.orig/libgcc/config/arm/t-linux 2012-03-22 16:14:46.000000000 +0100
++++ gcc-4.8.0/libgcc/config/arm/t-linux 2013-03-23 17:40:54.000000000 +0100
+@@ -1,6 +1,11 @@
+ LIB1ASMSRC = arm/lib1funcs.S
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3
++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
++ _arm_fixsfsi _arm_fixunssfsi
+
+ # Just for these, we omit the frame pointer since it makes such a big
+ # difference.
diff --git a/package/gcc/4.8.1/830-arm_unbreak_armv4t.patch b/package/gcc/4.8.1/830-arm_unbreak_armv4t.patch
new file mode 100644
index 000000000..37f8f2a54
--- /dev/null
+++ b/package/gcc/4.8.1/830-arm_unbreak_armv4t.patch
@@ -0,0 +1,13 @@
+http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
+
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -45,7 +45,7 @@
+ The ARM10TDMI core is the default for armv5t, so set
+ SUBTARGET_CPU_DEFAULT to achieve this. */
+ #undef SUBTARGET_CPU_DEFAULT
+-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ /* TARGET_BIG_ENDIAN_DEFAULT is set in
+ config.gcc for big endian configurations. */
diff --git a/package/gcc/4.8.1/powerpc-link-with-math-lib.patch.conditional b/package/gcc/4.8.1/powerpc-link-with-math-lib.patch.conditional
new file mode 100644
index 000000000..b7094fe65
--- /dev/null
+++ b/package/gcc/4.8.1/powerpc-link-with-math-lib.patch.conditional
@@ -0,0 +1,122 @@
+http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
+
+On glibc the libc.so carries a copy of the math function copysignl() but
+on uClibc math functions like copysignl() live in libm. Since libgcc_s
+contains unresolved symbols, any attempt to link against libgcc_s
+without explicitely specifying -lm fails, resulting in a broken
+bootstrap of the compiler.
+
+Forward port to gcc 4.5.1 by Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+---
+ libgcc/Makefile.in | 4 +++-
+ libgcc/configure | 32 ++++++++++++++++++++++++++++++++
+ libgcc/configure.ac | 21 +++++++++++++++++++++
+ 3 files changed, 56 insertions(+), 1 deletion(-)
+
+Index: gcc-4.8.0/libgcc/Makefile.in
+===================================================================
+--- gcc-4.8.0.orig/libgcc/Makefile.in 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.0/libgcc/Makefile.in 2013-03-24 09:12:43.000000000 +0100
+@@ -41,6 +41,7 @@
+ decimal_float = @decimal_float@
+ enable_decimal_float = @enable_decimal_float@
+ fixed_point = @fixed_point@
++LIBGCC_LIBM = @LIBGCC_LIBM@
+
+ host_noncanonical = @host_noncanonical@
+ target_noncanonical = @target_noncanonical@
+@@ -927,9 +928,10 @@
+ @multilib_dir@,$(MULTIDIR),$(subst \
+ @shlib_objs@,$(objects) libgcc.a,$(subst \
+ @shlib_base_name@,libgcc_s,$(subst \
++ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
+ @shlib_map_file@,$(mapfile),$(subst \
+ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
+- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
++ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
+
+ libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
+ # @multilib_flags@ is still needed because this may use
+Index: gcc-4.8.0/libgcc/configure
+===================================================================
+--- gcc-4.8.0.orig/libgcc/configure 2012-11-05 00:08:42.000000000 +0100
++++ gcc-4.8.0/libgcc/configure 2013-03-24 09:12:43.000000000 +0100
+@@ -564,6 +564,7 @@
+ tmake_file
+ sfp_machine_header
+ set_use_emutls
++LIBGCC_LIBM
+ set_have_cc_tls
+ vis_hide
+ fixed_point
+@@ -4481,6 +4482,37 @@
+ fi
+ fi
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++echo "$as_me:$LINENO: checking for library containing copysignl" >&5
++echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
++if test "${libgcc_cv_copysignl_lib+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++
++fi
++echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
++echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
+
+ # Conditionalize the makefile for this target machine.
+ tmake_file_=
+Index: gcc-4.8.0/libgcc/configure.ac
+===================================================================
+--- gcc-4.8.0.orig/libgcc/configure.ac 2012-10-15 15:10:30.000000000 +0200
++++ gcc-4.8.0/libgcc/configure.ac 2013-03-24 09:12:43.000000000 +0100
+@@ -326,6 +326,27 @@
+ fi
+ AC_SUBST(set_have_cc_tls)
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++AC_CACHE_CHECK
++ libgcc_cv_copysignl_lib,
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++ ])
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
++AC_SUBST(LIBGCC_LIBM)
++
+ # See if we have emulated thread-local storage.
+ GCC_CHECK_EMUTLS
+ set_use_emutls=