secure-software-engineering / phasar

A LLVM-based static analysis framework.
Other
920 stars 140 forks source link

Compile phasar in debug mode and can't find libLLVMPasses.so.12, but the release mode can. #622

Closed william4code closed 1 year ago

william4code commented 1 year ago

Bug description

Hi, I am compiling phasar with LLVM 12, with branch f-PhasarVaRA12Support. https://github.com/secure-software-engineering/phasar/tree/f-PhasarVaRA12Support When I compile phasar in release mode, everything is OK. I can execute the following command tools/phasar-llvm/phasar-llvm --module test/llvm_test_code/basic/module_cpp.ll -D IFDSSolverTest But when I compile phasar in debug mode, the above command gets an error:

./tools/phasar-llvm/phasar-llvm: error while loading shared libraries: libLLVMPasses.so.12: cannot open shared object file: No such file or directory

I execute ldd tools/phasar-llvm/phasar-llvm and find that all links to LLVM related libraries are missed.

I also use message(STATUS ${LLVM_LIB_PATH}) in the top level CMakeLists.txt of phasar to print messages. The output indicates that cmake can find LLVM.

I don't know why the debug mode does not work but the release model works. Anyone can help me?

Context (Environment)

phasar branch f-PhasarVaRA12Support LLVM 12.0.1

Operating System: ubuntu 20.04

Build Type:

=======================

william4code commented 1 year ago

I have solved this. I find that phasar debug version needs LLVM debug version, and phasar release version needs LLVM release version too.