how to output the single bitcode file using gold plugin?

Hi, all. I want to get the single bitcode file after link-time optimizations. After doing some searching, I get commands as follows:

llvm-gcc -O4 -c xxx.c -o xxx.o
llvm-gcc xxx.o -use-gold-plugin -Wl,-debug -Wl,-plugin-opt=also-emit-llvm -lm -o xxx

But these command don’t give me the wanted bitcode file. The used version of llvm is 2.7.

Do you have any idea of this problem or any other solution to get the bitcode file with gold plugin? Thanks.

Xiaoming

xiaoming gu wrote:

Hi, all. I want to get the single bitcode file after link-time
optimizations. After doing some searching, I get commands as follows:

/llvm-gcc -O4 -c xxx.c -o xxx.o
llvm-gcc xxx.o -use-gold-plugin -Wl,-debug
-Wl,-plugin-opt=also-emit-llvm -lm -o xxx/

But these command don't give me the wanted bitcode file. The used
version of llvm is 2.7.

If you just want to produce a bitcode file, I'd use:

   llvm-gcc -O4 -c xxx1.c -o xxx1.bc
   llvm-link xxx1.bc xxx2.bc ... -o yyy.bc
   opt -std-link-opts yyy.bc -o zzz.bc

and avoid gold altogether.

Do you have any idea of this problem or any other solution to get the
bitcode file with gold plugin? Thanks.

I don't think the -also-emit-llvm flag was implemented in the gold plugin as of the 2.7 release, so no.

Nick