diff -Nuar binutils-2.11.93.0.2.orig/gas/Makefile.in binutils-2.11.93.0.2/gas/Makefile.in
--- binutils-2.11.93.0.2.orig/gas/Makefile.in	Sun Feb  3 22:22:31 2002
+++ binutils-2.11.93.0.2/gas/Makefile.in	Thu Jan  9 13:08:35 2003
@@ -576,7 +576,7 @@
 # Both . and srcdir are used, in that order,
 # so that tm.h and config.h will be found in the compilation
 # subdirectory rather than in the source directory.
-INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(prefix)/share/locale\""
+INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(prefix)/share/locale\"" -DCROSS_COMPILE="\"$(CROSS_COMPILE)\""
 
 # This should be parallel to INCLUDES, but should replace $(srcdir)
 # with $${srcdir}, and should work in a subdirectory.  This is used
diff -Nuar binutils-2.11.93.0.2.orig/gas/config/tc-arm.c binutils-2.11.93.0.2/gas/config/tc-arm.c
--- binutils-2.11.93.0.2.orig/gas/config/tc-arm.c	Sun Feb  3 22:22:31 2002
+++ binutils-2.11.93.0.2/gas/config/tc-arm.c	Thu Jan  9 13:08:35 2003
@@ -9209,6 +9209,9 @@
 	mfpu_opt = march_fpu_opt;
     }
 
+  if (mcpu_cpu_opt == -1)
+    set_default_cpu();
+
   if (mfpu_opt == -1)
     {
       if (mcpu_cpu_opt == -1)
@@ -10483,6 +10486,47 @@
   as_bad (_("bad instruction `%s'"), start);
 }
 
+/* set_default_cpu
+      If the CROSS_COMPILE macro is defined
+      set cpu-dependent flags. They will be overridden by command-line
+      flags */
+void
+set_default_cpu ()
+{
+#ifdef CROSS_COMPILE
+  char * family_cpu = strdup(CROSS_COMPILE);
+  int    i;
+  char * cpu;
+  char * p;
+  int    len;
+  
+  struct target_cpu {
+    char *	target_arch;
+    int		cpu;
+  } target_cpu_tbl[] = {
+    {"920TDI", ARM_ARCH_V4T}
+  };
+
+  p = basename(family_cpu);
+  len = strlen(p);
+  if (*(p + len - 1) == '-')
+    *(p + len - 1) = '\0';
+
+  if (!strncasecmp(family_cpu, "arm_", 4))
+    {
+      cpu = family_cpu + 4;
+      for (i = 0; i < sizeof(target_cpu_tbl)/sizeof(target_cpu_tbl[0]); i++)
+        {
+          if (!strcmp(target_cpu_tbl[i].target_arch, cpu))
+            {
+              mcpu_cpu_opt = target_cpu_tbl[i].cpu;
+              break;
+            }
+        }
+    }
+#endif
+}
+
 /* md_parse_option
       Invocation line includes a switch not recognized by the base assembler.
       See if it's a processor-specific option.  
diff -Nuar binutils-2.11.93.0.2.orig/gas/config/tc-mips.c binutils-2.11.93.0.2/gas/config/tc-mips.c
--- binutils-2.11.93.0.2.orig/gas/config/tc-mips.c	Sun Feb  3 22:22:31 2002
+++ binutils-2.11.93.0.2/gas/config/tc-mips.c	Thu Jan  9 13:26:33 2003
@@ -9738,6 +9738,43 @@
 };
 size_t md_longopts_size = sizeof (md_longopts);
 
+/* set_default_cpu
+	If the CROSS_COMPILE macro is defined
+	set cpu-dependent flags. They will be overridden by command-line
+	flags */
+
+void
+set_default_cpu (int argc, char **argv) 
+{
+#ifdef CROSS_COMPILE
+  char * family_cpu = strdup(CROSS_COMPILE); 
+  int    i;
+  char * cpu;
+  char * p;
+  int    len;
+
+  struct target_cpu {
+    char * target_arch;
+    int    cpu;
+  } target_cpu_tbl[] = {
+    {"4KC",   CPU_MIPS32 }
+  };
+
+  if (!strncasecmp(family_cpu, "mips_", 5))
+    {
+      cpu = family_cpu + 5;
+	  for (i = 0; i < sizeof(target_cpu_tbl)/sizeof(target_cpu_tbl[0]); i++)
+        {
+          if (!strcmp(target_cpu_tbl[i].target_arch, cpu))
+            {
+              mips_cpu = target_cpu_tbl[i].cpu; mips_arch=mips_cpu;
+              break;
+            }
+        }
+    }
+#endif
+}
+
 int
 md_parse_option (c, arg)
      int c;
@@ -13168,6 +13205,7 @@
   { "mipsisa32",      0,      ISA_MIPS32,     CPU_MIPS32, },
   { "Generic-MIPS32", 0,      ISA_MIPS32,     CPU_MIPS32, },
   { "4kc",            0,      ISA_MIPS32,     CPU_MIPS32, },
+  { "r4kc",           0,      ISA_MIPS32,     CPU_MIPS32, },
   { "4km",            0,      ISA_MIPS32,     CPU_MIPS32, },
   { "4kp",            0,      ISA_MIPS32,     CPU_MIPS32, },
 
diff -Nuar binutils-2.11.93.0.2.orig/gas/config/tc-mips.h binutils-2.11.93.0.2/gas/config/tc-mips.h
--- binutils-2.11.93.0.2.orig/gas/config/tc-mips.h	Sun Feb  3 22:22:31 2002
+++ binutils-2.11.93.0.2/gas/config/tc-mips.h	Thu Jan  9 13:37:22 2003
@@ -55,6 +55,12 @@
 #define md_undefined_symbol(name)	(0)
 #define md_operand(x)
 
+#ifdef CROSS_COMPILE
+#define HOST_SPECIAL_INIT set_default_cpu
+#endif
+
+void set_default_cpu PARAMS ((int, char **));
+
 extern void mips_handle_align PARAMS ((struct frag *));
 #define HANDLE_ALIGN(fragp)  mips_handle_align (fragp)
 
diff -Nuar binutils-2.11.93.0.2.orig/gas/config/tc-ppc.c binutils-2.11.93.0.2/gas/config/tc-ppc.c
--- binutils-2.11.93.0.2.orig/gas/config/tc-ppc.c	Sun Feb  3 22:22:31 2002
+++ binutils-2.11.93.0.2/gas/config/tc-ppc.c	Thu Jan  9 13:08:35 2003
@@ -800,6 +800,54 @@
 #else
 const char *const md_shortopts = "um:";
 #endif
+
+/* set_default_cpu
+   If the CROSS_COMPILE macro is defined
+   set cpu-dependent flags. They will be overridden by command-line
+   flags */
+void
+set_default_cpu (int argc, char **argv)
+{
+#ifdef CROSS_COMPILE
+  char * family_cpu = strdup(CROSS_COMPILE);
+  int    i;
+  char * cpu;
+  char * p;
+  int    len;
+
+  struct target_cpu {
+    char * target_arch;
+    int    flags;
+  } target_cpu_tbl[] = {
+    {"4xx",   PPC_OPCODE_PPC },
+    {"4xxFP", PPC_OPCODE_PPC },
+    {"74xx",  PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC},
+    {"7xx",   PPC_OPCODE_PPC },
+    {"82xx",  PPC_OPCODE_PPC },
+    {"8xx",   PPC_OPCODE_PPC }
+  };
+
+
+  p = basename(family_cpu);
+  len = strlen(p);
+  if (*(p + len - 1) == '-')
+    *(p + len - 1) = '\0';
+
+  if (!strncasecmp(family_cpu, "ppc_", 4))
+    {
+      cpu = family_cpu + 4;
+      for (i = 0; i < sizeof(target_cpu_tbl)/sizeof(target_cpu_tbl[0]); i++)
+        {
+          if (!strcmp(target_cpu_tbl[i].target_arch, cpu))
+            {
+              ppc_cpu = target_cpu_tbl[i].flags;
+              break;
+            }
+        }
+    }
+  free(family_cpu);
+#endif
+}
 const struct option md_longopts[] = {
   {NULL, no_argument, NULL, 0}
 };
diff -Nuar binutils-2.11.93.0.2.orig/gas/config/tc-ppc.h binutils-2.11.93.0.2/gas/config/tc-ppc.h
--- binutils-2.11.93.0.2.orig/gas/config/tc-ppc.h	Sat Nov 17 01:05:52 2001
+++ binutils-2.11.93.0.2/gas/config/tc-ppc.h	Thu Jan  9 13:08:35 2003
@@ -297,3 +297,9 @@
 extern int ppc_parse_name PARAMS ((const char *, struct expressionS *));
 
 #define md_operand(x)
+
+#ifdef CROSS_COMPILE
+#define HOST_SPECIAL_INIT set_default_cpu
+#endif
+
+void set_default_cpu PARAMS ((int, char **));
