syscalls/mprotect04: Use __builtin___clear_cache() to sync caches

In commit cf9a0800cd0 code was added to mprotect04 to synchronize
the instruction and data caches on PowerPC before executing
the copied code. This is also necessary on other architectures
which have split instruction and data caches and need explicit
cache maintenance operations, like ARM.

The GCC builtin __builtin___clear_cache() will correctly handle
this for all architectures, so switch to using it. The builtin
was only implemented at around GCC 4.1, so use a configure
check so that we will skip the test with TCONF if the compiler
doesn't support the builtin.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Jan Stancek <jstancek@redhat.com>
diff --git a/configure.ac b/configure.ac
index e0e9c1b..9901612 100644
--- a/configure.ac
+++ b/configure.ac
@@ -188,5 +188,6 @@
 LTP_CHECK_EPOLL_PWAIT
 LTP_CHECK_KEYUTILS_SUPPORT
 LTP_CHECK_SYNC_ADD_AND_FETCH
+LTP_CHECK_BUILTIN_CLEAR_CACHE
 
 AC_OUTPUT