diff -ru tmp/gdb-6.3/gdb/config/sparc/sparc.mt gdb-6.3/gdb/config/sparc/sparc.mt
--- tmp/gdb-6.3/gdb/config/sparc/sparc.mt	2004-01-03 11:08:45.000000000 +0100
+++ gdb-6.3/gdb/config/sparc/sparc.mt	2005-12-06 20:51:48.000000000 +0100
@@ -1,2 +1,5 @@
 # Target: SPARC
 TDEPFILES= sparc-tdep.o
+
+SIM_OBS = remote-sim.o
+SIM = ../sim/erc32/libsim.a
diff -ru tmp/gdb-6.3/gdb/configure.tgt gdb-6.3/gdb/configure.tgt
--- tmp/gdb-6.3/gdb/configure.tgt	2004-10-01 09:29:34.000000000 +0200
+++ gdb-6.3/gdb/configure.tgt	2005-12-06 20:51:48.000000000 +0100
@@ -57,6 +57,7 @@
 arm*-*-netbsd* | arm*-*-knetbsd*-gnu)
 			gdb_target=nbsd ;;
 arm-*-nto*)		gdb_target=nto ;;
+arm*-*-rtems* | thumb*-*-rtems* | strongarm*-*-rtems* | \
 arm*-*-* | thumb*-*-* | strongarm*-*-*)
 			gdb_target=embed
                         configdirs="$configdirs rdi-share"
@@ -65,13 +66,14 @@
                         configdirs="$configdirs rdi-share"
                         ;;
 
-avr-*-*)		gdb_target=avr ;;
+avr-*-* | avr-*-rtems*) gdb_target=avr ;;
 
 cris*)                  gdb_target=cris ;;
 
 d10v-*-*)		gdb_target=d10v ;;
 
-h8300-*-*)		gdb_target=h8300 ;;
+h8300-*-* | h8300-*-rtems*)
+			gdb_target=h8300 ;;
 
 
 frv-*-*)		gdb_target=frv ;;
@@ -98,6 +100,7 @@
 			configdirs="${configdirs} nlm" ;;
 i[34567]86-*-cygwin*)	gdb_target=cygwin  ;;
 i[34567]86-*-vxworks*)	gdb_target=vxworks ;;
+i[34567]86-*-rtems*)	gdb_target=i386 ;;
 i[34567]86-*-*)		gdb_target=i386 ;;
 
 ia64-*-aix*)		gdb_target=aix ;;
@@ -124,6 +127,7 @@
 			gdb_target=nbsd ;;
 m68*-*-openbsd*)	gdb_target=obsd ;;
 m68*-*-os68k*)		gdb_target=os68k ;;
+m68*-*-rtems*)		gdb_target=monitor ;;
 m68*-*-uclinux*)	gdb_target=monitor ;;
 m68*-*-vxworks*)	gdb_target=vxworks68 ;;
 
@@ -140,6 +144,7 @@
 mips*-*-netbsd* | mips*-*-knetbsd*-gnu)
 			gdb_target=nbsd ;;
 mips*-*-vxworks*)       gdb_target=vxmips ;;
+mips*-*-rtems*)		gdb_target=embed ;;
 mips*-*-*)		gdb_target=embed ;;
 
 mn10300-*-*)		gdb_target=mn10300 ;;
@@ -155,7 +160,8 @@
 			;;
 powerpc64-*-linux*)	gdb_target=linux ;;
 powerpc-*-vxworks*)	gdb_target=vxworks ;;
-powerpc*-*-*)		if test -f ../sim/ppc/Makefile; then
+powerpc*-*-* | powerpc*-*-rtems*)
+			if test -f ../sim/ppc/Makefile; then
 			  gdb_target=ppc-sim
 			else
 			  gdb_target=ppc-eabi
@@ -179,6 +185,7 @@
 sh*-*-netbsdelf* | sh*-*-knetbsd*-gnu)
 			gdb_target=nbsd ;;
 sh-*-nto*)		gdb_target=nto ;;
+sh*-*-rtems*)		gdb_target=embed ;;
 sh*)			gdb_target=embed ;;
 
 sparc-*-linux*)		gdb_target=linux ;;
@@ -196,6 +203,7 @@
 			gdb_target=sol2-64
 			;;
 sparc-*-vxworks*)	gdb_target=vxworks ;;
+sparc-*-rtems*)		gdb_target=sparc ;;
 sparc-*-*)		gdb_target=sparc ;;
 sparc64-*-*)		gdb_target=sparc64 ;;
 
diff -ru tmp/gdb-6.3/sim/common/Make-common.in gdb-6.3/sim/common/Make-common.in
--- tmp/gdb-6.3/sim/common/Make-common.in	2003-09-08 19:24:59.000000000 +0200
+++ gdb-6.3/sim/common/Make-common.in	2005-12-06 20:51:48.000000000 +0100
@@ -252,14 +252,14 @@
 callback_h = $(srcroot)/include/gdb/callback.h
 remote_sim_h = $(srcroot)/include/gdb/remote-sim.h
 
-all: $(SIM_EXTRA_ALL) libsim.a run .gdbinit
+all: $(SIM_EXTRA_ALL) libsim.a run$(EXEEXT) .gdbinit
 
 libsim.a: $(LIB_OBJS)
 	rm -f libsim.a
 	$(AR) $(AR_FLAGS) libsim.a $(LIB_OBJS)
 	$(RANLIB) libsim.a
 
-run: $(SIM_RUN_OBJS) libsim.a $(LIBDEPS)
+run$(EXEEXT): $(SIM_RUN_OBJS) libsim.a $(LIBDEPS)
 	$(CC) $(ALL_CFLAGS) -o run$(EXEEXT) \
 	  $(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS)
 
@@ -581,14 +581,14 @@
 
 install-common: installdirs
 	n=`echo run | sed '$(program_transform_name)'`; \
-	$(INSTALL_PROGRAM) run$(EXEEXT) $(bindir)/$$n$(EXEEXT)
+	$(INSTALL_PROGRAM) run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
 	n=`echo libsim.a | sed s/libsim.a/lib$(target_alias)-sim.a/`; \
-	$(INSTALL_DATA) libsim.a $(libdir)/$$n ; \
-	( cd $(libdir) ; $(RANLIB) $$n )
+	$(INSTALL_DATA) libsim.a $(DESTDIR)$(libdir)/$$n ; \
+	( cd $(DESTDIR)$(libdir) ; $(RANLIB) $$n )
 
 installdirs:
-	$(SHELL) $(srcdir)/../../mkinstalldirs $(bindir)
-	$(SHELL) $(srcdir)/../../mkinstalldirs $(libdir)
+	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir)
+	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir)
 
 check:
 	cd ../testsuite && $(MAKE) check RUNTESTFLAGS="$(RUNTESTFLAGS)"
@@ -611,7 +611,7 @@
 
 clean: $(SIM_EXTRA_CLEAN)
 	rm -f *.[oa] *~ core
-	rm -f run libsim.a
+	rm -f run$(EXEEXT) libsim.a
 	rm -f gentmap targ-map.c targ-vals.h stamp-tvals
 	if [ ! -f Make-common.in ] ; then \
 		rm -f $(BUILT_SRC_FROM_COMMON) ; \
diff -ru tmp/gdb-6.3/sim/configure gdb-6.3/sim/configure
--- tmp/gdb-6.3/sim/configure	2004-01-26 09:12:43.000000000 +0100
+++ gdb-6.3/sim/configure	2005-12-06 20:51:48.000000000 +0100
@@ -1458,7 +1458,8 @@
 	extra_subdirs="${extra_subdirs} testsuite"
 	;;
   powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | \
-  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* )
+  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* | \
+  powerpc*-*-rtems*)
 	# The PowerPC simulator uses the GCC extension long long as well as
 	# ANSI prototypes, so don't enable it for random host compilers
 	# unless asked to.
diff -ru tmp/gdb-6.3/sim/configure.in gdb-6.3/sim/configure.in
--- tmp/gdb-6.3/sim/configure.in	2004-01-26 09:12:43.000000000 +0100
+++ gdb-6.3/sim/configure.in	2005-12-06 20:51:48.000000000 +0100
@@ -97,7 +97,8 @@
 	extra_subdirs="${extra_subdirs} testsuite"
 	;;
   powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | \
-  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* )
+  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* | \
+  powerpc*-*-rtems*)
 	# The PowerPC simulator uses the GCC extension long long as well as
 	# ANSI prototypes, so don't enable it for random host compilers
 	# unless asked to.
diff -ru tmp/gdb-6.3/sim/erc32/configure.in gdb-6.3/sim/erc32/configure.in
--- tmp/gdb-6.3/sim/erc32/configure.in	1999-04-26 20:31:58.000000000 +0200
+++ gdb-6.3/sim/erc32/configure.in	2005-12-06 20:51:48.000000000 +0100
@@ -21,4 +21,7 @@
 fi
 AC_SUBST(TERMCAP)
 
+dnl Check for exe extension
+AC_EXEEXT
+
 SIM_AC_OUTPUT
diff -ru tmp/gdb-6.3/sim/erc32/exec.c gdb-6.3/sim/erc32/exec.c
--- tmp/gdb-6.3/sim/erc32/exec.c	1999-04-16 03:35:00.000000000 +0200
+++ gdb-6.3/sim/erc32/exec.c	2005-12-06 21:14:11.000000000 +0100
@@ -1713,6 +1713,7 @@
     	    sregs->fdp[rs2 | 1] = sregs->fs[rs2 & ~1];
     	    sregs->fdp[rs2 & ~1] = sregs->fs[rs2 | 1];
     default:
+      ;
     }
 #endif
 
@@ -1885,6 +1886,7 @@
 	sregs->fs[rd & ~1] = sregs->fdp[rd | 1];
 	sregs->fs[rd | 1] = sregs->fdp[rd & ~1];
     default:
+      ;
     }
 #endif
     if (sregs->fpstate == FP_EXC_PE) {
Only in gdb-6.3/sim/erc32: exec.c.~1~
diff -ru tmp/gdb-6.3/sim/erc32/float.c gdb-6.3/sim/erc32/float.c
--- tmp/gdb-6.3/sim/erc32/float.c	1999-04-16 03:35:00.000000000 +0200
+++ gdb-6.3/sim/erc32/float.c	2005-12-06 21:19:22.000000000 +0100
@@ -67,11 +67,7 @@
 #ifdef sparc
     set_fsr((_get_fsr_raw() & ~0x3e0));
 #elif i386
-    asm("
-.text
-	fnclex
-
-    ");
+    asm("\n.text\n\tfnclex\t\n");
 #else
 #warning no fpu trap support for this target
 #endif
@@ -137,35 +133,35 @@
 
 #elif i386
 
-    asm("
-
-.text
-        .align 8
-.globl _get_sw,__get_sw
-__get_sw:
-_get_sw:
-        pushl %ebp
-        movl %esp,%ebp
-        movl $0,%eax
-        fnstsw %ax
-        movl %ebp,%esp
-        popl %ebp
-        ret
-
-        .align 8
-.globl _get_cw,__get_cw
-__get_cw:
-_get_cw:
-        pushl %ebp
-        movl %esp,%ebp
-        subw $2,%esp
-        fnstcw -2(%ebp)
-        movw -2(%ebp),%eax
-        movl %ebp,%esp
-        popl %ebp
-        ret
-
-
+    asm("\n\
+\n\
+.text\n\
+        .align 8\n\
+.globl _get_sw,__get_sw\n\
+__get_sw:\n\
+_get_sw:\n\
+        pushl %ebp\n\
+        movl %esp,%ebp\n\
+        movl $0,%eax\n\
+        fnstsw %ax\n\
+        movl %ebp,%esp\n\
+        popl %ebp\n\
+        ret\n\
+\n\
+        .align 8\n\
+.globl _get_cw,__get_cw\n\
+__get_cw:\n\
+_get_cw:\n\
+        pushl %ebp\n\
+        movl %esp,%ebp\n\
+        subw $2,%esp\n\
+        fnstcw -2(%ebp)\n\
+        movw -2(%ebp),%eax\n\
+        movl %ebp,%esp\n\
+        popl %ebp\n\
+        ret\n\
+\n\
+\n\
     ");
 
 
Only in gdb-6.3/sim/erc32: float.c.~1~
diff -ru tmp/gdb-6.3/sim/erc32/func.c gdb-6.3/sim/erc32/func.c
--- tmp/gdb-6.3/sim/erc32/func.c	2000-03-03 16:00:58.000000000 +0100
+++ gdb-6.3/sim/erc32/func.c	2005-12-06 20:51:48.000000000 +0100
@@ -827,6 +827,7 @@
     }
 }
 
+#if 0
 int
 buffer_read_memory(addr, buffer, size, info)
     bfd_vma         addr;
@@ -868,6 +869,7 @@
 {
   return 1;
 }
+#endif
 
 
 /* Add event to event queue */
diff -ru tmp/gdb-6.3/sim/erc32/interf.c gdb-6.3/sim/erc32/interf.c
--- tmp/gdb-6.3/sim/erc32/interf.c	2003-02-28 00:26:33.000000000 +0100
+++ gdb-6.3/sim/erc32/interf.c	2005-12-06 21:21:49.000000000 +0100
@@ -34,8 +34,10 @@
 #include "gdb/remote-sim.h"
 
 #ifndef fprintf
+#if 0
 extern          fprintf();
 #endif
+#endif
 
 #define PSR_CWP 0x7
 
Only in gdb-6.3/sim/erc32: interf.c.~1~
diff -ru tmp/gdb-6.3/sim/erc32/Makefile.in gdb-6.3/sim/erc32/Makefile.in
--- tmp/gdb-6.3/sim/erc32/Makefile.in	2000-03-07 16:32:49.000000000 +0100
+++ gdb-6.3/sim/erc32/Makefile.in	2005-12-07 20:35:21.000000000 +0100
@@ -24,7 +24,7 @@
 SIM_OBJS = exec.o erc32.o func.o help.o float.o interf.o
 SIM_EXTRA_LIBS = ../../readline/libreadline.a  $(TERMCAP_LIB) -lm
 SIM_EXTRA_LIBDEPS = ../../readline/libreadline.a
-SIM_EXTRA_ALL = sis
+SIM_EXTRA_ALL = sis$(EXEEXT)
 SIM_EXTRA_INSTALL = install-sis
 SIM_EXTRA_CLEAN = clean-sis
 
@@ -35,12 +35,14 @@
 
 ## COMMON_POST_CONFIG_FRAG
 
+EXEEXT = @EXEEXT@
+
 # `sis' doesn't need interf.o.
 SIS_OFILES = exec.o erc32.o func.o help.o float.o
 
-sis: sis.o $(SIS_OFILES) $(COMMON_OBJS) $(LIBDEPS)
-	$(CC) $(ALL_CFLAGS) -o sis \
-	  sis.o $(SIS_OFILES) $(COMMON_OBJS) $(EXTRA_LIBS)
+sis$(EXEEXT): sis.o $(SIS_OFILES) $(COMMON_OBJS) $(LIBDEPS)
+	$(CC) $(ALL_CFLAGS) -o sis$(EXEEXT) \
+	  sis.o $(SIS_OFILES) $(COMMON_OBJS) $(EXTRA_LIBS) -lncurses
 
 # FIXME: This computes the build host's endianness, doesn't it?
 # There is AC_C_BIGENDIAN but it doesn't handle float endianness.
@@ -53,10 +55,10 @@
 # Copy the files into directories where they will be run.
 install-sis: installdirs
 	n=`echo sis | sed '$(program_transform_name)'`; \
-	$(INSTALL_PROGRAM) sis$(EXEEXT) $(bindir)/$$n$(EXEEXT)
+	$(INSTALL_PROGRAM) sis$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
 
 clean-sis:
-	rm -f sis end end.h
+	rm -f sis$(EXEEXT) end end.h
 
 configure:
 	@echo "Rebuilding configure..."
Only in gdb-6.3/sim/erc32: Makefile.in.~1~
diff -ru tmp/gdb-6.3/sim/erc32/sis.c gdb-6.3/sim/erc32/sis.c
--- tmp/gdb-6.3/sim/erc32/sis.c	1999-04-16 03:35:00.000000000 +0200
+++ gdb-6.3/sim/erc32/sis.c	2005-12-06 21:11:35.000000000 +0100
@@ -34,8 +34,10 @@
 #include "sim-config.h"
 
 #ifndef fprintf
+#if 0
 extern          fprintf();
 #endif
+#endif
 
 #define	VAL(x)	strtol(x,(char **)NULL,0)
 
Only in gdb-6.3/sim/erc32: sis.c.~1~
diff -ru tmp/gdb-6.3/sim/Makefile.in gdb-6.3/sim/Makefile.in
--- tmp/gdb-6.3/sim/Makefile.in	2003-09-03 20:46:52.000000000 +0200
+++ gdb-6.3/sim/Makefile.in	2005-12-06 20:51:48.000000000 +0100
@@ -86,6 +86,7 @@
 	"prefix=$(prefix)" \
 	"exec_prefix=$(exec_prefix)" \
 	"bindir=$(bindir)" \
+	"libdir=$(libdir)" \
 	"mandir=$(mandir)" \
 	"against=$(against)" \
 	"AR=$(AR)" \
