LLVM is not a good solution to this problem. As beautiful as the LLVM IR, it is by no means independent of the machine and is not intended for this. It is very easy and really necessary to generate the target LLVM IR in some languages: sizeof (void *), for example, will be 4 or 8 or whatever, when compiled into IR.
LLVM also does nothing to ensure OS independence.
One interesting feature might be QEMU. You can compile a program for a specific architecture, and then use the QEMU user space emulation to run it on different architectures. Unfortunately, this can solve the problem with the target machine, but it does not solve the OS problem: QEMU Linux user mode emulation only works on Linux systems.
The JVM is probably the best choice for target and OS independence if you want to distribute binary files.
source share