termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
12.9k stars 2.97k forks source link

Package request: mit-scheme #342

Open PwnicornDev opened 8 years ago

PwnicornDev commented 8 years ago

I am aware that tinyscheme is already included, but I would need a more complete implementation with development tools.

Connochaetes commented 8 years ago

This would be a wonderful enhancement, especially since the guile package apparently is disabled?

andreyorst commented 5 years ago

I'd love to see mit-scheme on my phone too

hexbinoct commented 4 years ago

any follow up on full scheme on termux?

xtkoba commented 2 years ago

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.