Hi all, Following the example from http://llvm.org/docs/GoldPlugin.html#example1 gives the following error on Ubuntu Karmic: /usr/bin/ld: error: a.a: no archive symbol table (run ranlib) /usr/bin/ld: /usr/lib/crt1.o:../sysdeps/i386/elf/start.S:115: error: undefined reference to 'main' /usr/bin/ld: b.o: in function foo1:b.c(.text+0x4): error: undefined reference to 'foo2' collect2: ld returned 1 exit status I suppose this is due to missing "--plugin libLLVMgold.so" option. Attached is a documentation patch that corrects this (also for nm). Best regards, Victor -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100405/a5151f15/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: docs-gold-plugin.diff Type: text/x-patch Size: 1134 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100405/a5151f15/attachment.bin>
On 5 April 2010 10:24, Victor Zverovich <victor.zverovich at googlemail.com> wrote:> Hi all, > Following the example > from http://llvm.org/docs/GoldPlugin.html#example1 gives the following error > on Ubuntu Karmic: > /usr/bin/ld: error: a.a: no archive symbol table (run ranlib) > /usr/bin/ld: /usr/lib/crt1.o:../sysdeps/i386/elf/start.S:115: error: > undefined reference to 'main' > /usr/bin/ld: b.o: in function foo1:b.c(.text+0x4): error: undefined > reference to 'foo2' > collect2: ld returned 1 exit status > I suppose this is due to missing "--plugin libLLVMgold.so" option.bfd (the library used by nm and ar) should try to search for the plugin in the bfd-plugins. Can you check that there is a link for the plugin in that directory?> Attached is a documentation patch that corrects this (also for nm). > Best regards, > Victor > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >Thanks, -- Rafael Ávila de Espíndola
Checked once again and it turned out that I created a link in to libLLVMgold.so in $PREFIX/libexec/gcc/i686-pc-linux-gnu/4.2.1/ and $PREFIX/lib/bfd-plugins/, but not in /usr/lib/bfd-plugins. Creating the latter solved the problem. Thanks Rafael and sorry for the noise. Victor On 23 April 2010 02:40, Rafael Espindola <espindola at google.com> wrote:> On 5 April 2010 10:24, Victor Zverovich <victor.zverovich at googlemail.com> > wrote: > > Hi all, > > Following the example > > from http://llvm.org/docs/GoldPlugin.html#example1 gives the following > error > > on Ubuntu Karmic: > > /usr/bin/ld: error: a.a: no archive symbol table (run ranlib) > > /usr/bin/ld: /usr/lib/crt1.o:../sysdeps/i386/elf/start.S:115: error: > > undefined reference to 'main' > > /usr/bin/ld: b.o: in function foo1:b.c(.text+0x4): error: undefined > > reference to 'foo2' > > collect2: ld returned 1 exit status > > I suppose this is due to missing "--plugin libLLVMgold.so" option. > > bfd (the library used by nm and ar) should try to search for the > plugin in the bfd-plugins. Can you check that there is a link for the > plugin in that directory? > > > Attached is a documentation patch that corrects this (also for nm). > > Best regards, > > Victor > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > > > Thanks, > -- > Rafael Ávila de Espíndola >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100423/accb4c19/attachment.html>