Any objections to this?

    Suggest configuring --with-selinux if mprotect fails.

diff --git a/tccrun.c b/tccrun.c
index 4903f90..1025500 100644
--- a/tccrun.c
+++ b/tccrun.c
@@ -230,7 +230,8 @@ static void set_pages_executable(void *ptr, unsigned long 
length)
     start = (addr_t)ptr & ~(PAGESIZE - 1);
     end = (addr_t)ptr + length;
     end = (end + PAGESIZE - 1) & ~(PAGESIZE - 1);
-    mprotect((void *)start, end - start, PROT_READ | PROT_WRITE | PROT_EXEC);
+    if (mprotect((void *)start, end - start, PROT_READ | PROT_WRITE | 
PROT_EXEC))
+        tcc_error("mprotect failed: did you mean to configure 
--with-selinux?");
   #ifndef __PCC__
     __clear_cache(ptr, (char *)ptr + length);
   #else

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to