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 Google Code Archive - Long-term storage for Google Code Project Hosting..
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
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
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?
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.