Peter Shugalev
2010-Mar-27 01:24 UTC
[LLVMdev] Static code generation - is it gone from LLVM 2.7?
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? -- Best Regards Peter Shugalev
Chris Lattner
2010-Mar-27 02:08 UTC
[LLVMdev] Static code generation - is it gone from LLVM 2.7?
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
Peter Shugalev
2010-Mar-27 10:41 UTC
[LLVMdev] Static code generation - is it gone from LLVM 2.7?
Chris Lattner wrote:> 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 >What exactly is expected to be coming? Will it be the same way MachO is currently implemented but with some flexibility to supply my own class to do actual object output? Or just a return of old ObjectCodeEmitter? -- Best Regards Peter Shugalev
Maybe Matching Threads
- [LLVMdev] Static code generation - is it gone from LLVM 2.7?
- [LLVMdev] Static code generation - is it gone from LLVM 2.7?
- [LLVMdev] Static code generation - is it gone from LLVM 2.7?
- [LLVMdev] Static code generation - is it gone from LLVM 2.7?
- [LLVMdev] Static code generation - is it gone from LLVM 2.7?