Link error building llvm/clang/cling on Mac OS X 10.7

I’m trying to build cling (rev 42565) with clang/llvm (rev 147279), and getting link errors:

Undefined symbols for architecture x86_64: "_LLVMInitializeHexagonAsmPrinter", referenced from: llvm::InitializeAllAsmPrinters() in libclingInterpreter.a(CIFactory.o) "_LLVMInitializePTXAsmPrinter", referenced from: llvm::InitializeAllAsmPrinters() in libclingInterpreter.a(CIFactory.o) "_LLVMInitializePowerPCAsmPrinter", referenced from: llvm::InitializeAllAsmPrinters() in libclingInterpreter.a(CIFactory.o) "_LLVMInitializeCellSPUAsmPrinter", referenced from: llvm::InitializeAllAsmPrinters() in libclingInterpreter.a(CIFactory.o) "_LLVMInitializeARMAsmPrinter", referenced from: llvm::InitializeAllAsmPrinters() in libclingInterpreter.a(CIFactory.o) "_LLVMInitializeXCoreAsmPrinter", referenced from: llvm::InitializeAllAsmPrinters() in libclingInterpreter.a(CIFactory.o) "_LLVMInitializeMSP430AsmPrinter", referenced from: llvm::InitializeAllAsmPrinters() in libclingInterpreter.a(CIFactory.o) "_LLVMInitializeMipsAsmPrinter", referenced from: llvm::InitializeAllAsmPrinters() in libclingInterpreter.a(CIFactory.o) "_LLVMInitializeSparcAsmPrinter", referenced from: llvm::InitializeAllAsmPrinters() in libclingInterpreter.a(CIFactory.o) "_LLVMInitializeMBlazeAsmPrinter", referenced from: llvm::InitializeAllAsmPrinters() in libclingInterpreter.a(CIFactory.o) ld: symbol(s) not found for architecture x86_64

I think I’m following the instructions correctly. It appears that clang/llvm build fine; the errors I’m getting are linking cling. I’m basically doing the following:

$ svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm Checked out revision 147279. $ cd llvm/tools $ svn co http://llvm.org/svn/llvm-project/cfe/trunk clang Checked out revision 147279. $ cd ../projects/ $ svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt Checked out revision 147279. $ cd ../tools $ svn co https://root.cern.ch/svn/root/trunk/cint/cling Checked out revision 42565. $ cd .. $ cat tools/cling/patches/*.diff | patch -p0 patching file tools/Makefile Hunk #1 succeeded at 21 (offset 7 lines). $ cd .. $ mkdir build $ cd build $ ../llvm/configure $ make

Can anyone offer any advice?

Hi,
I cannot reproduce it. Could you configure with:
--prefix=/where/to/install --enable-targets=host-only
Try building in debug mode, because as far as I can remember there was issue with building in release mode, waiting to be resolved :slight_smile:
Please let me know if it doesn’t work.
Cheers,
Vassil

Vassil,

Yes, that did it!

$ ../llvm/configure --prefix=/usr/local --enable-targets=host-only $ make

This was in debug mode; haven’t tried a release build yet. In any case, thanks for the help!

Hi,
Sure! I am glad that I helped.
Cheers,
Vassil