[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - bridges/source

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Sun Nov 15 07:42:10 UTC 2020


 bridges/source/cpp_uno/shared/vtablefactory.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 1a4f7443491e809959b53838fb0cfad287317a88
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Apr 29 20:12:21 2020 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Sun Nov 15 08:41:37 2020 +0100

    Use MAP_JIT on macOS
    
    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 at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105847
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index 70187cbd2fe7..d17533534e9b 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


More information about the Libreoffice-commits mailing list