aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoman Dubtsov <[email protected]>2020-06-18 19:52:18 -0700
committerRoman Dubtsov <[email protected]>2020-06-18 19:52:18 -0700
commite7b7fd2f0348d44d5f17e9506cc4a582e7b9141e (patch)
tree2cbd7293f5d7cf58eae820cdf3731c0b06aee25c
parent82b70e665918efc2ee348091742fd0237b3b68c5 (diff)
downloadxbyak-e7b7fd2f0348d44d5f17e9506cc4a582e7b9141e.tar.gz
xbyak-e7b7fd2f0348d44d5f17e9506cc4a582e7b9141e.zip
use MAP_JIT on macOS regardless of Xcode version
This allows only requiring com.apple.security.cs.allow-jit entitlement with hardened runtime even if built with Xcode 9 which does not have MAP_JIT.
-rw-r--r--xbyak/xbyak.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h
index 57ab5ca..2f1af68 100644
--- a/xbyak/xbyak.h
+++ b/xbyak/xbyak.h
@@ -80,9 +80,12 @@
#include <sys/mman.h>
#include <stdlib.h>
#endif
-#if defined(__APPLE__) && defined(MAP_JIT)
+#if defined(__APPLE__) && !defined(XBYAK_DONT_USE_MAP_JIT)
#define XBYAK_USE_MAP_JIT
#include <sys/sysctl.h>
+ #ifndef MAP_JIT
+ #define MAP_JIT 0x800
+ #endif
#endif
#if !defined(_MSC_VER) || (_MSC_VER >= 1600)
#include <stdint.h>