undefined symbol: _ZN4llvm12PassRegistry12registerPassERKNS_8PassInfoEb

Has anyone seen this error before? I’m trying to load a pass that apparently isn’t registered, it’s just the “Hello World” sample , so I don’t see the problem.


me@here:~/llvm/llvm_core/llvm-2.9$ opt -load Release/lib/LLVMHello.so -hello <cdfg.c> /dev/null
Error opening ‘Release/lib/LLVMHello.so’: Release/lib/LLVMHello.so: undefined symbol: _ZN4llvm12PassRegistry12registerPassERKNS_8PassInfoEb
-load request ignored.
opt: Unknown command line argument ‘-hello’. Try: ‘opt -help’

Hi Ryan, are both opt and LLVMHello from the same version of LLVM? And the same
build of LLVM (in particular built the same way wrt optimizations, enabling of
assertions etc)?

Ciao, Duncan.

Hi Ryan, please write also to the list and not just to me personally.
That way others can join the discussion, and it will be archived for
the benefit of others with similar problems in the future.

Thanks, Duncan.

Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: …/llvm_gcc/llvm-gcc-4.2-2.9.source/configure -program-prefix=llvm --enable-llvm=/home/ryan/llvm/llvm_core/llvm-2.9 --enable-languages=c,c++ --disable-jit : (reconfigured) …/llvm_gcc/llvm-gcc-4.2-2.9.source/configure -program-prefix=llvm --enable-llvm=/home/ryan/llvm/llvm_core/llvm-2.9 --enable-languages=c,c++ --disable-jit
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build)

Not sure if that helps or not. That’s the llvmgcc version though.


Yes, this is the problem. Running “opt -version” returns:

me@here:~/llvm/llvm_core/llvm-2.9$ opt -version
Low Level Virtual Machine (http://llvm.org/):
llvm version 2.8 (Ubuntu 2.8-0ubuntu1)
Optimized build.
Built Oct 6 2010 (13:24:23).
Host: x86_64-pc-linux-gnu
Host CPU: i686

Registered Targets:

So, my question is then how do I do a clean uninstall of 2.8 so that I can install 2.9?

Fixed, thanks.