Lu Mitnick
2011-May-07 11:48 UTC
[LLVMdev] Question about linking llvm-mc when porting a new backend
Hello all, I am a LLVM newer who want to add a new backend(EBC) into LLVM. After coping the related files from another target and modifying it, I meet a problem when I build the project. The error message is as follows: ===============================================================[ 94%] Built target llvm-dis Linking CXX executable ../../bin/llvm-mc Undefined symbols: "llvm::TargetRegisterInfo::getInitialFrameState(std::vector<llvm::MachineMove, std::allocator<llvm::MachineMove> >&) const", referenced from: vtable for llvm::EBCRegisterInfoin libLLVMEBCCodeGen.a(EBCRegisterInfo.cpp.o) vtable for llvm::EBCGenRegisterInfoin libLLVMEBCCodeGen.a(EBCRegisterInfo.cpp.o) "llvm::TargetMachine::getAsmVerbosityDefault()", referenced from: getVerboseAsm() in libLLVMCodeGen.a(LLVMTargetMachine.cpp.o) "llvm::TargetData::getPrefTypeAlignment(llvm::Type const*) const", referenced from: llvm::SelectionDAG::getConstantPool(llvm::MachineConstantPoolValue*, llvm::EVT, unsigned int, int, bool, unsigned char)in libLLVMSelectionDAG.a(SelectionDAG.cpp.o) llvm::SelectionDAG::getConstantPool(llvm::Constant const*, llvm::EVT, unsigned int, int, bool, unsigned char)in libLLVMSelectionDAG.a(SelectionDAG.cpp.o) llvm::SelectionDAG::CreateStackTemporary(llvm::EVT, llvm::EVT)in libLLVMSelectionDAG.a(SelectionDAG.cpp.o) llvm::SelectionDAG::CreateStackTemporary(llvm::EVT, llvm::EVT)in libLLVMSelectionDAG.a(SelectionDAG.cpp.o) llvm::SelectionDAG::CreateStackTemporary(llvm::EVT, unsigned int)in libLLVMSelectionDAG.a(SelectionDAG.cpp.o) llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite) in libLLVMSelectionDAG.a(SelectionDAGBuilder.cpp.o) llvm::SelectionDAGBuilder::LowerCallTo(llvm::ImmutableCallSite, llvm::SDValue, bool, llvm::MachineBasicBlock*)in libLLVMSelectionDAG.a(SelectionDAGBuilder.cpp.o) llvm::SelectionDAGBuilder::visitAlloca(llvm::AllocaInst const&)in libLLVMSelectionDAG.a(SelectionDAGBuilder.cpp.o) (anonymous namespace)::DAGCombiner::SimplifySelectCC(llvm::DebugLoc, llvm::SDValue, llvm::SDValue, llvm::SDValue, llvm::SDValue, llvm::ISD::CondCode, bool) in libLLVMSelectionDAG.a(DAGCombiner.cpp.o) llvm::FunctionLoweringInfo::set(llvm::Function const&, llvm::MachineFunction&)in libLLVMSelectionDAG.a(FunctionLoweringInfo.cpp.o) llvm::ComputeMaskedBits(llvm::Value*, llvm::APInt const&, llvm::APInt&, llvm::APInt&, llvm::TargetData const*, unsigned int)in libLLVMAnalysis.a(ValueTracking.cpp.o) (anonymous namespace)::SelectionDAGLegalize::EmitStackConvert(llvm::SDValue, llvm::EVT, llvm::EVT, llvm::DebugLoc) in libLLVMSelectionDAG.a(LegalizeDAG.cpp.o) (anonymous namespace)::SelectionDAGLegalize::EmitStackConvert(llvm::SDValue, llvm::EVT, llvm::EVT, llvm::DebugLoc) in libLLVMSelectionDAG.a(LegalizeDAG.cpp.o) llvm::isSafeToLoadUnconditionally(llvm::Value*, llvm::Instruction*, unsigned int, llvm::TargetData const*)in libLLVMAnalysis.a(Loads.cpp.o) llvm::DAGTypeLegalizer::SplitVecRes_INSERT_VECTOR_ELT(llvm::SDNode*, llvm::SDValue&, llvm::SDValue&)in libLLVMSelectionDAG.a(LegalizeVectorTypes.cpp.o) llvm::InstrEmitter::AddOperand(llvm::MachineInstr*, llvm::SDValue, unsigned int, llvm::TargetInstrDesc const*, llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>, llvm::DenseMapInfo<unsigned int> >&, bool, bool, bool)in libLLVMSelectionDAG.a(InstrEmitter.cpp.o) llvm::DAGTypeLegalizer::ExpandRes_BIT_CONVERT(llvm::SDNode*, llvm::SDValue&, llvm::SDValue&)in libLLVMSelectionDAG.a(LegalizeTypesGeneric.cpp.o) "llvm::TargetSubtarget::enablePostRAScheduler(llvm::CodeGenOpt::Level, llvm::TargetSubtarget::AntiDepBreakMode&, llvm::SmallVectorImpl<llvm::TargetRegisterClass*>&) const", referenced from: vtable for llvm::EBCSubtargetin libLLVMEBCCodeGen.a(EBCTargetMachine.cpp.o) vtable for llvm::EBCSubtargetin libLLVMEBCCodeGen.a(EBCSubtarget.cpp.o) "llvm::DisableFramePointerElim(llvm::MachineFunction const&)", referenced from: llvm::DwarfDebug::endFunction(llvm::MachineFunction const*)in libLLVMAsmPrinter.a(DwarfDebug.cpp.o) "typeinfo for llvm::TargetLoweringObjectFile", referenced from: typeinfo for llvm::TargetLoweringObjectFileELFin libLLVMCodeGen.a(TargetLoweringObjectFileImpl.cpp.o) typeinfo for llvm::TargetLoweringObjectFileMachOin libLLVMCodeGen.a(TargetLoweringObjectFileImpl.cpp.o) typeinfo for llvm::TargetLoweringObjectFileCOFFin libLLVMCodeGen.a(TargetLoweringObjectFileImpl.cpp.o) "llvm::GuaranteedTailCallOpt", referenced from: __ZN4llvm21GuaranteedTailCallOptE$non_lazy_ptr in libLLVMCodeGen.a(Analysis.cpp.o) "llvm::TargetLoweringObjectFile::SectionForGlobal(llvm::GlobalValue const*, llvm::SectionKind, llvm::Mangler*, llvm::TargetMachine const&) const", referenced from: llvm::AsmPrinter::EmitGlobalVariable(llvm::GlobalVariable const*)in libLLVMAsmPrinter.a(AsmPrinter.cpp.o) llvm::AsmPrinter::EmitGlobalVariable(llvm::GlobalVariable const*)in libLLVMAsmPrinter.a(AsmPrinter.cpp.o) llvm::TargetLoweringObjectFile::SectionForGlobal(llvm::GlobalValue const*, llvm::Mangler*, llvm::TargetMachine const&) constin libLLVMAsmPrinter.a(AsmPrinter.cpp.o) "llvm::TargetLoweringObjectFile::TargetLoweringObjectFile()", referenced from: llvm::TargetLoweringObjectFileCOFF::TargetLoweringObjectFileCOFF()in libLLVMEBCCodeGen.a(EBCISelLowering.cpp.o) "llvm::TargetLoweringObjectFile::~TargetLoweringObjectFile()", referenced from: llvm::TargetLoweringObjectFileELF::~TargetLoweringObjectFileELF()in libLLVMCodeGen.a(TargetLoweringObjectFileImpl.cpp.o) llvm::TargetLoweringObjectFileELF::~TargetLoweringObjectFileELF()in libLLVMCodeGen.a(TargetLoweringObjectFileImpl.cpp.o) llvm::TargetLoweringObjectFileMachO::~TargetLoweringObjectFileMachO()in libLLVMCodeGen.a(TargetLoweringObjectFileImpl.cpp.o) llvm::TargetLoweringObjectFileMachO::~TargetLoweringObjectFileMachO()in libLLVMCodeGen.a(TargetLoweringObjectFileImpl.cpp.o) llvm::TargetLoweringObjectFileCOFF::~TargetLoweringObjectFileCOFF()in libLLVMCodeGen.a(TargetLoweringObjectFileImpl.cpp.o) llvm::TargetLoweringObjectFileCOFF::~TargetLoweringObjectFileCOFF()in libLLVMCodeGen.a(TargetLoweringObjectFileImpl.cpp.o) "llvm::TargetData::getTypeSizeInBits(llvm::Type const*) const", referenced from: llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMAsmPrinter.a(AsmPrinter.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMSelectionDAG.a(TargetLowering.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMCodeGen.a(MachineFunction.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMSelectionDAG.a(SelectionDAGBuilder.cpp.o) llvm::SDISelAsmOperandInfo::getCallOperandValEVT(llvm::LLVMContext&, llvm::TargetLowering const&, llvm::TargetData const*) constin libLLVMSelectionDAG.a(SelectionDAGBuilder.cpp.o) CanCoerceMustAliasedValueToLoad(llvm::Value*, llvm::Type const*, llvm::TargetData const&)in libLLVMScalarOpts.a(GVN.cpp.o) CanCoerceMustAliasedValueToLoad(llvm::Value*, llvm::Type const*, llvm::TargetData const&)in libLLVMScalarOpts.a(GVN.cpp.o) CoerceAvailableValueToLoadType(llvm::Value*, llvm::Type const*, llvm::Instruction*, llvm::TargetData const&)in libLLVMScalarOpts.a(GVN.cpp.o) GetStoreValueForLoad(llvm::Value*, unsigned int, llvm::Type const*, llvm::Instruction*, llvm::TargetData const&)in libLLVMScalarOpts.a(GVN.cpp.o) GetStoreValueForLoad(llvm::Value*, unsigned int, llvm::Type const*, llvm::Instruction*, llvm::TargetData const&)in libLLVMScalarOpts.a(GVN.cpp.o) GetMemInstValueForLoad(llvm::MemIntrinsic*, unsigned int, llvm::Type const*, llvm::Instruction*, llvm::TargetData const&)in libLLVMScalarOpts.a(GVN.cpp.o) AnalyzeLoadFromClobberingWrite(llvm::Type const*, llvm::Value*, llvm::Value*, unsigned long long, llvm::TargetData const&)in libLLVMScalarOpts.a(GVN.cpp.o) AnalyzeLoadFromClobberingStore(llvm::Type const*, llvm::Value*, llvm::StoreInst*, llvm::TargetData const&)in libLLVMScalarOpts.a(GVN.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMScalarOpts.a(GVN.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMAnalysis.a(BasicAliasAnalysis.cpp.o) SymbolicallyEvaluateGEP(llvm::Constant* const*, unsigned int, llvm::Type const*, llvm::TargetData const*)in libLLVMAnalysis.a(ConstantFolding.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMAnalysis.a(ConstantFolding.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMSelectionDAG.a(DAGCombiner.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMAnalysis.a(AliasAnalysis.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMCodeGen.a(Analysis.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMCodeGen.a(StackProtector.cpp.o) llvm::ScalarEvolution::getTypeSizeInBits(llvm::Type const*) constin libLLVMAnalysis.a(ScalarEvolution.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMAnalysis.a(ScalarEvolution.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMSelectionDAG.a(FastISel.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMAnalysis.a(MemoryBuiltins.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMSelectionDAG.a(FunctionLoweringInfo.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMTransformUtils.a(AddrModeMatcher.cpp.o) llvm::ComputeMaskedBits(llvm::Value*, llvm::APInt const&, llvm::APInt&, llvm::APInt&, llvm::TargetData const*, unsigned int)in libLLVMAnalysis.a(ValueTracking.cpp.o) llvm::ComputeMaskedBits(llvm::Value*, llvm::APInt const&, llvm::APInt&, llvm::APInt&, llvm::TargetData const*, unsigned int)in libLLVMAnalysis.a(ValueTracking.cpp.o) llvm::ComputeNumSignBits(llvm::Value*, llvm::TargetData const*, unsigned int)in libLLVMAnalysis.a(ValueTracking.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMAnalysis.a(ValueTracking.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMSelectionDAG.a(LegalizeDAG.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMAnalysis.a(Loads.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMSelectionDAG.a(InstrEmitter.cpp.o) . . . ld: symbol(s) not found collect2: ld returned 1 exit status make[2]: *** [bin/llvm-mc] Error 1 make[1]: *** [tools/llvm-mc/CMakeFiles/llvm-mc.dir/all] Error 2 make: *** [all] Error 2 =============================================================== I just modify files in lib/Target/EBC/ and Triple.h/Triple.cpp. However there is some error message about building LLVM core. Would someone mind to tell me how could I solve this problem?? Thanks a lot Yi-Hong -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110507/9ce7443f/attachment.html>
Apparently Analagous Threads
- [LLVMdev] Question about linking llvm-mc when porting a new backend
- [LLVMdev] How to tell whether a GlobalValue is user-defined
- Build error
- issues with split llvm libraries and llvmpipe and failing to load library
- building release_50 with gcc7.2.0 on MacOS: duplicate symbol llvm::DominatorTreeBase