[LLVMdev] LLVM "Native" Backend

Chris Lattner sabre at nondot.org
Sat Mar 17 14:09:20 PDT 2007


On Fri, 16 Mar 2007, Christopher Lamb wrote:
> Having read through the documentation and browsed the code what are the 
> missing pieces, if any, required to implement a "native" LLVM backend that:
> * is able to produce loadable (ELF) object files with DWARF debugging 
> information
> * handle inline assembly
> * perform linker all necessary linking fixups

Sure, this should be no problem.  I'd start with the sparc backend, it's 
very simple and straight-forward place to start.

LLVM can currently produce .o files directly in some limited cases, or you 
can go through an assembler, which is much more robust.  Any help 
improving the direct ELF writer would be appreciated.

> This assumes that there will be no native object file linking stage in the 
> tool chain.

LLVM works will your standard tool components, like the gnu linker, 
assembler, etc.

> From what I can tell the ELF writer should be able to produce the object 
> files, but a DWARF-in-ELF writer would have to be created to insert the 
> debugging information into the ELF file.

Yep

> Either the inline assembly would be reverse compiled or handled by custom 
> pass. I'm not sure what the options are here...

Inline asm is very tricky, it basically amounts to LLVM having an 
assembler for each target.  We're not oppposed to this, but it is a 
significant amount of work.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list