[LLVMdev] RE: while i have your attention...

Chris Lattner sabre at nondot.org
Fri Jul 25 23:52:01 PDT 2003


On Fri, 25 Jul 2003, Nicholas Rizzolo wrote:
> i want to link several source files together into one bytecode file
> without gcc performing any optimizations.  first step:
>
>   llvmgcc -c -S code.c
>
> which produces a code.s file.  next i tried:
>
>   as code.s
>
> but that produced a .bc file instead of the .o file i was hoping for.

".bc" and ".o" files are identical in contents, they just differ in
suffix.

> can i link the .bc file in with other object files, eg:
>   llvmgcc -o code stuff.o code.s.bc

That will do more than you want.  It will link in the standard C libraries
and some other support stuff, using the gccld utility.  If you _just_ want
to link the two bytecode files together into a new bytecode file, use the
'link' utility like this:

link stuff.o code.s.bc -o out.bc

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list