[LLVMdev] standalone llvm

Simon Burton simon at arrowtheory.com
Wed Apr 12 21:13:55 PDT 2006


On Wed, 12 Apr 2006 22:48:16 -0500
Patrick Meredith <pmeredit at uiuc.edu> wrote:

> 
> On Apr 12, 2006, at 10:23 PM, Simon Burton wrote:
> 
> >
> > Is it possible to get llvm to generate native machine code
> > without using gcc and friends ? Do I use lli ?
> 
> llc.  llc --help lists all the options.  it compiles llvm bytecode  
> files.

It seems this does not yet work on X86. Are there some restrictions I could
adhere to in order to get something to work ?

Simon.

$ llc -filetype=dynlib -f -o=helloworld.so helloworld.bc
llc: target 'X86' does not support generation of this file type!

$ llc -filetype=obj -f -mcpu=i386 -march=x86 -o=helloworld.o helloworld.bc
llc: ELFWriter.cpp:81: virtual void llvm::ELFCodeEmitter::addRelocation(const llvm::MachineRelocation&): Assertion `0 && "relo not handled yet!"' failed.
llc((anonymous namespace)::PrintStackTrace()+0x1a)[0x8ac5736]
llc((anonymous namespace)::SignalHandler(int)+0xed)[0x8ac59cb]
[0xffffe420]
/lib/tls/libc.so.6(abort+0x1d2)[0xb7dc7fa2]
/lib/tls/libc.so.6(__assert_fail+0x10f)[0xb7dc02df]
llc(llvm::ELFCodeEmitter::getConstantPoolEntryAddress(unsigned int)+0x0)[0x88ef650]
llc((anonymous namespace)::Emitter::emitGlobalAddressForPtr(llvm::GlobalValue*, int)+0x77)[0x866ac5d]
llc((anonymous namespace)::Emitter::emitInstruction(llvm::MachineInstr const&)+0xc0b)[0x866c1b1]
llc((anonymous namespace)::Emitter::emitBasicBlock(llvm::MachineBasicBlock const&)+0xac)[0x866a9f8]
llc((anonymous namespace)::Emitter::runOnMachineFunction(llvm::MachineFunction&)+0x115)[0x866a859]
llc(llvm::MachineFunctionPass::runOnFunction(llvm::Function&)+0x29)[0x85f3421]
llc(llvm::FunctionPassManagerT::runPass(llvm::FunctionPass*, llvm::Function*)+0x1f)[0x89e39b5]
llc(llvm::PassManagerT<llvm::FTraits>::runPasses(llvm::Function*, std::map<llvm::Pass*, std::vector<llvm::Pass*, std::allocator<llvm::Pass*> >, std::less<llvm::Pass*>, std::allocator<std::pair<llvm::Pass* const, std::vector<llvm::Pass*, std::allocator<llvm::Pass*> > > > >&)+0x13f)[0x89e52b7]
llc(llvm::PassManagerT<llvm::FTraits>::runOnUnit(llvm::Function*)+0x17f)[0x89e4d11]
llc(llvm::FunctionPassManagerT::runOnFunction(llvm::Function&)+0x25)[0x89e5583]
llc(llvm::FunctionPass::runOnModule(llvm::Module&)+0xa7)[0x8989c63]
llc(llvm::ModulePassManager::runPass(llvm::ModulePass*, llvm::Module*)+0x1f)[0x89e3b95]
llc(llvm::PassManagerT<llvm::MTraits>::runPasses(llvm::Module*, std::map<llvm::Pass*, std::vector<llvm::Pass*, std::allocator<llvm::Pass*> >, std::less<llvm::Pass*>, std::allocator<std::pair<llvm::Pass* const, std::vector<llvm::Pass*, std::allocator<llvm::Pass*> > > > >&)+0x13f)[0x89e5e1b]
llc(llvm::PassManagerT<llvm::MTraits>::runOnUnit(llvm::Module*)+0x17f)[0x89e5875]
llc(llvm::ModulePassManager::runOnModule(llvm::Module&)+0x25)[0x8988cc9]
llc(llvm::PassManager::run(llvm::Module&)+0x23)[0x898906d]
llc(main+0xd8c)[0x84f50b0]
/lib/tls/libc.so.6(__libc_start_main+0xf4)[0xb7db3974]
llc[0x84f4281]
Aborted


-- 
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 02 6249 6940
http://arrowtheory.com 




More information about the llvm-dev mailing list