undefined references in llvm

Hello EveryOne,

I am building customized tools for ARM using a crosscomplier. I am
currently building a tool similar to lli but it only jits code. I
enabled jit when I was configuring LLVM. On linking my code with
help from llvm-config to the libraries I get this error:

Can’t exec “which”: No such file or directory at
llvm2/bin/llvm-config line 69.
Use of uninitialized value in scalar chomp at llvm2/bin/llvm-config line 70.
Use of uninitialized value in -e at llvm2/bin/llvm-config line 71.
/tmp/cc0b5iTo.o: In function ForceCodegenLinking': llvm2/include/llvm/CodeGen/LinkAllCodegenComponents.h:32: undefined reference to llvm::createDeadMachineInstructionElimPass()’
llvm2/include/llvm/CodeGen/LinkAllCodegenComponents.h:34: undefined
reference to llvm::createSimpleRegisterAllocator()' llvm2/include/llvm/CodeGen/LinkAllCodegenComponents.h:35: undefined reference to llvm::createLocalRegisterAllocator()’
llvm2/include/llvm/CodeGen/LinkAllCodegenComponents.h:36: undefined
reference to llvm::createBigBlockRegisterAllocator()' llvm2/include/llvm/CodeGen/LinkAllCodegenComponents.h:38: undefined reference to llvm::createPBQPRegisterAllocator()’
llvm2/include/llvm/CodeGen/LinkAllCodegenComponents.h:42: undefined
reference to llvm::linkOcamlGC()' llvm2/include/llvm/CodeGen/LinkAllCodegenComponents.h:43: undefined reference to llvm::linkShadowStackGC()’
/tmp/cc0b5iTo.o: In function main': VirementJit.cpp:110: undefined reference to llvm::sys::PrintStackTraceOnErrorSignal()’
VirementJit.cpp:122: undefined reference to
`llvm::getBitcodeModuleProvider(llvm::MemoryBuffer*,
std::basic_string

I think you need the program called 'which'.

Best regards,
--Edwin