summaryrefslogtreecommitdiff
path: root/patches/gcc/3.4.3
diff options
context:
space:
mode:
Diffstat (limited to 'patches/gcc/3.4.3')
-rw-r--r--patches/gcc/3.4.3/fix-fixincl.patch70
-rw-r--r--patches/gcc/3.4.3/gcc-3.4.0-arm-bigendian.patch82
-rw-r--r--patches/gcc/3.4.3/gcc-3.4.0-arm-lib1asm.patch27
-rw-r--r--patches/gcc/3.4.3/gcc-3.4.0-arm-nolibfloat.patch24
-rw-r--r--patches/gcc/3.4.3/pr15068-fix.patch44
-rw-r--r--patches/gcc/3.4.3/pr16201-fix.patch149
-rw-r--r--patches/gcc/3.4.3/pr18508-fix.patch143
7 files changed, 539 insertions, 0 deletions
diff --git a/patches/gcc/3.4.3/fix-fixincl.patch b/patches/gcc/3.4.3/fix-fixincl.patch
new file mode 100644
index 0000000..7936b19
--- /dev/null
+++ b/patches/gcc/3.4.3/fix-fixincl.patch
@@ -0,0 +1,70 @@
+See http://gcc.gnu.org/PR22541
+
+From: Dan Kegel
+
+When building gcc-3.4.3 or gcc-4.0.0 as a cross into a clean $PREFIX
+(the only two I've tried like this), the configure script happily copies
+the glibc include files from include to sys-include; here's the line
+from the log file (with $PREFIX instead of the real prefix):
+
+Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include
+
+But later, when running fixincludes, it gives the error message
+ The directory that should contain system headers does not exist:
+ $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include
+
+Nevertheless, it continues building; the header files it installs in
+ $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include
+do not include the boilerplate that would cause it to #include_next the
+glibc headers in the system header directory.
+Thus the resulting toolchain can't compile the following program:
+#include <limits.h>
+int x = PATH_MAX;
+because its limits.h doesn't include the glibc header.
+
+That's not nice. I suspect the problem is that gcc/Makefile.in assumes that
+it can refer to $PREFIX/i686-unknown-linux-gnu with the path
+ $PREFIX/lib/../i686-unknown-linux-gnu, but
+that fails because the directory $PREFIX/lib doesn't exist during 'make all';
+it is only created later, during 'make install'. (Which makes this problem
+confusing, since one only notices the breakage well after 'make install',
+at which point the path configure complained about does exist, and has the
+right stuff in it.)
+
+A possible fix is to replace the line in gcc/Makefile.in that says
+ SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@
+with a version that gets rid of extra ..'s, e.g.
+ SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,,;ta"`
+(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq
+for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.)
+
+
+--- gcc-3.4.3/gcc/Makefile.in.foo 2005-05-20 11:41:39.000000000 -0700
++++ gcc-3.4.3/gcc/Makefile.in 2005-05-20 12:08:46.000000000 -0700
+@@ -350,7 +350,10 @@
+ CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
+
+ # autoconf sets SYSTEM_HEADER_DIR to one of the above.
+-SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@
++# Purge it of unneccessary internal relative paths
++# to directories that might not exist yet.
++# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta.
++SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`
+
+ # Control whether to run fixproto and fixincludes.
+ STMP_FIXPROTO = @STMP_FIXPROTO@
+@@ -2532,11 +2535,13 @@
+ $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(gcc_tooldir)
+
+ # Build fixed copies of system files.
++# Abort if no system headers available, unless building a crosscompiler.
++# FIXME: abort unless building --without-headers would be more accurate and less ugly
+ stmp-fixinc: fixinc.sh gsyslimits.h
+ @if test ! -d ${SYSTEM_HEADER_DIR}; then \
+ echo The directory that should contain system headers does not exist: >&2 ; \
+ echo " ${SYSTEM_HEADER_DIR}" >&2 ; \
+- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \
++ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \
+ then sleep 1; else exit 1; fi; \
+ fi
+ rm -rf include; mkdir include
diff --git a/patches/gcc/3.4.3/gcc-3.4.0-arm-bigendian.patch b/patches/gcc/3.4.3/gcc-3.4.0-arm-bigendian.patch
new file mode 100644
index 0000000..f7178c1
--- /dev/null
+++ b/patches/gcc/3.4.3/gcc-3.4.0-arm-bigendian.patch
@@ -0,0 +1,82 @@
+By Lennert Buytenhek <buytenh@wantstofly.org>
+Adds support for arm*b-linux* big-endian ARM targets
+
+Fixes build error
+
+/opt/crosstool/armeb-unknown-linux-gnu/gcc-3.4.2-glibc-2.3.3/armeb-unknown-linux-gnu/bin/ld: unrecognised emulation mode: armelf_linux
+Supported emulations: armelfb_linux armelfb
+collect2: ld returned 1 exit status
+make[2]: *** [/home/dank/wk/crosstool-0.28-rc36/build/armeb-unknown-linux-gnu/gcc-3.4.2-glibc-2.3.3/build-glibc/csu/crt1.o] Error 1
+make[2]: Leaving directory `/home/dank/wk/crosstool-0.28-rc36/build/armeb-unknown-linux-gnu/gcc-3.4.2-glibc-2.3.3/glibc-2.3.3/csu'
+make[1]: *** [csu/subdir_lib] Error 2
+make[1]: Leaving directory `/home/dank/wk/crosstool-0.28-rc36/build/armeb-unknown-linux-gnu/gcc-3.4.2-glibc-2.3.3/glibc-2.3.3'
+make: *** [all] Error 2
+
+
+See http://gcc.gnu.org/PR16350
+
+diff -urN gcc-3.4.0.orig/gcc/config/arm/linux-elf.h gcc-3.4.0/gcc/config/arm/linux-elf.h
+--- gcc-3.4.0.orig/gcc/config/arm/linux-elf.h 2004-01-31 07:18:11.000000000 +0100
++++ gcc-3.4.0/gcc/config/arm/linux-elf.h 2004-07-02 14:46:29.225443757 +0200
+@@ -30,17 +30,34 @@
+ /* Do not assume anything about header files. */
+ #define NO_IMPLICIT_EXTERN_C
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
++#define TARGET_ENDIAN_OPTION "mbig-endian"
++#define TARGET_LINKER_EMULATION "armelfb_linux"
++#else
++#define TARGET_ENDIAN_DEFAULT 0
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#define TARGET_LINKER_EMULATION "armelf_linux"
++#endif
++
+ /* Default is to use APCS-32 mode. */
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_APCS_32 | \
++ ARM_FLAG_MMU_TRAPS | \
++ TARGET_ENDIAN_DEFAULT )
+
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
+
+ #undef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
+
+ #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
+
+@@ -89,7 +106,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
+ -X \
+- %{mbig-endian:-EB}" \
++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
+ SUBTARGET_EXTRA_LINK_SPEC
+
+ #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
+diff -urN gcc-3.4.0.orig/gcc/config.gcc gcc-3.4.0/gcc/config.gcc
+--- gcc-3.4.0.orig/gcc/config.gcc 2004-04-17 04:28:24.000000000 +0200
++++ gcc-3.4.0/gcc/config.gcc 2004-07-02 14:44:40.045822542 +0200
+@@ -666,6 +666,11 @@
+ ;;
+ arm*-*-linux*) # ARM GNU/Linux with ELF
+ tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
++ case $target in
++ arm*b-*)
++ tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
++ ;;
++ esac
+ tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ gnu_ld=yes
diff --git a/patches/gcc/3.4.3/gcc-3.4.0-arm-lib1asm.patch b/patches/gcc/3.4.3/gcc-3.4.0-arm-lib1asm.patch
new file mode 100644
index 0000000..69a79d5
--- /dev/null
+++ b/patches/gcc/3.4.3/gcc-3.4.0-arm-lib1asm.patch
@@ -0,0 +1,27 @@
+# Origin: from a patch by Dimitry Andric <dimitry@andric.com>, 2004-05-01
+# See http://gcc.gnu.org/PR14352 and http://gcc.gnu.org/PR16314
+# See also http://gcc.gnu.org/ml/gcc-patches/2004-08/msg02568.html et seq for why this isn't in mainline
+# Fixes errors like the following when building glibc (or any other executable
+# or shared library) when using gcc 3.4.0 for ARM with softfloat:
+#
+# .../libc_pic.os(.text+0x15834): In function `__modf': undefined reference to `__subdf3'
+# .../libc_pic.os(.text+0x158b8): In function `__modf': undefined reference to `__subdf3'
+# .../libc_pic.os(.text+0x1590c): In function `scalbn': undefined reference to `__muldf3'
+# .../libc_pic.os(.text+0x15e94): In function `__ldexpf': undefined reference to `__eqsf2'
+# .../libc_pic.os(.text+0xcee4c): In function `monstartup': undefined reference to `__fixsfsi'
+
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/t-linux gcc-3.4.0/gcc/config/arm/t-linux
+--- gcc-3.4.0-orig/gcc/config/arm/t-linux 2003-09-20 23:09:07.000000000 +0200
++++ gcc-3.4.0/gcc/config/arm/t-linux 2004-05-01 20:31:59.102846400 +0200
+@@ -4,7 +4,10 @@
+ LIBGCC2_DEBUG_CFLAGS = -g0
+
+ 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
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
diff --git a/patches/gcc/3.4.3/gcc-3.4.0-arm-nolibfloat.patch b/patches/gcc/3.4.3/gcc-3.4.0-arm-nolibfloat.patch
new file mode 100644
index 0000000..43eed3e
--- /dev/null
+++ b/patches/gcc/3.4.3/gcc-3.4.0-arm-nolibfloat.patch
@@ -0,0 +1,24 @@
+# Dimitry Andric <dimitry@andric.com>, 2004-05-01
+#
+# * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed
+# anymore. (The required functions are now in libgcc.)
+#
+# Fixes errors like
+# arm-softfloat-linux-gnu/3.4.0/../../../../arm-softfloat-linux-gnu/bin/ld: cannot find -lfloat
+# collect2: ld returned 1 exit status
+# make[2]: *** [arm-softfloat-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/iconvdata/ISO8859-1.so] Error 1
+# when building glibc-2.3.3 with gcc-3.4.0 for arm-softfloat
+
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/linux-elf.h gcc-3.4.0/gcc/config/arm/linux-elf.h
+--- gcc-3.4.0-orig/gcc/config/arm/linux-elf.h 2004-01-31 07:18:11.000000000 +0100
++++ gcc-3.4.0/gcc/config/arm/linux-elf.h 2004-05-01 19:19:06.935979200 +0200
+@@ -55,7 +73,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
+ the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
+
diff --git a/patches/gcc/3.4.3/pr15068-fix.patch b/patches/gcc/3.4.3/pr15068-fix.patch
new file mode 100644
index 0000000..2977765
--- /dev/null
+++ b/patches/gcc/3.4.3/pr15068-fix.patch
@@ -0,0 +1,44 @@
+See http://gcc.gnu.org/PR15068
+
+Fixes error
+
+../sysdeps/generic/s_fmax.c: In function `__fmax':
+../sysdeps/generic/s_fmax.c:28: internal compiler error: in elim_reg_cond, at flow.c:3257
+Please submit a full bug report,
+with preprocessed source if appropriate.
+See <URL:http://gcc.gnu.org/bugs.html> for instructions.
+make[2]: *** [/home/dank/wk/crosstool-0.28-rc35/build/arm-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/math/s_fmax.o] Error 1
+make[2]: Leaving directory `/home/dank/wk/crosstool-0.28-rc35/build/arm-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040822/math'
+make[1]: *** [math/others] Error 2
+make[1]: Leaving directory `/home/dank/wk/crosstool-0.28-rc35/build/arm-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040822'
+make: *** [all] Error 2
+
+[ rediffed against gcc-3.4.1, with elbow grease, ending up with same thing as
+http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/flow.c.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=1.563.4.2&r2=1.563.4.3 ]
+
+--- gcc-3.4.1/gcc/flow.c.old 2004-02-27 19:39:19.000000000 -0800
++++ gcc-3.4.1/gcc/flow.c 2004-08-26 07:29:46.000000000 -0700
+@@ -1878,6 +1878,7 @@
+ rtx set_src = SET_SRC (pc_set (BB_END (bb)));
+ rtx cond_true = XEXP (set_src, 0);
+ rtx reg = XEXP (cond_true, 0);
++ enum rtx_code inv_cond;
+
+ if (GET_CODE (reg) == SUBREG)
+ reg = SUBREG_REG (reg);
+@@ -1886,11 +1887,13 @@
+ in the form of a comparison of a register against zero.
+ If the condition is more complex than that, then it is safe
+ not to record any information. */
+- if (GET_CODE (reg) == REG
++ inv_cond = reversed_comparison_code (cond_true, BB_END (bb));
++ if (inv_cond != UNKNOWN
++ && GET_CODE (reg) == REG
+ && XEXP (cond_true, 1) == const0_rtx)
+ {
+ rtx cond_false
+- = gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond_true)),
++ = gen_rtx_fmt_ee (inv_cond,
+ GET_MODE (cond_true), XEXP (cond_true, 0),
+ XEXP (cond_true, 1));
+ if (GET_CODE (XEXP (set_src, 1)) == PC)
diff --git a/patches/gcc/3.4.3/pr16201-fix.patch b/patches/gcc/3.4.3/pr16201-fix.patch
new file mode 100644
index 0000000..be3fec9
--- /dev/null
+++ b/patches/gcc/3.4.3/pr16201-fix.patch
@@ -0,0 +1,149 @@
+See http://gcc.gnu.org/PR16201
+
+Should fix "bad immediate value for offset" errors for several flavors of arm, e.g.
+
+/tmp/ccmdoQyg.s: Assembler messages:
+/tmp/ccmdoQyg.s:6235: Error: bad immediate value for offset (4096)
+make[2]: *** [crosstool-0.32/build/arm-xscale-linux-gnu/gcc-3.4.3-glibc-2.3.3/build-glibc/locale/ld-collate.o] Error 1
+
+/tmp/cc0c7qop.s: Assembler messages:
+/tmp/cc0c7qop.s:6234: Error: bad immediate value for offset (4104)
+make[2]: *** [crosstool-0.32/build/armv5b-softfloat-linux/gcc-3.4.3-glibc-2.3.3/build-glibc/locale/ld-collate.o] Error 1
+
+
+CVSROOT: /cvs/gcc
+Module name: gcc
+Branch: gcc-3_4-branch
+Changes by: rearnsha@gcc.gnu.org 2005-02-01 15:07:05
+
+Modified files:
+ gcc : ChangeLog
+ gcc/config/arm : arm-protos.h arm.c
+
+Log message:
+ PR target/16201
+ * arm.c (arm_eliminable_register): New function.
+ (adjacent_mem_locations): Don't allow eliminable registers. Use
+ HOST_WIDE_INT for address offsets.
+ * arm-protos.h (arm_eliminable_register): Add prototype.
+
+Patches:
+http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.790&r2=2.2326.2.791
+http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm-protos.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.61&r2=1.61.4.1
+http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.317.4.8&r2=1.317.4.9
+
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/config/arm/arm-protos.h,v
+retrieving revision 1.61
+retrieving revision 1.61.4.1
+diff -u -r1.61 -r1.61.4.1
+--- gcc/gcc/config/arm/arm-protos.h 2003/11/20 11:44:18 1.61
++++ gcc/gcc/config/arm/arm-protos.h 2005/02/01 15:07:02 1.61.4.1
+@@ -1,5 +1,6 @@
+ /* Prototypes for exported functions defined in arm.c and pe.c
+- Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005
++ Free Software Foundation, Inc.
+ Contributed by Richard Earnshaw (rearnsha@arm.com)
+ Minor hacks by Nick Clifton (nickc@cygnus.com)
+
+@@ -138,6 +139,7 @@
+ extern int arm_is_longcall_p (rtx, int, int);
+ extern int arm_emit_vector_const (FILE *, rtx);
+ extern const char * arm_output_load_gr (rtx *);
++extern int arm_eliminable_register (rtx);
+
+ #if defined TREE_CODE
+ extern rtx arm_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
+retrieving revision 1.317.4.8
+retrieving revision 1.317.4.9
+diff -u -r1.317.4.8 -r1.317.4.9
+--- gcc/gcc/config/arm/arm.c 2004/04/29 19:52:41 1.317.4.8
++++ gcc/gcc/config/arm/arm.c 2005/02/01 15:07:02 1.317.4.9
+@@ -1,6 +1,6 @@
+ /* Output routines for GCC for ARM.
+ Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+- 2002, 2003, 2004 Free Software Foundation, Inc.
++ 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
+ and Martin Simmons (@harleqn.co.uk).
+ More major hacks by Richard Earnshaw (rearnsha@arm.com).
+@@ -4056,6 +4056,16 @@
+ && INTVAL (op) < 64);
+ }
+
++/* Return true if X is a register that will be eliminated later on. */
++int
++arm_eliminable_register (rtx x)
++{
++ return REG_P (x) && (REGNO (x) == FRAME_POINTER_REGNUM
++ || REGNO (x) == ARG_POINTER_REGNUM
++ || (REGNO (x) >= FIRST_VIRTUAL_REGISTER
++ && REGNO (x) <= LAST_VIRTUAL_REGISTER));
++}
++
+ /* Returns TRUE if INSN is an "LDR REG, ADDR" instruction.
+ Use by the Cirrus Maverick code which has to workaround
+ a hardware bug triggered by such instructions. */
+@@ -4569,33 +4579,42 @@
+ || (GET_CODE (XEXP (b, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (b, 0), 1)) == CONST_INT)))
+ {
+- int val0 = 0, val1 = 0;
+- int reg0, reg1;
+-
++ HOST_WIDE_INT val0 = 0, val1 = 0;
++ rtx reg0, reg1;
++ int val_diff;
++
+ if (GET_CODE (XEXP (a, 0)) == PLUS)
+ {
+- reg0 = REGNO (XEXP (XEXP (a, 0), 0));
++ reg0 = XEXP (XEXP (a, 0), 0);
+ val0 = INTVAL (XEXP (XEXP (a, 0), 1));
+ }
+ else
+- reg0 = REGNO (XEXP (a, 0));
++ reg0 = XEXP (a, 0);
+
+ if (GET_CODE (XEXP (b, 0)) == PLUS)
+ {
+- reg1 = REGNO (XEXP (XEXP (b, 0), 0));
++ reg1 = XEXP (XEXP (b, 0), 0);
+ val1 = INTVAL (XEXP (XEXP (b, 0), 1));
+ }
+ else
+- reg1 = REGNO (XEXP (b, 0));
++ reg1 = XEXP (b, 0);
+
+ /* 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))
+ return 0;
+-
+- return (reg0 == reg1) && ((val1 - val0) == 4 || (val0 - val1) == 4);
++
++ /* Don't allow an eliminable register: register elimination can make
++ the offset too large. */
++ if (arm_eliminable_register (reg0))
++ return 0;
++
++ val_diff = val1 - val0;
++ return ((REGNO (reg0) == REGNO (reg1))
++ && (val_diff == 4 || val_diff == -4));
+ }
++
+ return 0;
+ }
+
+@@ -7301,7 +7320,6 @@
+ return "";
+ }
+
+-
+ /* Output a move from arm registers to an fpa registers.
+ OPERANDS[0] is an fpa register.
+ OPERANDS[1] is the first registers of an arm register pair. */
diff --git a/patches/gcc/3.4.3/pr18508-fix.patch b/patches/gcc/3.4.3/pr18508-fix.patch
new file mode 100644
index 0000000..a438fee
--- /dev/null
+++ b/patches/gcc/3.4.3/pr18508-fix.patch
@@ -0,0 +1,143 @@
+See http://gcc.gnu.org/PR18508
+
+This should fix cygwin errors like:
+
+basename: missing operand
+Try `basename --help' for more information.
+mv: `libgcc_s_nof.so.1' and `libgcc_s_nof.so.1.' are the same file
+make[2]: *** [nof/libgcc_s_nof.so] Error 1
+make[2]: Leaving directory `/home/cvachoucek/crosstool-0.32/build/powerpc-750-linux-gnu/gcc-3.4.3-glibc-2.3.5/build-gcc/gcc'
+make[1]: *** [stmp-multilib] Error 2
+make[1]: Leaving directory `/home/cvachoucek/crosstool-0.32/build/powerpc-750-linux-gnu/gcc-3.4.3-glibc-2.3.5/build-gcc/gcc'
+make: *** [install-gcc] Error 2
+
+From gcc-patches-return-133821-listarch-gcc-patches=gcc dot gnu dot org at gcc dot gnu dot org Wed Nov 17 00:15:28 2004
+Return-Path: <gcc-patches-return-133821-listarch-gcc-patches=gcc dot gnu dot org at gcc dot gnu dot org>
+Delivered-To: listarch-gcc-patches at gcc dot gnu dot org
+Received: (qmail 12823 invoked by alias); 17 Nov 2004 00:15:19 -0000
+Mailing-List: contact gcc-patches-help at gcc dot gnu dot org; run by ezmlm
+List-Archive: <http://gcc.gnu.org/ml/gcc-patches/>
+List-Post: <mailto:gcc-patches at gcc dot gnu dot org>
+List-Help: <mailto:gcc-patches-help at gcc dot gnu dot org>
+Sender: gcc-patches-owner at gcc dot gnu dot org
+Date: Tue, 16 Nov 2004 16:14:57 -0800
+From: "H dot J dot Lu" <hjl at lucon dot org>
+To: gcc-patches at gcc dot gnu dot org
+Subject: PATCH: PR other/18508: "basename: too few arguments" when building without bootstrap
+Message-ID: <20041117001457.GA13610@lucon.org>
+
+I think it is safe to use `.backup' to backup the existing shared
+library. No processes should be using the old shared library when
+we get there.
+
+
+H.J.
+---
+2004-11-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR other/18508
+ * config/alpha/t-osf4 (SHLIB_LINK): Use `.backup' as the suffix
+ to back up the existing shared library.
+ * config/arm/t-netbsd (SHLIB_LINK): Likewise.
+ * config/i386/t-nwld (SHLIB_LINK): Likewise. [deleted]
+ * config/mips/t-slibgcc-irix (SHLIB_LINK): Likewise. [deleted]
+ * config/pa/t-hpux-shlib (SHLIB_LINK): Likewise.
+ * config/sh/t-linux (SHLIB_LINK): Likewise.
+ * config/t-libunwind-elf (SHLIBUNWIND_LINK): Likewise.
+ * config/t-slibgcc-darwin (SHLIB_LINK): Likewise.
+ * config/t-slibgcc-elf-ver (SHLIB_LINK): Likewise.
+ * config/t-slibgcc-sld (SHLIB_LINK): Likewise.
+
+[ paths adjusted for patch -p1, rediffed agaainst gcc-3.4.3.
+ Looks like the t-iris5-6 hunk in cvs is missing here; this must
+ have been the mainline patch. ]
+
+--- gcc-3.4.3/gcc/config/alpha/t-osf4.stage 2004-10-18 09:14:39.000000000 -0700
++++ gcc-3.4.3/gcc/config/alpha/t-osf4 2004-11-16 16:06:41.686905479 -0800
+@@ -19,7 +19,7 @@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2
+ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SONAME) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
+--- gcc-3.4.3/gcc/config/arm/t-netbsd.stage 2004-10-18 09:14:40.000000000 -0700
++++ gcc-3.4.3/gcc/config/arm/t-netbsd 2004-11-16 16:06:46.016348194 -0800
+@@ -14,7 +14,7 @@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2
+ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SONAME) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
+--- gcc-3.4.3/gcc/config/pa/t-hpux-shlib.stage 2004-10-18 09:14:46.000000000 -0700
++++ gcc-3.4.3/gcc/config/pa/t-hpux-shlib 2004-11-16 16:06:57.982807875 -0800
+@@ -8,7 +8,7 @@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2
+ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SONAME) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
+--- gcc-3.4.3/gcc/config/sh/t-linux.stage 2004-10-18 09:14:48.000000000 -0700
++++ gcc-3.4.3/gcc/config/sh/t-linux 2004-11-16 16:07:00.787446863 -0800
+@@ -24,7 +24,7 @@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2
+ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ (echo "/* GNU ld script"; \
+--- gcc-3.4.3/gcc/config/t-libunwind-elf.stage 2004-10-18 09:14:39.000000000 -0700
++++ gcc-3.4.3/gcc/config/t-libunwind-elf 2004-11-16 16:07:08.133501281 -0800
+@@ -14,8 +14,7 @@ SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(L
+ @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SOLINK) && \
+ if [ -f $(SHLIBUNWIND_NAME) ]; then \
+- mv -f $(SHLIBUNWIND_NAME) \
+- $(SHLIBUNWIND_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIBUNWIND_NAME) $(SHLIBUNWIND_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIBUNWIND_NAME).tmp $(SHLIBUNWIND_NAME) && \
+ $(LN_S) $(SHLIBUNWIND_NAME) $(SHLIB_SOLINK)
+--- gcc-3.4.3/gcc/config/t-slibgcc-darwin.stage 2004-10-18 09:14:39.000000000 -0700
++++ gcc-3.4.3/gcc/config/t-slibgcc-darwin 2004-11-16 16:07:13.777774752 -0800
+@@ -17,7 +17,7 @@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2
+ @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
+--- gcc-3.4.3/gcc/config/t-slibgcc-elf-ver.stage 2004-10-18 09:14:39.000000000 -0700
++++ gcc-3.4.3/gcc/config/t-slibgcc-elf-ver 2004-11-16 16:04:40.961445223 -0800
+@@ -17,7 +17,7 @@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2
+ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
+--- gcc-3.4.3/gcc/config/t-slibgcc-sld.old 2004-10-18 09:00:47.000000000 -0700
++++ gcc-3.4.3/gcc/config/t-slibgcc-sld 2005-05-14 13:44:48.000000000 -0700
+@@ -14,7 +14,7 @@
+ @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)