[LLVMdev] can't run the Hello Pass: either not registered or registered multiple times, what is the problem?

Chuck Zhao czhao at eecg.toronto.edu
Wed Jun 2 13:52:28 PDT 2010


I am trying to run the HELLO LLVM Pass under WinXP/MinGW, by following 
the precise steps available at 
http://www.llvm.org/docs/WritingAnLLVMPass.html.
The pass failed to run, giving me the following error:

opt -load Release/lib/Hello.dll -hello < ./hello.bc > /dev/null
opt.exe: Unknown command line argument '-hello'.  Try: 
'C:\MSYS\opt\llvm-2.7\bin\opt.exe -help'
make: *** [run] Error 1

Basically, it can't find the hello pass.

However, when I was trying to run the same code under Debian4-i386, I 
got a totally opposite error: "Passes registered multiple times"
opt -load Release/lib/Hello.so -hello < test.bc > /dev/null
opt: 
/autofs/steffan/a/a0/czhao/ResearchTools/LLVM/2.7/llvm-2.7/lib/VMCore/Pass.cpp:234: 
void<unnamed>::PassRegistrar::RegisterPass(const llvm::PassInfo&): 
Assertion `Inserted && "Pass registered multiple times!"' failed.
0  opt 0x085e6809
Stack dump:
0.    Program arguments: opt -load Release/lib/Hello.so -hello
/bin/sh: line 1: 28292 Aborted                 opt -load 
Release/lib/Hello.so -hello <test.bc >/dev/null
make: *** [run] Error 134


I think there is something very tricky here, but I can't figure out where.

Could somebody give me a hint?


Thank you

Chuck








More information about the llvm-dev mailing list