Link error building llc

With the TableGen problem circumvented the build proceeds quite well up
until:

llvm[2]: Linking Debug executable llc
/home/neale/LLVM/llvm/tools/llc/Debug/llc.o: In function
`ForceCodegenLinking':
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h:45:
undefined reference to
`llvm::createBURRListDAGScheduler(llvm::SelectionDAGISel*, bool)'
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h:46:
undefined reference to
`llvm::createTDRRListDAGScheduler(llvm::SelectionDAGISel*, bool)'
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h:47:
undefined reference to
`llvm::createTDListDAGScheduler(llvm::SelectionDAGISel*, bool)'
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h:48:
undefined reference to
`llvm::createFastDAGScheduler(llvm::SelectionDAGISel*, bool)'
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h:49:
undefined reference to
`llvm::createDefaultScheduler(llvm::SelectionDAGISel*, bool)'
/home/neale/LLVM/llvm/tools/llc/Debug/llc.o: In function
`ForceAsmWriterLinking':
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllAsmWriterComponents.h:30:
undefined reference to `llvm::linkOcamlGCPrinter()'
collect2: ld returned 1 exit status
make[2]: *** [/home/neale/LLVM/llvm/Debug/bin/llc] Error 1

These entry points are in modules that have been compiled and placed into an
archive. (e.g. llvm::createBURRListDAGScheduler is in ScheduleDAGRRList.cpp
whose object is placed in ./Debug/lib/libLLVMSelectionDAG.a).

I'm sure I've missed a configuration option or something trivial like that
but my newbie brain can't determine what it is.

Neale

Hello, Neale

These entry points are in modules that have been compiled and placed into an
archive. (e.g. llvm::createBURRListDAGScheduler is in ScheduleDAGRRList.cpp
whose object is placed in ./Debug/lib/libLLVMSelectionDAG.a).

I'm sure I've missed a configuration option or something trivial like that
but my newbie brain can't determine what it is.

make VERBOSE=1 is your friend. Is the all necessary stuff linked in?

I ran with VERBOSE=1 and see:

g++ -I/home/neale/LLVM/llvm/include -I/home/neale/LLVM/llvm/tools/llc
-D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g
-fno-exceptions -fPIC -Woverloaded-virtual -pedantic -Wall -W
-Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter -g -Wl,-R
-Wl,/home/neale/LLVM/llvm/Debug/bin -Wl,-export-dynamic
-L/home/neale/LLVM/llvm/Debug/lib -L/home/neale/LLVM/llvm/Debug/lib -o
/home/neale/LLVM/llvm/Debug/bin/llc
/home/neale/LLVM/llvm/tools/llc/Debug/llc.o \
        -lLLVMBitReader /home/neale/LLVM/llvm/Debug/lib/LLVMCBackend.o
-lLLVMCodeGen -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis
/home/neale/LLVM/llvm/Debug/lib/LLVMCppBackend.o -lLLVMTarget -lLLVMCore
-lLLVMSupport -lLLVMSystem -lpthread -ldl -lm -lelf
/home/neale/LLVM/llvm/tools/llc/Debug/llc.o: In function
`ForceCodegenLinking':
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h:45:
undefined reference to
`llvm::createBURRListDAGScheduler(llvm::SelectionDAGISel*, bool)'
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h:46:
undefined reference to
`llvm::createTDRRListDAGScheduler(llvm::SelectionDAGISel*, bool)'
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h:47:
undefined reference to
`llvm::createTDListDAGScheduler(llvm::SelectionDAGISel*, bool)'
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h:48:
undefined reference to
`llvm::createFastDAGScheduler(llvm::SelectionDAGISel*, bool)'
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h:49:
undefined reference to
`llvm::createDefaultScheduler(llvm::SelectionDAGISel*, bool)'
/home/neale/LLVM/llvm/tools/llc/Debug/llc.o: In function
`ForceAsmWriterLinking':
/home/neale/LLVM/llvm/include/llvm/CodeGen/LinkAllAsmWriterComponents.h:30:
undefined reference to `llvm::linkOcamlGCPrinter()'
collect2: ld returned 1 exit status

So it appears to be missing LLVMSelectionDAG in the link specification. I've
been trying to wade through the Makefile* files to see how the link
specification is generated but am not getting anywhere. So my question is
how/where is this generated?

Neale

Hello, Neale

        -lLLVMBitReader /home/neale/LLVM/llvm/Debug/lib/LLVMCBackend.o
-lLLVMCodeGen -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis
/home/neale/LLVM/llvm/Debug/lib/LLVMCppBackend.o -lLLVMTarget -lLLVMCore
-lLLVMSupport -lLLVMSystem -lpthread -ldl -lm -lelf

It seems, that you did not specify any single backend except C. Please
do so.

So it appears to be missing LLVMSelectionDAG in the link specification. I've
been trying to wade through the Makefile* files to see how the link
specification is generated but am not getting anywhere. So my question is
how/where is this generated?

List of libraries is generated via llvm-config script, which performs
dependency checking of libraries and arranges them in proper order.

Perfect thanks! I am starting on the System z port so just wanted to build
tblgen so I thought building with just cbe,cpp would be okay.