diff --git a/gcc/Makefile.in b/gcc/Makefile.in
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1882,8 +1882,6 @@ libgcc.mvars: config.status Makefile $(L
 	echo SHLIB_NM_FLAGS = '$(SHLIB_NM_FLAGS)' >> tmp-libgcc.mvars
 	echo LIBGCC2_CFLAGS = '$(LIBGCC2_CFLAGS)' >> tmp-libgcc.mvars
 	echo TARGET_LIBGCC2_CFLAGS = '$(TARGET_LIBGCC2_CFLAGS)' >> tmp-libgcc.mvars
-	echo LIBGCC_SYNC = '$(LIBGCC_SYNC)' >> tmp-libgcc.mvars
-	echo LIBGCC_SYNC_CFLAGS = '$(LIBGCC_SYNC_CFLAGS)' >> tmp-libgcc.mvars
 	echo CRTSTUFF_CFLAGS = '$(CRTSTUFF_CFLAGS)' >> tmp-libgcc.mvars
 	echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS)' >> tmp-libgcc.mvars
 	echo CRTSTUFF_T_CFLAGS_S = '$(CRTSTUFF_T_CFLAGS_S)' >> tmp-libgcc.mvars
diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1829,7 +1829,7 @@ mips*-*-netbsd*)			# NetBSD/mips, either
 	;;
 mips64*-*-linux* | mipsisa64*-*-linux*)
 	tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/linux.h mips/linux64.h"
-	tmake_file="${tmake_file} mips/t-linux64 mips/t-libgcc-mips16"
+	tmake_file="${tmake_file} mips/t-linux64"
 	tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
 	case ${target} in
 		mips64el-st-linux-gnu)
@@ -1850,7 +1850,6 @@ mips64*-*-linux* | mipsisa64*-*-linux*)
 	;;
 mips*-*-linux*)				# Linux MIPS, either endian.
         tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/linux.h"
-	tmake_file="${tmake_file} mips/t-libgcc-mips16"
 	case ${target} in
         mipsisa32r2*)
 		tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
@@ -1873,7 +1872,7 @@ mips*-*-openbsd*)
 	;;
 mips*-sde-elf*)
 	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/sde.h"
-	tmake_file="mips/t-sde mips/t-libgcc-mips16"
+	tmake_file="mips/t-sde"
 	extra_options="${extra_options} mips/sde.opt"
 	case "${with_newlib}" in
 	  yes)
@@ -1910,7 +1909,7 @@ mipsisa32r2-*-elf* | mipsisa32r2el-*-elf
 mipsisa64-*-elf* | mipsisa64el-*-elf* | \
 mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*)
 	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
-	tmake_file="mips/t-isa3264 mips/t-libgcc-mips16"
+	tmake_file="mips/t-isa3264"
 	case ${target} in
 	  mipsisa32r2*)
 	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
@@ -1947,17 +1946,17 @@ mipsisa64sr71k-*-elf*)
         ;;
 mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
 	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
-	tmake_file="mips/t-elf mips/t-libgcc-mips16 mips/t-sb1"
+	tmake_file="mips/t-elf mips/t-sb1"
 	target_cpu_default="MASK_64BIT|MASK_FLOAT64"
 	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64"
 	;;
 mips-*-elf* | mipsel-*-elf*)
 	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
-	tmake_file="mips/t-elf mips/t-libgcc-mips16"
+	tmake_file="mips/t-elf"
 	;;
 mips64-*-elf* | mips64el-*-elf*)
 	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
-	tmake_file="mips/t-elf mips/t-libgcc-mips16"
+	tmake_file="mips/t-elf"
 	target_cpu_default="MASK_64BIT|MASK_FLOAT64"
 	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
 	;;
@@ -1968,13 +1967,13 @@ mips64vr-*-elf* | mips64vrel-*-elf*)
         ;;
 mips64orion-*-elf* | mips64orionel-*-elf*)
 	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elforion.h mips/elf.h"
-	tmake_file="mips/t-elf mips/t-libgcc-mips16"
+	tmake_file="mips/t-elf"
 	target_cpu_default="MASK_64BIT|MASK_FLOAT64"
 	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
 	;;
 mips*-*-rtems*)
 	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/rtems.h rtems.h"
-	tmake_file="mips/t-elf mips/t-libgcc-mips16 t-rtems mips/t-rtems"
+	tmake_file="mips/t-elf t-rtems mips/t-rtems"
 	;;
 mips-wrs-vxworks)
 	tm_file="elfos.h ${tm_file} mips/elf.h vx-common.h vxworks.h mips/vxworks.h"
@@ -1982,7 +1981,7 @@ mips-wrs-vxworks)
 	;;
 mipstx39-*-elf* | mipstx39el-*-elf*)
 	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/r3900.h mips/elf.h"
-	tmake_file="mips/t-r3900 mips/t-libgcc-mips16"
+	tmake_file="mips/t-r3900"
 	;;
 mmix-knuth-mmixware)
 	tm_file="${tm_file} newlib-stdint.h"
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -648,7 +648,7 @@ endif
 
 endif
 
-ifeq ($(LIBGCC_SYNC),yes)
+ifeq ($(SYNC),yes)
 libgcc-sync-size-funcs := $(foreach op, add sub or and xor nand, \
 			    sync_fetch_and_$(op) \
 			    sync_$(op)_and_fetch) \
@@ -661,37 +661,37 @@ libgcc-sync-size-funcs := $(foreach pref
 			      $(prefix)_$(suffix)))
 
 libgcc-sync-size-funcs-o = $(patsubst %,%$(objext),$(libgcc-sync-size-funcs))
-$(libgcc-sync-size-funcs-o): %$(objext): $(gcc_srcdir)/config/sync.c
-	$(gcc_compile) $(LIBGCC_SYNC_CFLAGS) \
+$(libgcc-sync-size-funcs-o): %$(objext): $(srcdir)/sync.c
+	$(gcc_compile) $(SYNC_CFLAGS) \
 	  -DFN=`echo "$*" | sed 's/_[^_]*$$//'` \
 	  -DSIZE=`echo "$*" | sed 's/.*_//'` \
-	  -c $(gcc_srcdir)/config/sync.c $(vis_hide)
+	  -c $< $(vis_hide)
 libgcc-objects += $(libgcc-sync-size-funcs-o)
 
 libgcc-sync-funcs := sync_synchronize
 
 libgcc-sync-funcs-o = $(patsubst %,%$(objext),$(libgcc-sync-funcs))
-$(libgcc-sync-funcs-o): %$(objext): $(gcc_srcdir)/config/sync.c
-	$(gcc_compile) $(LIBGCC_SYNC_CFLAGS) \
+$(libgcc-sync-funcs-o): %$(objext): $(srcdir)/sync.c
+	$(gcc_compile) $(SYNC_CFLAGS) \
 	  -DL$* \
-	  -c $(gcc_srcdir)/config/sync.c $(vis_hide)
+	  -c $< $(vis_hide)
 libgcc-objects += $(libgcc-sync-funcs-o)
 
 ifeq ($(enable_shared),yes)
 libgcc-sync-size-funcs-s-o = $(patsubst %,%_s$(objext), \
 			       $(libgcc-sync-size-funcs))
-$(libgcc-sync-size-funcs-s-o): %_s$(objext): $(gcc_srcdir)/config/sync.c
-	$(gcc_s_compile) $(LIBGCC_SYNC_CFLAGS) \
+$(libgcc-sync-size-funcs-s-o): %_s$(objext): $(srcdir)/sync.c
+	$(gcc_s_compile) $(SYNC_CFLAGS) \
 	  -DFN=`echo "$*" | sed 's/_[^_]*$$//'` \
 	  -DSIZE=`echo "$*" | sed 's/.*_//'` \
-	  -c $(gcc_srcdir)/config/sync.c
+	  -c $<
 libgcc-s-objects += $(libgcc-sync-size-funcs-s-o)
 
 libgcc-sync-funcs-s-o = $(patsubst %,%_s$(objext),$(libgcc-sync-funcs))
-$(libgcc-sync-funcs-s-o): %_s$(objext): $(gcc_srcdir)/config/sync.c
-	$(gcc_s_compile) $(LIBGCC_SYNC_CFLAGS) \
+$(libgcc-sync-funcs-s-o): %_s$(objext): $(srcdir)/sync.c
+	$(gcc_s_compile) $(SYNC_CFLAGS) \
 	  -DL$*	\
-	  -c $(gcc_srcdir)/config/sync.c
+	  -c $<
 libgcc-s-objects += $(libgcc-sync-funcs-s-o)
 endif
 endif
diff --git a/libgcc/config.host b/libgcc/config.host
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -540,12 +540,12 @@ mips*-*-netbsd*)			# NetBSD/mips, either
 	;;
 mips64*-*-linux* | mipsisa64*-*-linux*)
 	extra_parts="$extra_parts crtfastmath.o"
-	tmake_file="${tmake_file} t-crtfm mips/t-tpbit"
+	tmake_file="${tmake_file} t-crtfm mips/t-mips16 mips/t-tpbit"
 	md_unwind_header=mips/linux-unwind.h
 	;;
 mips*-*-linux*)				# Linux MIPS, either endian.
 	extra_parts="$extra_parts crtfastmath.o"
-	tmake_file="${tmake_file} t-crtfm"
+	tmake_file="${tmake_file} t-crtfm mips/t-mips16"
 	md_unwind_header=mips/linux-unwind.h
 	;;
 mips*-*-openbsd*)
@@ -560,33 +560,38 @@ mips*-sde-elf*)
 	    tmake_file=mips/t-sdemtk
 	    ;;
 	esac
+	tmake_file="$tmake_file mips/t-mips16"
 	;;
-mipsisa32-*-elf* | mipsisa32el-*-elf*)
-	;;
-mipsisa32r2-*-elf* | mipsisa32r2el-*-elf*)
-	;;
-mipsisa64-*-elf* | mipsisa64el-*-elf*)
-	;;
+mipsisa32-*-elf* | mipsisa32el-*-elf* | \
+mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
+mipsisa64-*-elf* | mipsisa64el-*-elf* | \
 mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*)
+	tmake_file="$tmake_file mips/t-mips16"
 	;;
 mipsisa64sr71k-*-elf*)
 	tmake_file=t-fdpbit
         ;;
 mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
+	tmake_file="$tmake_file mips/t-mips16"
 	;;
 mips-*-elf* | mipsel-*-elf*)
+	tmake_file="$tmake_file mips/t-mips16"
 	;;
 mips64-*-elf* | mips64el-*-elf*)
+	tmake_file="$tmake_file mips/t-mips16"
 	;;
 mips64vr-*-elf* | mips64vrel-*-elf*)
         ;;
 mips64orion-*-elf* | mips64orionel-*-elf*)
+	tmake_file="$tmake_file mips/t-mips16"
 	;;
 mips*-*-rtems*)
+	tmake_file="$tmake_file mips/t-mips16"
 	;;
 mips-wrs-vxworks)
 	;;
 mipstx39-*-elf* | mipstx39el-*-elf*)
+	tmake_file="$tmake_file mips/t-mips16"
 	;;
 mmix-knuth-mmixware)
 	extra_parts="crti.o crtn.o crtbegin.o crtend.o"
diff --git a/gcc/config/mips/libgcc-mips16.ver b/libgcc/config/mips/libgcc-mips16.ver
rename from gcc/config/mips/libgcc-mips16.ver
rename to libgcc/config/mips/libgcc-mips16.ver
diff --git a/gcc/config/mips/mips16.S b/libgcc/config/mips/mips16.S
rename from gcc/config/mips/mips16.S
rename to libgcc/config/mips/mips16.S
diff --git a/gcc/config/mips/t-libgcc-mips16 b/libgcc/config/mips/t-mips16
rename from gcc/config/mips/t-libgcc-mips16
rename to libgcc/config/mips/t-mips16
--- a/gcc/config/mips/t-libgcc-mips16
+++ b/libgcc/config/mips/t-mips16
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -38,8 +38,8 @@ LIB1ASMFUNCS = _m16addsf3 _m16subsf3 _m1
 	_m16stubdc0 _m16stubdc1 _m16stubdc2 _m16stubdc5 _m16stubdc6 \
 	_m16stubdc9 _m16stubdc10
 
-LIBGCC_SYNC = yes
-LIBGCC_SYNC_CFLAGS = -mno-mips16
+SYNC = yes
+SYNC_CFLAGS = -mno-mips16
 
 # Version these symbols if building libgcc.so.
 SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver
diff --git a/gcc/config/sync.c b/libgcc/sync.c
rename from gcc/config/sync.c
rename to libgcc/sync.c
--- a/gcc/config/sync.c
+++ b/libgcc/sync.c
@@ -1,5 +1,5 @@
 /* Out-of-line libgcc versions of __sync_* builtins.  */
-/* Copyright (C) 2008, 2009  Free Software Foundation, Inc.
+/* Copyright (C) 2008, 2009, 2011  Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -22,8 +22,8 @@ a copy of the GCC Runtime Library Except
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
-/* This file is used by targets whose makefiles define LIBGCC_SYNC
-   to "yes".  It is compiled with LIBGCC_SYNC_CFLAGS and provides
+/* This file is used by targets whose makefiles define SYNC
+   to "yes".  It is compiled with SYNC_CFLAGS and provides
    out-of-line versions of all relevant __sync_* primitives.
 
    These routines are intended for targets like MIPS that have two
