microsoft / llvm-mctoll

llvm-mctoll
Other
816 stars 125 forks source link

Difference between llvm-mctoll and wllvm? #107

Closed hyperlyz closed 3 years ago

hyperlyz commented 3 years ago

I can raise binaries to LLVM IR with wllvm [1].
Can you tell me what difference between llvm-mctoll and wllvm?

[1] https://github.com/travitch/whole-program-llvm.

bharadwajy commented 3 years ago

Thanks for your interest in llvm-mctoll project and for making me aware of wllvm project.

llvm-mctoll - as you noted - aims to translate (i.e., raise) x64 (ELF, as of now) executables to LLVM IR (bitcode / text) solely using LLVM infrastructure. The tool does not depend on the availability of source files used to generate the x64 executables or any other artifact. One of the expected benefits from such translation (among a few others that I can think of) is to enable a binary translation of x64 executables to those of a different target ISA - say ARM64 or RISCV64 by compiling the resulting LLVM IR - for example, when sources of the x64 binary are not available. It is expected that the resulting executable is functionally equivalent to the source x64 executable.

A quick look at the README of wllvm indicates that it "provides tools for building whole-program (or whole-library) LLVM bitcode files from an unmodified C or C++ source package". If translation (raising) of executables is one of the tools, then, most likely the capabilities of wllvm would be a super set of that of llvm-mctoll. I am not aware of wllvm and hence can not compare / evaluate its capabilities to translate (raise) x64 executables LLVM IR, with those of llvm-mctoll.