Create code at runtime on iOS: possible any more?

I'm the developer of 8th (https://8th-dev.com), which compiles the program at run-time, on the device. There used to be an iOS version which worked, but it seems things have changed since then.

I'm trying to distribute an iOS version of an app written in 8th, and am encountering "SIGKILL - CODESIGNING" when trying to execute freshly compiled code. I am doing the 'sys_icache_invalidate' thing after writing into a mmap'ed bit of memory (rwx).

I'm not writing into memory that was codesigned, so I don't know why the error is that.

Anyway, the question is: is it possible any more to do what I used to be able to do?

As far as I know it is not allowed. Which version had this working?

Are you sure this worked on an unmodified iOS device? That seems unlikely to me. mmaping executable memory is specifically disallowed, with a very limited exception that Safari uses to JIT Javascript.

This page is worth reading:

https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon

describes how it works on MacOS.

I believe that iOS likely works much the same, except crucially that our apps cannot get the required entitlement.

Yes. When I ported to the M1, I had to do some things differently; but it works like a champ (on Apple Silicon macOS).

Create code at runtime on iOS: possible any more?
 
 
Q