On 2020-09-17 22:28, grischka wrote:
Herman ten Brugge via Tinycc-devel wrote:
+#if 0 /* does not work with fork */
ptr = mmap (NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
prx = mmap (NULL, size, PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0);
+#else
+ ptr = prx = mmap (NULL, size, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE, fd, 0);
+#endif
Might depend on what selinux features you have enabled but IIRC
alpine musl for example did not allow to run code from memory
that once was allocated as writable.
Thanks for the quick response.
I use fedora (32) and see no problem here.
But if it fails on another platform I will not commit the patch
Herman
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel