[LLVMdev] Undefined symbol in Hello pass

Ben Ransford ransford at cs.umass.edu
Tue Mar 16 09:24:00 PDT 2010


Hello,

I just built a virgin ToT (r98634) for release on vanilla Snow
Leopard.  It seems that the Hello pass doesn't want to load because of
undefined symbols:

builddir% ../llvm/configure --prefix=$(PWD)/../installdir --enable-optimized
builddir% make
builddir% make install && cd ../installdir
installdir% bin/opt -load lib/libLLVMHello.dylib
Error opening 'lib/libLLVMHello.dylib': dlopen(lib/libLLVMHello.dylib,
9): Symbol not found:
__ZN4llvm12FunctionPass11runOnModuleERNS_6ModuleE
  Referenced from: /blah/installdir/lib/libLLVMHello.dylib
  Expected in: flat namespace
 in /blah/installdir/lib/libLLVMHello.dylib
  -load request ignored.

This error doesn't occur in debug mode (same build as above, but with
--disable-optimized):

installdir% bin/opt -load lib/libLLVMHello.dylib -help | grep hello
    -hello                                     - Hello World Pass
    -hello2                                    - Hello World Pass
(with getAnalysisUsage implemented)

I noticed that lib/Transforms/Hello/Makefile has an empty USEDLIBS
variable, but that may be a red herring because it works in debug
mode.  I'm hoping someone who knows the build system better than I
(i.e., at all) can provide some insight into what's happening.

-ben



More information about the llvm-dev mailing list