我想为新目标构建编译器,然后选择llvm。据我所知,我可以使用clang项目作为前端,将llvm作为后端。我可以从IE中获取.o文件(llvm的一部分)。现在我需要将它们全部链接到可执行文件中。我尝试使用lld项目,但编译时失败了错误:
Desktop/llvm_project/llvm/lib/Target/ARM/ARMISelLowering.cpp: In member function ‘llvm::Instruction* llvm::ARMTargetLowering::makeDMB(llvm::IRBuilder<>&, llvm::ARM_MB::MemBOpt) const’:
Desktop/llvm_project/llvm/lib/Target/ARM/ARMISelLowering.cpp:11000:73: error: could not convert ‘{(& Builder)->llvm::IRBuilder<>::<anonymous>.llvm::IRBuilderBase::getInt32(15u), (& Builder)->llvm::IRBuilder<>::<anonymous>.llvm::IRBuilderBase::getInt32(0u), (& Builder)->llvm::IRBuilder<>::<anonymous>.llvm::IRBuilderBase::getInt32(0u), (& Builder)->llvm::IRBuilder<>::<anonymous>.llvm::IRBuilderBase::getInt32(7u), (& Builder)->llvm::IRBuilder<>::<anonymous>.llvm::IRBuilderBase::getInt32(10u), (& Builder)->llvm::IRBuilder<>::<anonymous>.llvm::IRBuilderBase::getInt32(5u)}’ from ‘<brace-enclosed initializer list>’ to ‘llvm::ArrayRef<llvm::Value*>’
Builder.getInt32(10), Builder.getInt32(5)};
^
make[2]: *** [lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMISelLowering.cpp.o] Error 1
make[1]: *** [lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/all] Error 2
make: *** [all] Error 2
所以我有几个问题,因为我觉得我错过了一些东西:
uname -a
gcc -v
答案 0 :(得分:0)
您遇到的错误是llvm本身,而不是lld。我在buildbots上没有看到错误,因此我建议您更新源代码树。
对于binutils,llvm目前不提供完全替代它们。这项工作正在进行中,但它还需要一段时间才能完成。现在我建议使用带有ld或gold作为链接器的gnu binutils。