Hello, I currently write my own LLVM (function) pass and intend to use the following project to enable the use of range analysis information in my code: https://code.google.com/p/range-analysis/. Since I use Eclipse (with CMake) to build LLVM I did the following: 1. Provide each subfolder with a CMakeLists.txt (add_llvm_loadable_module). 2. Re-create the CMake config (cmake ../llvm -G "Eclipse CDT4 - Unix Makefiles"), re-open it in Eclipse. 4. Fix some minor issues with range-analysis (some symbols were renamed in newer LLVM releases). 5. Add the necessary code to my own pass, almost verbatim from https://code.google.com/p/range-analysis/wiki/HowToUseRangeAnalysisInAnotherPass. Everything compiles fine, but loading the pass in LLVM gives me the following error:> /opt/llvm/bin/opt: symbol lookup error: ./build/lib/RangeAnalysis.so: undefined symbol: _ZN4llvm13ConstantRangeC1ENS_5APIntES1_ > error: unable to interface with target machineI use LLVM 3.4svn on Ubuntu x64. Do I miss a specific library? Regards
Óscar Fuentes
2013-Sep-24 10:43 UTC
[LLVMdev] range-analysis in Function Pass on Eclipse with CMake
dw <dw.dev.mailing at gmail.com> writes: [snip]> Everything compiles fine, but loading the pass in LLVM gives me the > following error: > >> /opt/llvm/bin/opt: symbol lookup error: ./build/lib/RangeAnalysis.so: undefined symbol: _ZN4llvm13ConstantRangeC1ENS_5APIntES1_ >> error: unable to interface with target machine > > I use LLVM 3.4svn on Ubuntu x64. > > Do I miss a specific library?$ c++filt _ZN4llvm13ConstantRangeC1ENS_5APIntES1_ llvm::ConstantRange::ConstantRange(llvm::APInt, llvm::APInt) IIRC ConstantRange is defined in libLLVMSupport. That library is at the core of the dependency graph. Do you provide a list of LLVM libraries at all for your RangeAnalysis library?
24.09.2013 12:43, Óscar Fuentes writes:> [snip] > > IIRC ConstantRange is defined in libLLVMSupport. That library is at the > core of the dependency graph. Do you provide a list of LLVM libraries at > all for your RangeAnalysis library?Thanks. Adding "target_link_libraries(RangeAnalysis LLVMSupport)" to the corresponding CMakeLists.txt solves the issue.