[LLVMdev] Difficulties in using gold plugin. ("ar" not working properly)

Istvan Haller istvan.haller at gmail.com
Wed Jun 15 06:03:06 PDT 2011


Dear all,
I'm trying to use the gold plugin to make it easier to generate LLVM bitcode
from complex applications. I did the steps mentioned on
"http://llvm.org/docs/GoldPlugin.html". Both linking and LLVM generation seem to
work properly, however when using the tool ar, the symbol table is lost. "no
archive symbol table (run ranlib)".

I'm using LLVM 2.9, Ubuntu 10.10, binutils 2.20.51 both from the repository and
hand built (with -enable-gold and -enable-plugins).

Both LLVMgold.so and libLTO.so are located in:
~/tools/libexec/gcc/x86_64-unknown-linux-gnu/4.2.1/
~/lib/bfd-plugins
/usr/lib/bfd-plugins

The following are the build commands:
llvm-g++ -use-gold-plugin -flto $test.cpp -c -o test.o
ar --plugin /usr/lib/bfd-plugins/LLVMgold.so crs test.a test.o
llvm-g++ -use-gold-plugin -Wl,-plugin-opt=also-emit-llvm test.a libstdc++.a -o

Maybe its just me doing some small error, but I can't see it..
Thanks for the help,
Istvan




More information about the llvm-dev mailing list