diff options
author | Tor Lillqvist <tml@collabora.com> | 2020-04-29 20:12:21 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2020-04-30 07:38:02 +0200 |
commit | 2c366aae9263dc4115b054fe74b90cabea61fa0b (patch) | |
tree | 13d236e2653849bd64319ef8ae4084e91f42c81f /bridges | |
parent | 639eab5d0b00f9b32b3a21ae16d6dfb196bb503a (diff) |
Use a less extreme entitlement for our run-time machine code generation
See https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-executable-page-protection
and https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-jit
Change-Id: I192038efa9cff4fb723bf4bdc8644f0b09f0fcda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93181
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/cpp_uno/shared/vtablefactory.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx index 018b808d89e6..036b81c4218a 100644 --- a/bridges/source/cpp_uno/shared/vtablefactory.cxx +++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx @@ -77,6 +77,11 @@ extern "C" void * allocExec( std::size_t n = (*size + (pagesize - 1)) & ~(pagesize - 1); void * p; #if defined SAL_UNX +#if defined MACOSX + p = mmap( + nullptr, n, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON | MAP_JIT, -1, + 0); +#else p = mmap( nullptr, n, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); @@ -88,6 +93,7 @@ extern "C" void * allocExec( munmap (p, n); p = nullptr; } +#endif #elif defined _WIN32 p = VirtualAlloc(nullptr, n, MEM_COMMIT, PAGE_EXECUTE_READWRITE); #endif |