Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi	(revision 178754)
+++ gcc/doc/install.texi	(working copy)
@@ -1068,6 +1068,24 @@
 --with-multilib-list=sh4al,!mb/m4al
 @end smallexample
 
+@item --with-extra-multilibs=@var{list} @itemx 
+--without-extra-multilibs Specify what extra multilibs to build besides 
+the default library set.
+Currently only implemented for arm*-*-eabi.
+
+@var{list} is a comma separated list of ARM architecture names.
+Currently the available names are thumb1, thumb2, armv6s-m, armv7-m and 
+armv7e-m.
+
+If @option{--with-extra-multilibs} or @var{list} is not given, then no 
+extra multilibs will be built.
+
+Example: to configure a compiler for arm-none-eabi with additional 
+multilib support for thumb1, thumb2 and armv6s-m:
+@smallexample
+--target=arm-none-eabi --with-extra-multilibs=thumb1,thumb2,armv6s-m
+@end smallexample
+
 @item --with-endian=@var{endians}
 Specify what endians to use.
 Currently only implemented for sh*-*-*.
Index: gcc/configure
===================================================================
--- gcc/configure	(revision 178754)
+++ gcc/configure	(working copy)
@@ -1650,6 +1650,7 @@
   --with-pkgversion=PKG   Use PKG in the version string in place of "GCC"
   --with-bugurl=URL       Direct users to URL to report a bug
   --with-multilib-list    Select multilibs (SH only)
+  --with-extra-multilibs  Select extra multilibs (ARM only)
   --with-gnu-ld           assume the C compiler uses GNU ld default=no
   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and
DIR/lib
   --without-libiconv-prefix     don't search for libiconv in includedir and
libdir
@@ -7198,6 +7199,12 @@
   with_multilib_list=default
 fi
 
+# Check whether --with-extra-multilibs was given.
+if test "${with_extra_multilibs+set}" = set; then :
+  withval=$with_extra_multilibs; :
+else
+  with_extra_multilibs=default
+fi
 
 # -------------------------
 # Checks for other programs
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 178754)
+++ gcc/configure.ac	(working copy)
@@ -790,6 +790,11 @@
 :,
 with_multilib_list=default)
 
+AC_ARG_WITH(extra-multilibs,
+[  --with-extra-multilibs    Select extra multilibs (ARM only)],
+:,
+with_extra_multilibs=default)
+
 # -------------------------
 # Checks for other programs
 # -------------------------
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 178754)
+++ gcc/config.gcc	(working copy)
@@ -883,6 +883,32 @@
 	arm*-*-eabi*)
 	  tm_file="$tm_file newlib-stdint.h"
 	  tmake_file="${tmake_file} arm/t-bpabi"
+	  arm_multilibs="${with_extra_multilibs}"
+	  if test $arm_multilibs != "default"; then
+		arm_multilibs=`echo $arm_multilibs | sed -e 's/,/ /g'`
+		for arm_multilib in ${arm_multilibs}; do
+		    case ${arm_multilib} in
+		    thumb1)
+			tmake_file="${tmake_file} arm/t-thumb1"
+			;;
+		    thumb2)
+			tmake_file="${tmake_file} arm/t-thumb2"
+			;;
+		    armv6s-m)
+			tmake_file="${tmake_file} arm/t-armv6s-m"
+			;;
+		    armv7-m)
+			tmake_file="${tmake_file} arm/t-armv7-m"
+			;;
+		    armv7e-m)
+			tmake_file="${tmake_file} arm/t-armv7e-m"
+			;;
+		    *)
+			echo "--with-extra-multilibs=${arm_multilib} not
supported."
+			exit 1
+		    esac
+		done
+	  fi
 	  use_gcc_stdint=wrap
 	  ;;
 	arm*-*-symbianelf*)
Index: gcc/config/arm/t-arm-elf
===================================================================
--- gcc/config/arm/t-arm-elf	(revision 178754)
+++ gcc/config/arm/t-arm-elf	(working copy)
@@ -35,6 +35,7 @@
 MULTILIB_DIRNAMES    = arm thumb
 MULTILIB_EXCEPTIONS  = 
 MULTILIB_MATCHES     =
+MULTILIB_OSDIRNAMES  = marm=!arm mthumb=!thumb
 
 #MULTILIB_OPTIONS     +=
mcpu=fa526/mcpu=fa626/mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te
 #MULTILIB_DIRNAMES    += fa526 fa626 fa606te fa626te fmp626 fa726te
@@ -56,6 +57,7 @@
 MULTILIB_OPTIONS       += mfloat-abi=hard
 MULTILIB_DIRNAMES      += fpu
 MULTILIB_EXCEPTIONS    += *mthumb/*mfloat-abi=hard*
+MULTILIB_OSDIRNAMES    += mfloat-abi.hard=!fpu
marm/mfloat-abi.hard=!arm/fpu
 #MULTILIB_EXCEPTIONS    += *mcpu=fa526/*mfloat-abi=hard*
 #MULTILIB_EXCEPTIONS    += *mcpu=fa626/*mfloat-abi=hard*
Index: gcc/config/arm/t-armv7e-m
===================================================================
--- gcc/config/arm/t-armv7e-m	(revision 0)
+++ gcc/config/arm/t-armv7e-m	(revision 0)
@@ -0,0 +1,16 @@
+#Build below library for ARM armv7e-m architecture.
+#  armv7e-m/     -mthumb -march=armv7e-m
+
+MULTILIB_OPTIONS      += march=armv7e-m
+
+MULTILIB_DIRNAMES     += armv7e-m
+
+MULTILIB_EXCEPTIONS   += march=armv7e-m*
+MULTILIB_EXCEPTIONS   += marm*/march=armv7e-m*
+MULTILIB_EXCEPTIONS   += mfloat-abi=hard/march=armv7e-m*
+MULTILIB_EXCEPTIONS   += mthumb/mfloat-abi=hard/march=armv7e-m*
+MULTILIB_EXCEPTIONS   += m*/march=armv7e-m/march*
+
+MULTILIB_MATCHES      += march?armv7e-m=mcpu?cortex-m4
+
+MULTILIB_OSDIRNAMES   += mthumb/march.armv7e-m=!armv7e-m
Index: gcc/config/arm/t-thumb1
===================================================================
--- gcc/config/arm/t-thumb1	(revision 0)
+++ gcc/config/arm/t-thumb1	(revision 0)
@@ -0,0 +1,56 @@
+#Build below library for ARM Thumb-1.
+#  thumb1/      -mthumb -march=armv4t
+
+MULTILIB_OPTIONS      += march=armv4t
+
+MULTILIB_DIRNAMES     += thumb1
+
+MULTILIB_EXCEPTIONS   += march=armv4t*
+MULTILIB_EXCEPTIONS   += marm*/march=armv4t*
+MULTILIB_EXCEPTIONS   += mfloat-abi=hard/march=armv4t*
+MULTILIB_EXCEPTIONS   += mthumb/mfloat-abi=hard/march=armv4t*
+MULTILIB_EXCEPTIONS   += m*/march=armv4t/march*
+
+MULTILIB_MATCHES      += march?armv4t=march?armv5
+MULTILIB_MATCHES      += march?armv4t=march?armv5t
+MULTILIB_MATCHES      += march?armv4t=march?armv5e
+MULTILIB_MATCHES      += march?armv4t=march?armv5te
+MULTILIB_MATCHES      += march?armv4t=march?armv6
+MULTILIB_MATCHES      += march?armv4t=march?armv6j
+MULTILIB_MATCHES      += march?armv4t=march?armv6z
+MULTILIB_MATCHES      += march?armv4t=march?armv6zk
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm7tdmi
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm7tdmi-s
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm710t
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm720t
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm740t
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm9
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm9tdmi
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm920
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm920t
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm922t
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm940t
+MULTILIB_MATCHES      += march?armv4t=mcpu?ep9312
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm10tdmi
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm1020t
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm9e
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm946e-s
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm966e-s
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm968e-s
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm10e
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm1020e
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm1022e
+MULTILIB_MATCHES      += march?armv4t=mcpu?xscale
+MULTILIB_MATCHES      += march?armv4t=mcpu?iwmmxt
+MULTILIB_MATCHES      += march?armv4t=mcpu?iwmmxt2
+MULTILIB_MATCHES      += march?armv4t=mcpu?fa606te
+MULTILIB_MATCHES      += march?armv4t=mcpu?fa626te
+MULTILIB_MATCHES      += march?armv4t=mcpu?fmp626
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm926ej-s
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm1026ej-s
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm1136j-s
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm1136jf-s
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm1176jz-s
+MULTILIB_MATCHES      += march?armv4t=mcpu?arm1176jzf-s
+
+MULTILIB_OSDIRNAMES   += mthumb/march.armv4t=!thumb1
Index: gcc/config/arm/t-thumb2
===================================================================
--- gcc/config/arm/t-thumb2	(revision 0)
+++ gcc/config/arm/t-thumb2	(revision 0)
@@ -0,0 +1,25 @@
+#Build below library for ARM Thumb-2.
+#  thumb2/      -mthumb -march=armv6t2
+
+MULTILIB_OPTIONS      += march=armv6t2
+
+MULTILIB_DIRNAMES     += thumb2
+
+MULTILIB_EXCEPTIONS   += march=armv6t2*
+MULTILIB_EXCEPTIONS   += marm*/march=armv6t2*
+MULTILIB_EXCEPTIONS   += mfloat-abi=hard/march=armv6t2*
+MULTILIB_EXCEPTIONS   += mthumb/mfloat-abi=hard/march=armv6t2*
+MULTILIB_EXCEPTIONS   += m*/march=armv6t2/march*
+
+MULTILIB_MATCHES      += march?armv6t2=march?armv7
+MULTILIB_MATCHES      += march?armv6t2=march?armv7-a
+MULTILIB_MATCHES      += march?armv6t2=march?armv7-r
+MULTILIB_MATCHES      += march?armv6t2=mcpu?arm1156t2-s
+MULTILIB_MATCHES      += march?armv6t2=mcpu?arm1156t2f-s
+MULTILIB_MATCHES      += march?armv6t2=mcpu?cortex-a5
+MULTILIB_MATCHES      += march?armv6t2=mcpu?cortex-a8
+MULTILIB_MATCHES      += march?armv6t2=mcpu?cortex-a9
+MULTILIB_MATCHES      += march?armv6t2=mcpu?cortex-r4
+MULTILIB_MATCHES      += march?armv6t2=mcpu?cortex-r4f
+
+MULTILIB_OSDIRNAMES   += mthumb/march.armv6t2=!thumb2
Index: gcc/config/arm/t-armv7-m
===================================================================
--- gcc/config/arm/t-armv7-m	(revision 0)
+++ gcc/config/arm/t-armv7-m	(revision 0)
@@ -0,0 +1,16 @@
+#Build below library for ARM armv7-m architecture.
+#  armv7-m/     -mthumb -march=armv7-m
+
+MULTILIB_OPTIONS      += march=armv7-m
+
+MULTILIB_DIRNAMES     += armv7-m
+
+MULTILIB_EXCEPTIONS   += march=armv7-m*
+MULTILIB_EXCEPTIONS   += marm*/march=armv7-m*
+MULTILIB_EXCEPTIONS   += mfloat-abi=hard/march=armv7-m*
+MULTILIB_EXCEPTIONS   += mthumb/mfloat-abi=hard/march=armv7-m*
+MULTILIB_EXCEPTIONS   += m*/march=armv7-m/march*
+
+MULTILIB_MATCHES      += march?armv7-m=mcpu?cortex-m3
+
+MULTILIB_OSDIRNAMES   += mthumb/march.armv7-m=!armv7-m
Index: gcc/config/arm/t-armv6s-m
===================================================================
--- gcc/config/arm/t-armv6s-m	(revision 0)
+++ gcc/config/arm/t-armv6s-m	(revision 0)
@@ -0,0 +1,18 @@
+#Build below library for ARM armv6s-m architecture.
+#  armv6s-m/    -mthumb -march=armv6s-m
+
+MULTILIB_OPTIONS      += march=armv6s-m
+
+MULTILIB_DIRNAMES     += armv6s-m
+
+MULTILIB_EXCEPTIONS   += march=armv6s-m*
+MULTILIB_EXCEPTIONS   += marm*/march=armv6s-m*
+MULTILIB_EXCEPTIONS   += mfloat-abi=hard/march=armv6s-m*
+MULTILIB_EXCEPTIONS   += mthumb/mfloat-abi=hard/march=armv6s-m*
+MULTILIB_EXCEPTIONS   += m*/march=armv6s-m/march*
+
+MULTILIB_MATCHES      += march?armv6s-m=march?armv6-m
+MULTILIB_MATCHES      += march?armv6s-m=mcpu?cortex-m1
+MULTILIB_MATCHES      += march?armv6s-m=mcpu?cortex-m0
+
+MULTILIB_OSDIRNAMES   += mthumb/march.armv6s-m=!armv6s-m
