Hello, I down loaded "llvm-gcc4.2-2.7-x86_64-linux" and I built Spec2006 with it. It is great and except for one benchmark the rest work fine. I want to build them with LTO now. I followed the directions in " http://llvm.org/docs/GoldPlugin.html" and built ar, nm-new, and ld-new in binutils. I also built libLLVMgold.so. I get the following error: llvm-gcc: -use-gold-plugin, but libLLVMgold.so not found. The command I used with the example in "http://llvm.org/docs/GoldPlugin.html" is: /home/reza/llvm-gcc4.2-2.7-x86_64-linux/bin/llvm-gcc -use-gold-plugin a.a b.o -o main I put libLLVMgold.so to /usr/lib/bfd-plugins and ar, nm-new and ld-new in /usr/bin/ar and /usr/bin/nm and /usr/bin/ld respectively. If I use the load by itself I get: ld -plugin /usr/lib/bfd-plugins/libLLVMgold.so a.a b.o -o main it loads but I get: reza at reza-desktop:~/gcc/trunk/test/mytest$ ./main Segmentation fault Thanks, Reza -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100721/882c1fd3/attachment.html>
On 21 July 2010 22:14, Reza Yazdani <ry.yazdani at gmail.com> wrote:> Hello, > > I down loaded "llvm-gcc4.2-2.7-x86_64-linux" and I built Spec2006 with it. > It is great and except for one benchmark the rest work fine. I want to build > them with LTO now. I followed the directions in > "http://llvm.org/docs/GoldPlugin.html" and built ar, nm-new, and ld-new in > binutils. I also built libLLVMgold.so. > I get the following error: > > llvm-gcc: -use-gold-plugin, but libLLVMgold.so not found. > > The command I used with the example in > "http://llvm.org/docs/GoldPlugin.html" is: > > /home/reza/llvm-gcc4.2-2.7-x86_64-linux/bin/llvm-gcc -use-gold-plugin a.a > b.o -o main > > I put libLLVMgold.so to /usr/lib/bfd-plugins and ar, nm-new and ld-new in > /usr/bin/ar and /usr/bin/nm and /usr/bin/ld respectively.You have to put a link to libLLVMgold.so in a place where llvm-gcc will find it. An easy one is the directory with cc1 in it.> If I use the load by itself I get: > > ld -plugin /usr/lib/bfd-plugins/libLLVMgold.so a.a b.o -o main > > it loads but I get: > > reza at reza-desktop:~/gcc/trunk/test/mytest$ ./main > Segmentation faultGCC adds other objects to the link that include startup code.> Thanks, > RezaCheers, -- Rafael Ávila de Espíndola
Thanks: copying to where cc1 was made it to work. Reza On Thu, Jul 22, 2010 at 9:23 AM, Rafael Espindola <espindola at google.com>wrote:> On 21 July 2010 22:14, Reza Yazdani <ry.yazdani at gmail.com> wrote: > > Hello, > > > > I down loaded "llvm-gcc4.2-2.7-x86_64-linux" and I built Spec2006 with > it. > > It is great and except for one benchmark the rest work fine. I want to > build > > them with LTO now. I followed the directions in > > "http://llvm.org/docs/GoldPlugin.html" and built ar, nm-new, and ld-new > in > > binutils. I also built libLLVMgold.so. > > I get the following error: > > > > llvm-gcc: -use-gold-plugin, but libLLVMgold.so not found. > > > > The command I used with the example in > > "http://llvm.org/docs/GoldPlugin.html" is: > > > > /home/reza/llvm-gcc4.2-2.7-x86_64-linux/bin/llvm-gcc -use-gold-plugin a.a > > b.o -o main > > > > I put libLLVMgold.so to /usr/lib/bfd-plugins and ar, nm-new and ld-new in > > /usr/bin/ar and /usr/bin/nm and /usr/bin/ld respectively. > > You have to put a link to libLLVMgold.so in a place where llvm-gcc > will find it. An easy one is the directory with cc1 in it. > > > If I use the load by itself I get: > > > > ld -plugin /usr/lib/bfd-plugins/libLLVMgold.so a.a b.o -o main > > > > it loads but I get: > > > > reza at reza-desktop:~/gcc/trunk/test/mytest$ ./main > > Segmentation fault > > > GCC adds other objects to the link that include startup code. > > > Thanks, > > Reza > > > Cheers, > -- > Rafael Ávila de Espíndola >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100722/d84da523/attachment.html>