summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2020-04-28 15:29:18 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2020-04-28 15:29:18 +0000
commit488dde94db43fbb89631f84fdc899f90d5314939 (patch)
tree85a80c32ef0681cad2fe7b11c41ad975e424ea9b
parent36294e74ac8976b3abfb3b0deddce21b200ea939 (diff)
downloadpcre2-488dde94db43fbb89631f84fdc899f90d5314939.tar.gz
Restrict configuration of the JIT SELinux compatible memory allocator to Linux
and NetBSD. git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1252 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--CMakeLists.txt16
-rw-r--r--ChangeLog3
-rw-r--r--configure.ac17
3 files changed, 27 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08f1dd5..5e9da6b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -200,8 +200,12 @@ SET(PCRE2_HEAP_MATCH_RECURSE OFF CACHE BOOL
SET(PCRE2_SUPPORT_JIT OFF CACHE BOOL
"Enable support for Just-in-time compiling.")
-SET(PCRE2_SUPPORT_JIT_SEALLOC OFF CACHE BOOL
- "Enable SELinux compatible execmem allocator in JIT (experimental).")
+IF(${CMAKE_SYSTEM_NAME} MATCHES Linux|NetBSD)
+ SET(PCRE2_SUPPORT_JIT_SEALLOC OFF CACHE BOOL
+ "Enable SELinux compatible execmem allocator in JIT (experimental).")
+ELSE(${CMAKE_SYSTEM_NAME} MATCHES Linux|NetBSD)
+ SET(PCRE2_SUPPORT_JIT_SEALLOC IGNORE)
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES Linux|NetBSD)
SET(PCRE2GREP_SUPPORT_JIT ON CACHE BOOL
"Enable use of Just-in-time compiling in pcre2grep.")
@@ -331,8 +335,12 @@ IF(PCRE2_SUPPORT_JIT_SEALLOC)
CHECK_SYMBOL_EXISTS(mkostemp stdlib.h REQUIRED)
UNSET(CMAKE_REQUIRED_DEFINITIONS)
IF(${REQUIRED})
- ADD_DEFINITIONS(-D_GNU_SOURCE)
- SET(SLJIT_PROT_EXECUTABLE_ALLOCATOR 1)
+ IF(${CMAKE_SYSTEM_NAME} MATCHES Linux|NetBSD)
+ ADD_DEFINITIONS(-D_GNU_SOURCE)
+ SET(SLJIT_PROT_EXECUTABLE_ALLOCATOR 1)
+ ELSE(${CMAKE_SYSTEM_NAME} MATCHES Linux|NetBSD)
+ MESSAGE(FATAL_ERROR "Your configuration is not supported")
+ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES Linux|NetBSD)
ELSE(${REQUIRED})
SET(PCRE2_SUPPORT_JIT_SEALLOC OFF)
ENDIF(${REQUIRED})
diff --git a/ChangeLog b/ChangeLog
index 04a0623..94c7f03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -120,6 +120,9 @@ does). Patch by Carlo Marcelo Arenas Belon.
29. Check for the existence of memfd_create in both CMake and configure
configurations. Patch by Carlo Marcelo Arenas Belon.
+30. Restrict the configuration setting for the SELinux compatible execmem
+allocator (change 10.30/44) to Linux and NetBSD.
+
Version 10.34 21-November-2019
------------------------------
diff --git a/configure.ac b/configure.ac
index 7e33807..214e46c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -176,11 +176,18 @@ if test "$enable_jit" = "auto"; then
echo checking for JIT support on this hardware... $enable_jit
fi
-# Handle --enable-jit-sealloc (disabled by default)
-AC_ARG_ENABLE(jit-sealloc,
- AS_HELP_STRING([--enable-jit-sealloc],
- [enable SELinux compatible execmem allocator in JIT (experimental)]),
- , enable_jit_sealloc=no)
+# Handle --enable-jit-sealloc (disabled by default and only experimental)
+case $host_os in
+ linux* | netbsd*)
+ AC_ARG_ENABLE(jit-sealloc,
+ AS_HELP_STRING([--enable-jit-sealloc],
+ [enable SELinux compatible execmem allocator in JIT (experimental)]),
+ ,enable_jit_sealloc=no)
+ ;;
+ *)
+ enable_jit_sealloc=unsupported
+ ;;
+esac
# Handle --disable-pcre2grep-jit (enabled by default)
AC_ARG_ENABLE(pcre2grep-jit,