[LLVMdev] Static code generation - is it gone from LLVM 2.7?

Chris Lattner clattner at apple.com
Fri Mar 26 19:08:49 PDT 2010


On Mar 26, 2010, at 6:24 PM, Peter Shugalev wrote:

> Hi,
> 
> Just realized that ability to generate static object code (e.g. ELF w/o
> using JIT) is no longer available in 2.7 (at least in release_27 branch).
> 
> For example
>> llc -filetype=obj whatever.bc
> doesn't work in Linux environment anymore (well it wasn't fully
> implemented before but it worked for simple bytecodes in 2.6).
> 
> I used to generate code by creating TargetMachine and
> FunctionPassManager, then calling TargetMachine::addPassesToEmitFile,
> then adding my own CodeEmitter/CodeWriter (exactly like llc does). I
> have to say I always hated code emitter interface but at least it worked
> for me.
> 
> Now LLVMTargetMachine::addPassesToEmitFile has changed. It adds its own
> code emitter and it's always MachOCodeEmitter which of course I don't need.
> 
> Is there a new way to create non-JIT object code in LLVM 2.7?

Nope, sorry.  This will hopefully be coming in 2.8.  Mainline llvm can already do macho quite robustly for x86-32 and x86-64.

-Chris



More information about the llvm-dev mailing list