producing a single LLVM bitcode file using the LLVM gold plugin

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.

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

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.

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.

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

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