Make PCRE's JIT work on Android devices

__clear_cache is missing from Android; use cacheflush instead.

Backport in Qt's own PCRE copy of the upstream fix:
http://vcs.pcre.org/viewvc?view=revision&revision=1340

Task-number: QTBUG-31754
Change-Id: I4996265f7b19343ba24983d4f8b2f75e2b578504
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Giuseppe D'Angelo 2013-06-18 10:42:11 +02:00 committed by The Qt Project
parent 44630a6f42
commit 5d439eb4ca
3 changed files with 28 additions and 0 deletions

3
src/3rdparty/pcre/patches/README vendored Normal file
View File

@ -0,0 +1,3 @@
These patches are landed in upstream PCRE (they're marked with
their SVN revision number). When upgrading PCRE remember check
if the version you're upgrading to already contains them or not.

View File

@ -0,0 +1,18 @@
Index: sljit/sljitConfigInternal.h
===================================================================
--- sljit/sljitConfigInternal.h (revision 1339)
+++ sljit/sljitConfigInternal.h (working copy)
@@ -221,6 +221,13 @@
#define SLJIT_CACHE_FLUSH(from, to) \
sys_icache_invalidate((char*)(from), (char*)(to) - (char*)(from))
+#elif defined __ANDROID__
+
+/* Android lacks __clear_cache; instead, cacheflush should be used. */
+
+#define SLJIT_CACHE_FLUSH(from, to) \
+ cacheflush((long)(from), (long)(to), 0)
+
#elif (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
/* The __clear_cache() implementation of GCC is a dummy function on PowerPC. */

View File

@ -217,6 +217,13 @@
#define SLJIT_CACHE_FLUSH(from, to) \
sys_icache_invalidate((char*)(from), (char*)(to) - (char*)(from))
#elif defined __ANDROID__
/* Android lacks __clear_cache; instead, cacheflush should be used. */
#define SLJIT_CACHE_FLUSH(from, to) \
cacheflush((long)(from), (long)(to), 0)
#elif (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
/* The __clear_cache() implementation of GCC is a dummy function on PowerPC. */