[LLVMdev] Out of tree targets

Neil Henning llvm at duskborn.com
Mon Mar 9 09:08:36 PDT 2015


Hey all,

Quick query on out of tree target support - at present I can drop a 
folder Foo into <llvm>/lib/Target/Foo and use the CMake option 
LLVM_EXPERIMENTAL_TARGETS_TO_BUILD to pick up my target. The issue is 
that I still need to patch the one LLVMBuild.txt file in 
<llvm>/lib/Target with;

|iff --git a/lib/Target/LLVMBuild.txt b/lib/Target/LLVMBuild.txt
index 4112046..6e42cbe 100644
--- a/lib/Target/LLVMBuild.txt
+++ b/lib/Target/LLVMBuild.txt
@@ -16,7 +16,7 @@
  ;===------------------------------------------------------------------------===;

  [common]
-subdirectories = ARM AArch64 BPF CppBackend Hexagon MSP430 NVPTX Mips PowerPC R600 Sparc SystemZ X86 XCore
+subdirectories = ARM AArch64 BPF CppBackend Hexagon MSP430 NVPTX Mips PowerPC R600 Sparc SystemZ X86 XCore Foo

  ; This is a special group whose required libraries are extended (by llvm-build)
  ; with the best execution engine (the native JIT, if available, or the|

To include my target in the LLVM build, and this allows me to specify 
-march=foo and it will call into my code correctly.

Am I missing something - or is this patch definitely required?

If the patch is required - does anyone have any suggestions/ideas how I 
could add support to either LLVMBuild or the specific LLVMBuild.txt file 
so that it would pick up my new Target?

I understand that my patch is tiny and relatively easy to maintain (it 
will basically always merge well) - but it still irks me having to keep 
a patch where it probably isn't required!

Cheers,
-Neil.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150309/61205570/attachment.html>


More information about the llvm-dev mailing list