diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a2016ed738e0151249e809e03ad82e7aa93ed8ca..11f9b280d6615ed55669d3c76123f03dcd0677dc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2009-09-13  Kai Tietz  <kai.tietz@onevision.com>
+
+	* config.gcc (tm_file): Remove i386/biarch32.h
+	for i?86-w64-mingw* case.
+	(i?86-*-mingw* andx86_64-*-mingw*): Add multilib
+	support.
+	* config.host: Set for cygwin and x86/x64 mingw the
+	option use_long_long_for_widest_fast_int to yes.
+
 2009-09-13  Eric Botcazou  <ebotcazou@adacore.com>
 
 	* tree.h (DECL_IGNORED_P): Document further effect for FUNCTION_DECL.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 0e3d52b5643fa769aa48e734c23b755a6258f028..00025638cebd068de20ae8f3561cc5b06e827b79 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -372,12 +372,6 @@ then
 	extra_options="${extra_options} ${cpu_type}/${cpu_type}.opt"
 fi
 
-case ${target} in
-i[34567]86-w64-*)
-	tm_file="i386/biarch32.h ${tm_file}"
-	;;
-esac
-
 case ${target} in
 i[34567]86-*-*)
 	if test "x$enable_cld" = xyes; then
@@ -1319,11 +1313,35 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*)
 i[34567]86-*-mingw* | x86_64-*-mingw*)
 	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/mingw32.h"
 	xm_file=i386/xm-mingw32.h
+	case ${target} in
+		x86_64-*-* | *-w64-*)
+			need_64bit_hwint=yes
+			;;
+		*)
+			;;
+	esac
 	# This makes the logic if mingw's or the w64 feature set has to be used
 	case ${target} in
 		*-w64-*)
 			tm_file="${tm_file} i386/mingw-w64.h"
 			tmake_file="${tmake_file} i386/t-mingw-w64"
+			if test x$enable_targets = xall; then
+				tm_defines="${tm_defines} TARGET_BI_ARCH=1"
+				case X"${with_cpu}" in
+				Xgeneric|Xatom|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx)
+					;;
+				X)
+					if test x$with_cpu_64 = x; then
+						with_cpu_64=generic
+					fi
+					;;
+				*)
+					echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
+					echo "generic atom core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx" 1>&2
+					exit 1
+					;;
+				esac
+			fi
 			;;
 		*)
 			tmake_file="${tmake_file} i386/t-mingw32"
diff --git a/gcc/config.host b/gcc/config.host
index a8ec32455aaf83e7654a6ef2949d3bab9231cb84..83c650937431f61d366723c3caf5ff952fe206c8 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -202,12 +202,14 @@ case ${host} in
     esac
     ;;
   i[34567]86-*-pe | i[34567]86-*-cygwin*)
+    use_long_long_for_widest_fast_int=yes
     host_xm_file=i386/xm-cygwin.h
     out_host_hook_obj=host-cygwin.o
     host_xmake_file="${host_xmake_file} i386/x-cygwin"
     host_exeext=.exe
     ;;
   i[34567]86-*-mingw32* | x86_64-*-mingw*)
+    use_long_long_for_widest_fast_int=yes
     host_xm_file=i386/xm-mingw32.h
     host_xmake_file="${host_xmake_file} i386/x-mingw32"
     host_exeext=.exe
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 033106322a43c1b3f4df59809e9841377c473978..5d278223113600db286a8ef16c2dc06aa6fa4162 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2009-09-13  Kai Tietz  <kai.tietz@onevision.com>
+
+	* configure.ac: Set for i?86-w64-mingw*
+	need_64bit_hwint to yes.
+	* configure: Regenerated.
+
 2009-09-10  Jason Merrill  <jason@redhat.com>
 
 	* directives.c (cpp_define): constify.
diff --git a/libcpp/configure b/libcpp/configure
index 80249e7692546420583fea11d243c7237cb9863c..eaf99dd28d68a714fd266754fe575d79934c4610 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -6876,6 +6876,7 @@ case $target in
 	hppa*64*-*-* | \
 	i[34567]86-*-darwin* | \
 	i[34567]86-*-solaris2.1[0-9]* | \
+	i[34567]86-w64-mingw* | \
 	mips*-*-* | \
 	mmix-*-* | \
 	powerpc*-*-* | \
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index 3af4e166e71f4efe27a80a920f8d52a53c7afa57..52465462165714f0d403af308fee4692733bf64f 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -146,6 +146,7 @@ case $target in
 	hppa*64*-*-* | \
 	i[34567]86-*-darwin* | \
 	i[34567]86-*-solaris2.1[0-9]* | \
+	i[34567]86-w64-mingw* | \
 	mips*-*-* | \
 	mmix-*-* | \
 	powerpc*-*-* | \