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>
This commit is contained in:
John Bates
2021-05-25 13:21:40 -07:00
committed by Marge Bot
parent 8b7ff78443
commit df1a4e749f
3 changed files with 19 additions and 1 deletions
+5
View File
@@ -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 */
}