[LLVMdev] Compiling natively vsftp with LLVM

Nai Xia nelson.xia at gmail.com
Sat Jun 3 14:49:24 PDT 2006


I see. Thanks :)

On Saturday 03 June 2006 01:37, Chris Lattner wrote:
> On Fri, 2 Jun 2006, Nai Xia wrote:
> > And the command lines:
> >
> > llvm-gcc -c -o main.o main.c
> > gcc -o foo.o foo.c
> > ar rcs libfoo.a foo.o
> > llvm-gcc -Wl,-native main.o -L. -lfoo
> >
> > It's *OK*
> >
> > Thanks in advance for solving my problem. :)
> > And I personally think it may possiblely puzzle other users,
> > maybe it deserves its place in FAQ or in man page for LLVM.
> 
> I agree that this is an ugly issue.  You've basically fallen into the 
> "llvmgcc3 doesn't work the way a normal compiler does" problem.  If you 
> use llvmgcc4, it is completely transparent, and works just like a native 
> compiler, unless you provide the -emit-llvm switch.
> 
> If you'd like for this stuff to work, I'd suggest *not* using the gccld 
> "-native*" switches.  They are really only built to work when the whole 
> program is compiled with LLVM (ok, you can have native libraries, but no 
> native .o files).  If you'd like to link native .o files together with 
> LLVM .o files, you should run llc/as/ld directly on the LLVM code to do 
> things manually.
> 
> -Chris
> 

-- 
Regards,
Nai



More information about the llvm-dev mailing list