[LLVMdev] adding new target to configure script

Tom Stellard tom at stellard.net
Wed Sep 4 14:20:38 PDT 2013


On Wed, Sep 04, 2013 at 02:00:13PM -0700, Preston Briggs wrote:
> I'm experimenting with a new backend, hoping to build a cross compiler, and
> reading "Writing an LLVM Compiler Backend". Early on, in "Preliminaries",
> it suggests editing my configure script to add my new target to the
> TARGETS_TO_BUILD variable, suggesting some creativity may be required.
> 

If you configure with --enable-experimental-targets=Preston assuming
that your backend is in lib/Target/Preston and you have updated all the
LLVMBuild.txt files, then you should be able to build your backend
without updating the configure script.

> I'm perhaps not creative enough, 'cause I can't get it to work. I tried a
> couple of variations (one seemed straightforward; in the other, I went
> through looking for every example of Sparc to see how they did it and
> making the appropriate changes).
> 
> I tried configuring like this
> 
>     ./configure --enable-target=preston --disable-optimized
> --enable-assertions=yes --prefix=/path-to-install
> 
> and it chunked along for a while, but ultimately failed, complaining
> 
>     configure: error: Unrecognized target preston
>     configure: error: ./configure failed for projects/sample
> 

Did you update the configure script in projects/sample ?

-Tom



More information about the llvm-dev mailing list