I know that's possible with recompiling from the source code, for example with Go, but I was wondering why can't we do this for arbitrary binaries? Are the calls not apparent in the binary form? From what I can tell Rosetta 2 does a similar thing when you run amd64 app on M1 for the first time[1]. What prevents us to have such a tool for all architectures? For example, I'd like to run an arbitrary amd64 binary on a RISC-V core without recompiling the source code.
[1]: https://www.computerworld.com/article/3597949/everything-you-need-to-know-about-rosetta-2-on-apple-silicon-macs.html