[LLVMdev] producing a single LLVM bitcode file using the LLVM gold plugin
Cristian Zamfir
cristian.zamfir at epfl.ch
Wed Jun 22 06:19:05 PDT 2011
On Jun 14, 2011, at 1:13 AM, Nick Lewycky wrote:
> On 13 June 2011 15:37, Cristian Zamfir <cristian.zamfir at epfl.ch> wrote:
> Hello,
>
> Is it still possible to produce the LLVM bitcode after linking using the LLVM gold plugin?
> I get the warning "ld: warning: Ignoring flag also-emit-llvm" and the LLVM bitcode is not dumped.
>
> I installed the LLVM gold plugin using the latest binutils from CVS and LLVM 2.6, since I read on the discussion list that this was possible with LLVM 2.6.
>
> No, that flag to the gold plugin was added Jun 3, 2010 while LLVM 2.6 was released Oct 23, 2009.
Great, thanks, indeed it works with LLVM 2.9 and the latest binutils.
>
> If all you want to do is merge multiple .bc files into one, you can run "llvm-link *.bc -o linked.bc". If you want to optimize, "opt -std-link-opts linked.bc -o linked.optimized.bc" will work too.
I wanted to ease the compilation to LLVM for various projects that already have a build system, such as Apache httpd. I could easily get a bitcode of httpd now.
Cristi
> The gold plugin is really for use when linking bitcode with non-bitcode (system libraries). If you need that and also want to emit .bc files, you'll need to upgrade.
>
> Nick
>
>
> This is the command I use:
> lvm-gcc -Wall -g --emit-llvm -O4 -use-gold-plugin -Wl,-plugin-opt=also-emit-llvm test.c f.c -o main
> ld: warning: Ignoring flag also-emit-llvm
>
> Can somebody please clarify if this option is still supported? If not, if anybody is working on enabling it again (or maybe have some tips on where to start) ?
>
> Thank you.
> Cristi
>
>
>
> _______________________________________________
> 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