Description
Hi I was trying to build LLVM from source and I already tried llvmorg-10.0.0-rc3
and llvmorg-11-init
two versions. Previously the LLVM tool I used was installed from ubuntu apt package tool and my code works very well with it. However, when I switch to the opt
that was built from source, it always output following error message. I am pretty sure the issue doesn't come from the loaded pass shared object file itself because opt
prints same error after I load the HelloPass from the tutorial.
opt: CommandLine Error: Option 'debug-pass' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
I simply follow the instructions from the official website. Here's how I build LLVM.
git clone https://github.com/llvm/llvm-project.git
mkdir build && cd build
cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE="Release" ../llvm
make && make install
After some searching on Google, I doubt the issue comes from version conflict. Yet opt
outputs the same message when I remove all of other version on my server. Thanks for your help and please let me know if the further information is needed.
Referring to these two similar issues,
- LLVM linking: CommandLine Error: Option 'help-list' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options
- "opt: CommandLine Error: Option 'disable-symbolication' registered more than once!" when building with dg library
I think it's necessary to show how I compile the Pass source code and input it intoopt
.
clang-10 -fPIC -c HelloPass.cpp -o HelloPass.o `llvm-config --cxxflags`
clang-10 -shared -o HelloPass.so HelloPass.o `llvm-config --ldflags --libs --system-libs`
opt -load HelloPass.so -hello-pass -S < source.ll > /dev/null