DependableSystemsLab/LLFI

Build a single IR file with the LLFI tool `compiletoIR`

zuiaiziai opened this issue · 1 comments

Hello, I followed the README file to test LLFI. It worked well to use factorial.c file to test LLFI. And then, I want to use LLFI to build spec2000 benchmarks into IR file. But it didn't work well. The tested file I used is 164.gzip in spec2000. I used command "../../../LLFI-build/tools/compiletoIR --readable -o gzip.ll gzip.c". It can produced gzip.ll file but the gzip.ll file didn't have main function. So when I used command "../../../LLFI-build/bin/instrument --readable gzip.ll" to produce gzip-llfi_index.ll, some errors were produced.As follow:
ERROR: Function main does not exist, which is required by LLFI

ERROR: there was an error during running the instrumentation pass, please follow the provided instructions for instrument.

The 164.gzip has more than one c file and gzip.c is the main file. I don't know how to build into IR file in this situation.Could you help me to solve this problem?Please e-mail me at 1090366769@qq.com. Thank you very much!

Issue resolved over e-mail.

In the case of multiple source .c files you must link the IR files after compiling each individual source file to IR (can use LLVM/Clang's "llvm-link" to accomplish this).