Could anyone point me to some more detailed technical specs (meaning: not marketing) on how Rosetta 2 actually works?
Does such a document even exist?
I'm wondering, because some pseudo-technical docs that I've read state that Rosetta 2 is based on ahead of time compilation, so in theory macOS should take the amd64 binary, recompile it to aarch64, and run the compiled binary instead of the original one.
That's not what I've experienced though. My experiments indicate something else: when I compile on an amd64 macOS a trivial application that allocates a small memory buffer, and I start writing amd64 instructions directly into the buffer, then I set executable rights on the allocated memory region and I run the buffer, it runs without problems on an ARM macOS. That means it can't be an ahead of time compilation, it needs to be some kind of amd64 instruction emulation. Or something else that works similarly.
Does such a document even exist?
I'm wondering, because some pseudo-technical docs that I've read state that Rosetta 2 is based on ahead of time compilation, so in theory macOS should take the amd64 binary, recompile it to aarch64, and run the compiled binary instead of the original one.
That's not what I've experienced though. My experiments indicate something else: when I compile on an amd64 macOS a trivial application that allocates a small memory buffer, and I start writing amd64 instructions directly into the buffer, then I set executable rights on the allocated memory region and I run the buffer, it runs without problems on an ARM macOS. That means it can't be an ahead of time compilation, it needs to be some kind of amd64 instruction emulation. Or something else that works similarly.