[LLVMdev] LLVM "Native" Backend

Chris Lattner sabre at nondot.org
Sun Mar 18 17:05:54 PDT 2007


On Sun, 18 Mar 2007, Christopher Lamb wrote:
>> 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.
>
> Which of the LLVM tools can currently produce .o files directly
> without going through the platform's as/ld? How do I specify this on
> the command line to any of the tools?

llc -filetype=obj

I think that this is disabled for ELF, but you can easily enable it. 
Macho works pretty well, but ELF is not entirely finished.  Any help would 
be appreciated: basing the work on the macho writer would be appropriate.

>>> 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.
>
> I'm primarily considering this as an option for a custom target. My
> interest is in not having to do a binutils port, so currently I have
> no "real" assembler and linker.

LLVM doesn't have any support for linking native objects, you will need 
to get this somewhere.

>> 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.
>
> Is there an infrastructure in place (or a design) to work on such an
> inline assembler? I'd think that a lot of the tblgen information used
> for the Code/Asm emitters could be reused for this.

I agree with you, it should be a good starting place.  However, we don't 
have the infrastructure for this yet.

-Chris

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



More information about the llvm-dev mailing list