Answer the question
In order to leave comments, you need to log in
Why doesn't llvm-build see the new backend?
I'm writing a backend for LLVM, let's say it's called Abc . I copied the directory llvm/lib/Target/AVR
to llvm/lib/Target/Abc
, bash- and sed-scripts replaced in the file names and in the files themselves AVR with Abc , avr with abc . CMakeLists.txt
looks like that:
set(LLVM_TARGET_DEFINITIONS Abc.td)
tablegen(LLVM AbcGenRegisterInfo.inc -gen-register-info)
tablegen(LLVM AbcGenInstrInfo.inc -gen-instr-info)
tablegen(LLVM AbcGenCallingConv.inc -gen-callingconv)
tablegen(LLVM AbcGenSubtargetInfo.inc -gen-subtarget)
add_public_tablegen_target(AbcCommonTableGen)
add_llvm_target(AbcCodeGen
AbcInstrInfo.cpp
AbcRegisterInfo.cpp
AbcTargetMachine.cpp
AbcTargetObjectFile.cpp
)
add_dependencies(LLVMAbcCodeGen intrinsincs_gen)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
llvm/CMakeLists.txt
add Abc
to LLVM_ALL_TARGETS
, it writes the following:llvm-build: error: invalid target to enable: 'Abc' not in project
Abc
from LLVM_ALL_TARGETS
and assemble it with a key -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=Abc
- the same error. What else needs to be edited so that llvm-build "sees" my backend?
Answer the question
In order to leave comments, you need to log in
It was also necessary to add Abc tollvm/lib/Targets/LLVMBuild.txt
Try adding your target Abc
to the LLVM_ALL_TARGETS list located in the root CMakeLists. With this list, then all sorts of things are done, it seems to me that all the targets that are in the project should be there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question