Open PwnicornDev opened 8 years ago
This would be a wonderful enhancement, especially since the guile package apparently is disabled?
I'd love to see mit-scheme on my phone too
any follow up on full scheme on termux?
Question: Does the following code still run successfully on recent Android (10+)?
#include <sys/mman.h>
int main(void)
{
int page_size = getpagesize();
uint32_t *p = mmap(NULL, page_size, PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
if (p == (void *)-1) __builtin_abort();
#ifdef __aarch64__
*p = 0xd65f03c0; /* ret */
#elif defined __arm__
*p = 0xe12fff1e; /* bx lr */
#elif defined __x86_64__ || defined __i386__
*p = 0xc3; /* ret */
#else
#error Unsupported architecture.
#endif
mprotect(p, page_size, PROT_WRITE|PROT_EXEC); /* W^X violation */
((void (*)(void))p)();
return 0;
}
Currently MIT/GNU Scheme relies heavily on this type of code, which prevents it from running on Apple M1.
I am aware that tinyscheme is already included, but I would need a more complete implementation with development tools.