diff -Naur binutils-2.13.90.0.18.orig/gas/Makefile.in binutils-2.13.90.0.18/gas/Makefile.in
--- binutils-2.13.90.0.18.orig/gas/Makefile.in	Wed Jul 16 12:18:45 2003
+++ binutils-2.13.90.0.18/gas/Makefile.in	Wed Jul 16 12:28:59 2003
@@ -594,7 +594,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 -Naur binutils-2.13.90.0.18.orig/gas/config/tc-arm.c binutils-2.13.90.0.18/gas/config/tc-arm.c
--- binutils-2.13.90.0.18.orig/gas/config/tc-arm.c	Wed Jul 16 12:18:45 2003
+++ binutils-2.13.90.0.18/gas/config/tc-arm.c	Wed Jul 16 12:32:07 2003
@@ -9247,6 +9247,10 @@
       else
 	mfpu_opt = march_fpu_opt;
     }
+  if (mcpu_cpu_opt == -1)
+    {
+      set_default_cpu();
+    }
 
   if (mfpu_opt == -1)
     {
@@ -10516,6 +10520,47 @@
     return;
 
   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
diff -Naur binutils-2.13.90.0.18.orig/gas/config/tc-mips.c binutils-2.13.90.0.18/gas/config/tc-mips.c
--- binutils-2.13.90.0.18.orig/gas/config/tc-mips.c	Wed Jul 16 12:18:46 2003
+++ binutils-2.13.90.0.18/gas/config/tc-mips.c	Wed Jul 16 12:46:27 2003
@@ -10722,8 +10722,14 @@
     }
 
   if (mips_arch_info == 0)
-    mips_set_architecture (mips_parse_cpu ("default CPU",
-					   MIPS_CPU_STRING_DEFAULT));
+    {
+      set_default_cpu();
+      if (mips_arch_info == 0)
+        {
+          mips_set_architecture (mips_parse_cpu ("default CPU",
+                                           MIPS_CPU_STRING_DEFAULT));
+        }
+     }
 
   if (ABI_NEEDS_64BIT_REGS (mips_abi) && !ISA_HAS_64BIT_REGS (mips_opts.isa))
     as_bad ("-march=%s is not compatible with the selected ABI",
@@ -14311,6 +14317,7 @@
 
   /* MIPS 32 */
   { "4kc",            0,      ISA_MIPS32,     CPU_MIPS32, },
+  { "r4kc",           0,      ISA_MIPS32,     CPU_MIPS32 },
   { "4km",            0,      ISA_MIPS32,     CPU_MIPS32 },
   { "4kp",            0,      ISA_MIPS32,     CPU_MIPS32 },
 
@@ -14444,6 +14451,51 @@
 
   return NULL;
 }
+
+/* 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;
+
+  struct target_cpu {
+    char * target_arch; /* name we use in the CROSS_COMPILE variable */
+    char *name;         /* name registered in mips_cpu_info_table */
+  } target_cpu_tbl[] = {
+    {"4KC",   "4kc"}
+  };
+
+  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))
+            {
+              char *name = target_cpu_tbl[i].name;
+              struct mips_cpu_info *p;
+              for (p = mips_cpu_info_table; p->name != 0; p++)
+                {
+                  if (mips_matching_cpu_name_p (p->name, name))
+                    {
+                       mips_set_architecture(p);
+                       break;
+                     }
+                 }
+              break;
+            }
+        }
+    }
+#endif
+}
+
 
 static void
 show (stream, string, col_p, first_p)
diff -Naur binutils-2.13.90.0.18.orig/gas/config/tc-ppc.c binutils-2.13.90.0.18/gas/config/tc-ppc.c
--- binutils-2.13.90.0.18.orig/gas/config/tc-ppc.c	Wed Jul 16 12:18:46 2003
+++ binutils-2.13.90.0.18/gas/config/tc-ppc.c	Wed Jul 16 12:52:56 2003
@@ -1096,6 +1096,56 @@
 -Qy, -Qn		ignored\n"));
 #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
+}
+
 
 /* Set ppc_cpu if it is not already set.  */
 
@@ -1135,6 +1185,9 @@
 ppc_arch ()
 {
   const char *default_cpu = TARGET_CPU;
+
+  set_default_cpu();
+
   ppc_set_cpu ();
 
   if ((ppc_cpu & PPC_OPCODE_PPC) != 0)
