[LLVMdev] I try to compile to LLVM code

Samuel Crow samuraileumas at yahoo.com
Fri Aug 13 00:57:42 PDT 2010


llc is the bitcode to native Assembly compiler.  Once you have it compiled you 
can assemble the output with the gas assembler and link with the C runtime 
library using ld.

If you want to run the bitcode directly, you use lli instead.  That uses a JIT 
by default or, if JIT is unsupported on your platform, an interpreter.  Also, 
when running lli from the command line, I don't think you need to do anything 
special to link the C runtime library since lli already uses it.

If you want to use garbage collection, you need to run a programming language 
that supports garbage collection like Objective C 2.0.  By default, C doesn't 
support garbage collection.


----- Original Message ----
> From: Borneq <borneq at wp.pl>
> To: llvmdev at cs.uiuc.edu
> Sent: Fri, August 13, 2010 1:36:07 AM
> Subject: Re: [LLVMdev] I try to compile to LLVM code
> 
> 
> 
> Samuel Crow wrote:
> > 
> > If you want to compile bitcode into  assembly, you need to invoke the
> > llvm-as and 
> > llc commands on it  to convert it from LLVM Assembly source to bitcode and
> > then 
> >  native assembly source instead of llvm-gcc.
> > 
> llvm-as compiled hello.s  to hello.s.bc. How link it with stdio - I use
> printf
> llc is virtual  machine? If I call llc with hello.s.bc it do nothing (because
> printf not  linked)
> LLVM serve garbage collection? How use it? If I write "p=malloc(100)"  it
> probably not free with GC. How write finalizer method called before  free?
> 
> -- 
> View this message in context:  
>http://old.nabble.com/I-try-to-compile-to-LLVM-code-tp29411016p29426020.html
> Sent  from the LLVM - Dev mailing list archive at Nabble.com.
> 
> _______________________________________________
> LLVM  Developers mailing list
> LLVMdev at cs.uiuc.edu           http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 


      



More information about the llvm-dev mailing list