Add makefile support for SELinux allocator in JIT.

This commit is contained in:
Zoltán Herczeg 2017-06-15 06:20:30 +00:00
parent 6e30ed1b40
commit 9af8fe2e87
3 changed files with 27 additions and 0 deletions

View File

@ -168,6 +168,9 @@ SET(PCRE2_HEAP_MATCH_RECURSE OFF CACHE BOOL
SET(PCRE2_SUPPORT_JIT OFF CACHE BOOL SET(PCRE2_SUPPORT_JIT OFF CACHE BOOL
"Enable support for Just-in-time compiling.") "Enable support for Just-in-time compiling.")
SET(PCRE2_SUPPORT_JIT_SEALLOC OFF CACHE BOOL
"Enable SELinux compatible execmem allocator in JIT.")
SET(PCRE2_SUPPORT_PCRE2GREP_JIT ON CACHE BOOL SET(PCRE2_SUPPORT_PCRE2GREP_JIT ON CACHE BOOL
"Enable use of Just-in-time compiling in pcre2grep.") "Enable use of Just-in-time compiling in pcre2grep.")
@ -288,6 +291,10 @@ IF(PCRE2_SUPPORT_JIT)
SET(SUPPORT_JIT 1) SET(SUPPORT_JIT 1)
ENDIF(PCRE2_SUPPORT_JIT) ENDIF(PCRE2_SUPPORT_JIT)
IF(PCRE2_SUPPORT_JIT_SEALLOC)
SET(SLJIT_PROT_EXECUTABLE_ALLOCATOR 1)
ENDIF(PCRE2_SUPPORT_JIT_SEALLOC)
IF(PCRE2_SUPPORT_PCRE2GREP_JIT) IF(PCRE2_SUPPORT_PCRE2GREP_JIT)
SET(SUPPORT_PCRE2GREP_JIT 1) SET(SUPPORT_PCRE2GREP_JIT 1)
ENDIF(PCRE2_SUPPORT_PCRE2GREP_JIT) ENDIF(PCRE2_SUPPORT_PCRE2GREP_JIT)
@ -764,6 +771,7 @@ IF(PCRE2_SHOW_REPORT)
MESSAGE(STATUS " Build 16 bit PCRE2 library ...... : ${PCRE2_BUILD_PCRE2_16}") MESSAGE(STATUS " Build 16 bit PCRE2 library ...... : ${PCRE2_BUILD_PCRE2_16}")
MESSAGE(STATUS " Build 32 bit PCRE2 library ...... : ${PCRE2_BUILD_PCRE2_32}") MESSAGE(STATUS " Build 32 bit PCRE2 library ...... : ${PCRE2_BUILD_PCRE2_32}")
MESSAGE(STATUS " Enable JIT compiling support .... : ${PCRE2_SUPPORT_JIT}") MESSAGE(STATUS " Enable JIT compiling support .... : ${PCRE2_SUPPORT_JIT}")
MESSAGE(STATUS " Use SELinux allocator in JIT .... : ${PCRE2_SUPPORT_JIT_SEALLOC}")
MESSAGE(STATUS " Enable Unicode support .......... : ${PCRE2_SUPPORT_UNICODE}") MESSAGE(STATUS " Enable Unicode support .......... : ${PCRE2_SUPPORT_UNICODE}")
MESSAGE(STATUS " Newline char/sequence ........... : ${PCRE2_NEWLINE}") MESSAGE(STATUS " Newline char/sequence ........... : ${PCRE2_NEWLINE}")
MESSAGE(STATUS " \\R matches only ANYCRLF ......... : ${PCRE2_SUPPORT_BSR_ANYCRLF}") MESSAGE(STATUS " \\R matches only ANYCRLF ......... : ${PCRE2_SUPPORT_BSR_ANYCRLF}")

View File

@ -143,6 +143,12 @@ AC_ARG_ENABLE(jit,
[enable Just-In-Time compiling support]), [enable Just-In-Time compiling support]),
, enable_jit=no) , enable_jit=no)
# 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]),
, enable_jit_sealloc=no)
# Handle --disable-pcre2grep-jit (enabled by default) # Handle --disable-pcre2grep-jit (enabled by default)
AC_ARG_ENABLE(pcre2grep-jit, AC_ARG_ENABLE(pcre2grep-jit,
AS_HELP_STRING([--disable-pcre2grep-jit], AS_HELP_STRING([--disable-pcre2grep-jit],
@ -584,6 +590,13 @@ else
enable_pcre2grep_jit="no" enable_pcre2grep_jit="no"
fi fi
if test "$enable_jit_sealloc" = "yes"; then
AC_DEFINE([SLJIT_PROT_EXECUTABLE_ALLOCATOR], [1], [
Define to any non-zero number to enable support for SELinux
compatible executable memory allocator in JIT. Note that this
will have no effect unless SUPPORT_JIT is also defined.])
fi
if test "$enable_pcre2grep_jit" = "yes"; then if test "$enable_pcre2grep_jit" = "yes"; then
AC_DEFINE([SUPPORT_PCRE2GREP_JIT], [], [ AC_DEFINE([SUPPORT_PCRE2GREP_JIT], [], [
Define to any value to enable JIT support in pcre2grep. Note that this will Define to any value to enable JIT support in pcre2grep. Note that this will
@ -977,6 +990,7 @@ $PACKAGE-$VERSION configuration summary:
Build 32-bit pcre2 library ......... : ${enable_pcre2_32} Build 32-bit pcre2 library ......... : ${enable_pcre2_32}
Include debugging code ............. : ${enable_debug} Include debugging code ............. : ${enable_debug}
Enable JIT compiling support ....... : ${enable_jit} Enable JIT compiling support ....... : ${enable_jit}
Use SELinux allocator in JIT ....... : ${enable_jit_sealloc}
Enable Unicode support ............. : ${enable_unicode} Enable Unicode support ............. : ${enable_unicode}
Newline char/sequence .............. : ${enable_newline} Newline char/sequence .............. : ${enable_newline}
\R matches only ANYCRLF ............ : ${enable_bsr_anycrlf} \R matches only ANYCRLF ............ : ${enable_bsr_anycrlf}

View File

@ -254,6 +254,11 @@ sure both macros are undefined; an emulation function will then be used. */
your system. */ your system. */
#undef PTHREAD_CREATE_JOINABLE #undef PTHREAD_CREATE_JOINABLE
/* Define to any non-zero number to enable support for SELinux compatible
executable memory allocator in JIT. Note that this will have no effect
unless SUPPORT_JIT is also defined. */
#undef SLJIT_PROT_EXECUTABLE_ALLOCATOR
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS