harvard-acc / LLVM-Tracer

An LLVM pass to profile dynamic LLVM IR instructions and runtime values
Other
135 stars 35 forks source link

llvm-link-3.4 error: Invalid value #16

Closed matejaputic closed 7 years ago

matejaputic commented 7 years ago

While running the install script found in the Readme, the error I am getting is:

cd /if21/mp3t/Projects/LLVM-Tracer/build/profile-func && /usr/bin/llvm-link-3.4 /if21/mp3t/Projects/LLVM-Tracer/build/profile-func/trace_logger.obj.llvm -o /if2
1/mp3t/Projects/LLVM-Tracer/build/profile-func/trace_logger.unopt.llvm
/usr/bin/llvm-link-3.4: /if21/mp3t/Projects/LLVM-Tracer/build/profile-func/trace
_logger.obj.llvm: error: Invalid value
/usr/bin/llvm-link-3.4: error loading file '/if21/mp3t/Projects/LLVM-Tracer/buil
d/profile-func/trace_logger.obj.llvm'

One caveat is that it seems that I have LLVM-3.4 installed but I am building with Clang-3.9, does this matter? (I am on a university machine and do not have sysadmin privileges.)

Full verbose output trace of make can be found here

Any ideas on how to approach this?

rgly commented 7 years ago

The LLVM IR may change in every LLVM minor version. Do not use clang-3.9 with llvm-link-3.4.

[ 21%] Generating trace_logger.obj.llvm cd /if21/mp3t/Projects/LLVM-Tracer/build/profile-func && /usr/bin/clang -DSTDC_LIMIT_MACROS -DSTDC_CONSTANT_MACROS -fno-inline-functions -fno-use-cxa-atexit -O3 -emit-llvm -c /if21/mp3t/Projects/LLVM-Tracer/profile-func/trace_logger.c -o /if21/mp3t/Projects/LLVM-Tracer/build/profile-func/trace_logger.obj.llvm

Please check the version of /usr/bin/clang. It should be 3.4, otherwise the llvm-link-3.4 would not recognize the given IR.

Though you don't have root privilege on the machine, you can have a LLVM installed under home directory. Then build LLVM-Tracer with manually specified path. Or use AUTOINSTALL feature of LLVM-Tracer to download, build, install LLVM-3.4 in one command. Please refer to README for more detail.

In case there is disk quota on the machine, keep in mind that LLVM-3.4 may take up 4GB for build, 1.7GB for installation.

matejaputic commented 7 years ago

Thank you for pointing out the importance of the version of Clang. Once we installed it and the full llvm-3.4 toolchain, we were able to build.