[LLVMdev] Hello example plugin has unresolved symbol in llvm 2.7

Bob Grandish redcurbs at yahoo.com
Thu May 20 18:49:19 PDT 2010


I built llvm-2.7 from source on FreeBSD-i386 with:
  ./configure --prefix=/opt && gmake

It builds fine, but the Hello plugin fails to load with an unresolved symbol.

$ opt -load /opt/lib/libLLVMHello.so -help           
Error opening '/opt/lib/libLLVMHello.so': /opt/lib/libLLVMHello.so: Undefined symbol "_ZNK4llvm4Pass5printERNS_11raw_ostreamEPKNS_6ModuleE"
  -load request ignored.
OVERVIEW: llvm .bc -> .bc modular optimizer and analysis printer
[...]

I edited the lib/Transforms/Hello/Makefile with various forms of LLVMLIBS, USEDLIBS, and LINK_COMPONENTS. Basically, I needed to include "LLVMCore.a LLVMSupport.a LLVMSystem.a" in order to get rid of all 3 unresolved symbols. However, when I tried to load that library with opt, I got the dreaded "pass loaded multiple times" assert.

This is the Release build. I have not tried a debug build. However, it's clear that the stock Hello plugin is broken in llvm-2.7. Please advise on how to fix the above.

Sincerely, Bob


      



More information about the llvm-dev mailing list