[Pcre-svn] [1252] code/trunk: Restrict configuration of the …

Kezdőlap
Üzenet törlése
Szerző: Subversion repository
Dátum:  
Címzett: pcre-svn
Tárgy: [Pcre-svn] [1252] code/trunk: Restrict configuration of the JIT SELinux compatible memory allocator to Linux
Revision: 1252
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1252
Author:   ph10
Date:     2020-04-28 16:29:18 +0100 (Tue, 28 Apr 2020)
Log Message:
-----------
Restrict configuration of the JIT SELinux compatible memory allocator to Linux 
and NetBSD.


Modified Paths:
--------------
    code/trunk/CMakeLists.txt
    code/trunk/ChangeLog
    code/trunk/configure.ac


Modified: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt    2020-04-28 15:03:58 UTC (rev 1251)
+++ code/trunk/CMakeLists.txt    2020-04-28 15:29:18 UTC (rev 1252)
@@ -200,8 +200,12 @@
 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 @@
     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})


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2020-04-28 15:03:58 UTC (rev 1251)
+++ code/trunk/ChangeLog    2020-04-28 15:29:18 UTC (rev 1252)
@@ -120,7 +120,10 @@
 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
------------------------------


Modified: code/trunk/configure.ac
===================================================================
--- code/trunk/configure.ac    2020-04-28 15:03:58 UTC (rev 1251)
+++ code/trunk/configure.ac    2020-04-28 15:29:18 UTC (rev 1252)
@@ -176,11 +176,18 @@
   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,