summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Bates <jbates@chromium.org>2021-05-25 13:21:40 -0700
committerMarge Bot <eric+marge@anholt.net>2021-06-09 21:28:17 +0000
commitdf1a4e749f5205c0a73671f5e3b59062b85fa565 (patch)
tree756fdcdccacb346eb0caf3e140df60e8009756f5 /src
parent8b7ff78443b0b3843be20928be63944eea540972 (diff)
downloadmesa-df1a4e749f5205c0a73671f5e3b59062b85fa565.tar.gz
mesa-df1a4e749f5205c0a73671f5e3b59062b85fa565.tar.bz2
mesa-df1a4e749f5205c0a73671f5e3b59062b85fa565.zip
add execmem build option
The execmem option can be set to false to disable the dynamic dispatch patching that requires mmap(PROT_WRITE | PROT_EXEC), which is undesirable on some platforms. Signed-off-by: John Bates <jbates@chromium.org> Reviewed-by: Chia-I Wu <olvaffe@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10987>
Diffstat (limited to 'src')
-rw-r--r--src/mapi/u_execmem.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mapi/u_execmem.c b/src/mapi/u_execmem.c
index d6e64c08886..2bb63d02b26 100644
--- a/src/mapi/u_execmem.c
+++ b/src/mapi/u_execmem.c
@@ -121,6 +121,10 @@ init_map(void)
void *
u_execmem_alloc(unsigned int size)
{
+#ifndef MESA_EXECMEM
+ (void)size;
+ return NULL;
+#else
void *addr = NULL;
mtx_lock(&exec_mutex);
@@ -140,6 +144,7 @@ bail:
mtx_unlock(&exec_mutex);
return addr;
+#endif /* MESA_EXECMEM */
}