[LLVMdev] Porting LLVM to irix.

Reid Spencer rspencer at reidspencer.com
Tue Aug 22 08:33:52 PDT 2006


Hi Timothy,

On Tue, 2006-08-22 at 09:27 -0500, Timothy Baldridge wrote:
> Greetings!
> 
> As part of a compiler project I am working on, I am interested in
> porting LLVM to Irix/MIPS.

Great!

>  I figure I could start by working with the
> bytecode to C translation part of LLVM. 

Yes, we don't have a MIPS backend (yet) but starting the the C Backend
should work until you want to write the MIPS backend :)

> However, when I run configure,
> llvm is saying that it does not recognize the host I am working with.

Right, its not a supported platform (yet).

> 
> Are there any documents about how to port to a new OS/Instruction set?

No, but what you're facing isn't particularly difficult. To get
configure to recognize IRIX as a unix operating system, you need to put
these lines

  *-*-irix*)
    llvm_cv_link_all_option="-Wl,--whole-archive"
    llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
    llvm_cv_os_type="IRIX"
    llvm_cv_platform_type="Unix" ;;

into autoconf/configure.ac at line 109. This will tell LLVM the platform
name, platform type, and some options for the linker (please correct
them if they're not right). 

When you've made that change, rebuild the configure script by running
autoconf/AutoRegen.sh and then reconfigure LLVM. It should now recognize
your irix machine and configure it.

Please note that the *-*-irix* pattern must match your target triple. If
"irix" isn't the name of your operating system then change it to
something that does match.

> 
> Thanks,
> 
> Timothy

No problem.

There might be other things that you need to do after this step.  Just
drop us a line and we'll help.

Reid.




More information about the llvm-dev mailing list