https://www.graalvm.org/22.1/reference-manual/native-image/L...
Then use the WASM back-end for LLVM.
Probably won't work though.