Istvan Haller
2011-Jun-15 13:03 UTC
[LLVMdev] Difficulties in using gold plugin. ("ar" not working properly)
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
Rafael Avila de Espindola
2011-Jun-15 18:10 UTC
[LLVMdev] Difficulties in using gold plugin. ("ar" not working properly)
On 11-06-15 09:03 AM, Istvan Haller wrote:> 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..Can you run nm on an IL file? What if you pass an explicit -plugin option to nm?> Thanks for the help, > IstvanCheers, Rafael
Executing nm --plugin /usr/lib/bfd-plugins/LLVMgold.so test.a Gives: 00000000 W _ZN6tester4dumpEv 00000000 W _ZN6tester7readArgEPc 00000000 W _ZN6testerC1Ev 00000000 W _ZN6testerD1Ev And and more entries Without the plugin command "File format not recognized". So it seems like nm is using the plugin. Istvan
Reasonably Related Threads
- [LLVMdev] Difficulties in using gold plugin. ("ar" not working properly)
- [LLVMdev] Difficulties in using gold plugin. (
- [LLVMdev] Difficulties in using gold plugin. (
- [LLVMdev] gold plugin example
- [llvm-toolchain v3.8.1] LTO: Linking clang hangs with ld.gold and LLVMgold.so plugin