llvm-build: error: invalid native target: XYZ (not in project)

I am trying to build cross compiler for custom processor (say XYZ) but
on compilation it is giving error

llvm-build: error: invalid native target: XYZ (not in project)

I have tried configuring like these

  1. ./configure --target=XYZ
  2. ./configure --target=XYZ --enable-targets=XYZ
  3. ./configure --enable-targets=XYZ

But every time it is not recognising the XYZ processor.
What could be the problem?

Thanks & Regards
VSP

You need to add your target to autoconf/configure.ac. Here are the directions from http://llvm.org/docs/WritingAnLLVMBackend.html

To get LLVM to actually build and link your target, you need to add it to the TARGETS_TO_BUILD variable. To do this, you modify the configure script to know about your target when parsing the --enable-targets option. Search the configure script for TARGETS_TO_BUILD, add your target to the lists there (some creativity required), and then reconfigure. Alternatively, you can change autotools/[configure.ac](http://configure.ac) and regenerate configure by running ./autoconf/AutoRegen.sh.

Thanks for your suggestion.
I get it done.

VSP