--- a/gcc/config/arm/vxworks.h
+++ b/gcc/config/arm/vxworks.h
@@ -154,6 +154,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #undef TARGET_DEFAULT_WORD_RELOCATIONS
 #define TARGET_DEFAULT_WORD_RELOCATIONS 1
 
+/* Clear the instruction cache from `beg' to `end'.  This is
+   implemented in lib1funcs.S, so ensure an error if this definition
+   is used.  */
+#undef  CLEAR_INSN_CACHE
+#define CLEAR_INSN_CACHE(BEG, END) not_used
+
 /* Define this to be nonzero if static stack checking is supported.  */
 #define STACK_CHECK_STATIC_BUILTIN 1
 
diff --git a/libgcc/config.host b/libgcc/config.host
index 9556c77..a35c8fb7 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -389,7 +389,7 @@ arc*-*-linux*)
 	extra_parts="$extra_parts crttls.o"
 	;;
 arm-wrs-vxworks|arm-wrs-vxworks7)
-	tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+	tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp arm/t-vxworks"
 	extra_parts="$extra_parts crti.o crtn.o"
 	case ${host} in
 	*-*-vxworks7)
diff --git a/libgcc/config/arm/lib1funcs.S b/libgcc/config/arm/lib1funcs.S
index 8d8c3ce..4b21c02 100644
--- a/libgcc/config/arm/lib1funcs.S
+++ b/libgcc/config/arm/lib1funcs.S
@@ -1572,8 +1572,27 @@ LSYM(Lover12):
 	do_pop	{r7}
 	RET
 	FUNC_END clear_cache
+#elif defined __vxworks
+	ARM_FUNC_START clear_cache
+.L1:
+	mcr	p15, 0, r0, c7, c11, 1	@ Clean data cache by MVA to PoU
+	mcr	p15, 0, r0, c7, c10, 4	@ Ensure visibility of the data
+					@ cleaned from the cache
+	mcr	p15, 0, r0, c7, c5, 1	@ Invalidate instruction cache by
+					@ MVA to PoU
+	mcr	p15, 0, r0, c7, c5, 7	@ Invalidate branch predictor by
+					@ MVA to PoU
+	mcr	p15, 0, r0, c7, c10, 4	@ Ensure completion of the
+					@ invalidations
+	mcr	p15, 0, r0, c7, c5, 4	@ Synchronize fetched instruction
+					@ stream
+	add	r0, r0, #4		@ Increment MVA
+	cmp	r0, r1
+	ble	.L1			@ Loop if MVA <= End Address
+	RET
+	FUNC_END clear_cache
 #else
-#error "This is only for ARM EABI GNU/Linux"
+#error "This is only for ARM EABI GNU/Linux or ARM VxWorks"
 #endif
 #endif /* L_clear_cache */
 /* ------------------------------------------------------------------------ */
diff --git a/libgcc/config/arm/t-vxworks b/libgcc/config/arm/t-vxworks
new file mode 100644
index 0000000..ba0c109
--- /dev/null
+++ b/libgcc/config/arm/t-vxworks
@@ -0,0 +1 @@
+LIB1ASMFUNCS += _clear_cache
-- 
1.7.10.4

