Hello Pass Problem

Hi all
I am trying hello pass in llvm. I have compiled and could generate LLVMHello.so but while giving the pass using opt i am getting below mentioned error.

Command used: opt-2.8 -load …/…/cse231_project/llvm/llvm-2.9/Debug/lib/LLVMHello.so -hello < hello.bc

Error opening ‘…/…/cse231_project/llvm/llvm-2.9/Debug/lib/LLVMHello.so’: …/…/cse231_project/llvm/llvm-2.9/Debug/lib/LLVMHello.so: undefined symbol: _ZN4llvm12PassRegistry12registerPassERKNS_8PassInfoEb
-load request ignored.
opt-2.8: Unknown command line argument ‘-hello’. Try: ‘opt-2.8 -help’

Hi,

2011/5/2 Manish Gupta <mgupta.iitr@gmail.com>

Hi all
I am trying hello pass in llvm. I have compiled and could generate LLVMHello.so but while giving the pass using opt i am getting below mentioned error.

Command used: opt-2.8 -load …/…/cse231_project/llvm/llvm-2.9/Debug/lib/LLVMHello.so -hello < hello.bc

try instead debug realise
also you should invoke an option for this pass
try -hello or -hello2 after loading your pass

Hi all
I am trying hello pass in llvm. I have compiled and could generate LLVMHello.so but while giving the pass using opt i am getting below mentioned error.

Command used: opt-2.8 -load …/…/cse231_project/llvm/llvm-2.9/Debug/lib/LLVMHello.so -hello < hello.bc

Error opening ‘…/…/cse231_project/llvm/llvm-2.9/Debug/lib/LLVMHello.so’: …/…/cse231_project/llvm/llvm-2.9/Debug/lib/LLVMHello.so: undefined symbol: _ZN4llvm12PassRegistry12registerPassERKNS_8PassInfoEb
-load request ignored.
opt-2.8: Unknown command line argument ‘-hello’. Try: ‘opt-2.8 -help’

From the looks of it, you are using a version of opt from LLVM 2.8 to run a pass compiled as part of LLVM 2.9. Is this correct?

Since LLVM’s internal API changes from release to release, you cannot use older passes with newer versions of LLVM (or vice-versa). If you are using LLVM 2.8, then your pass must be compiled using the LLVM 2.8 source code. If you are using LLVM 2.9, your pass must be compiled using the LLVM 2.9 source code.

– John T.