Closed Hitmasu closed 1 year ago
On MacOS 10.14 (Mojave) and above, Apple restricts the use of mmap with protections PROT_EXEC and PROT_WRITE. According to the official documentation, using the MAP_JIT flag should still work, but for some reason, it results in an EADDRESS.
Porting Just-In-Time Compilers to Apple Silicon
That's necessary to allocate a native code to prepare delegate.
We will need to find another way to bypass this restriction.
Jitex doesn't run on ARM64 CPU. That's because the trampoline, which is necessary to prepare the delegate, is entirely written for X64.
https://github.com/Hitmasu/Jitex/blob/666c73ac436f8317d0b652df2898fa46efd2cfe6/src/Jitex/Utils/MemoryHelper.cs#L15-L21
Implementing a trampoline using ARM64 instructions should be sufficient.