Hi,<div><br></div><div>Thanks for the pointers. I built binutils and installed them in the same place as llvm-gcc. However, I see the following error at the link step:</div><div><div>$ llvm-gcc prog.c libctest.a </div><div>
collect2: ld terminated with signal 6 [Aborted]</div><div>/tmp/llvm-gcc4.2-2.9-x86_64-linux/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.1/../../../../x86_64-unknown-linux-gnu/bin/ld: error: libctest.a: malformed archive header name at 8</div>
<div>terminate called after throwing an instance of 'std::length_error'</div><div>  what():  basic_string::assign</div></div><div><br></div><div>I have copied over ld.gold to ld:</div><div>$ diff ld.gold ld</div><div>
$</div><div><br></div><div>If I use -use-gold-plugin, llvm-gcc says:</div><div>llvm-gcc: -use-gold-plugin, but LLVMgold.so not found.</div><div><br></div><div>I created the following shell script (called it `ld') and placed it into the same directory as llvm-gcc:</div>
<div>$ cat ld</div><div><div>#!/bin/sh</div><div><br></div><div>/tmp/llvm-gcc4.2-2.9-x86_64-linux/bin/ld.gold -plugin ${HOME}/apps/llvm/LLVMgold.so $*</div></div><div>$</div><div><br></div><div>But the output from llvm-gcc does not change. Any clue whats wrong?</div>
<div><br></div><div>There is no /usr/lib/bfd-plugins nor is there a lib/bfd-plugins in the location where the new binutils was installed. Where is this file supposed to be copied?</div><div><br></div><div>Ashay</div><div>
<br></div><div><br><div class="gmail_quote">On Tue, Aug 9, 2011 at 2:12 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, Aug 9, 2011 at 12:03 PM, Ashay Rane <<a href="mailto:ashay.rane@asu.edu">ashay.rane@asu.edu</a>> wrote:<br>
> `/usr/bin/ld -v' says it is not running gold and I suppose fixing that would<br>
> require place LLVMgold.so into /usr/lib/bfd-plugins. Is there any way to<br>
> make this work without requiring root access to the machine?<br>
<br>
</div>If you install your own version of binutils into the same prefix as llvm-gcc,<br>
it should get used instead of the one in /usr/bin/.<br>
<div class="im"><br>
> Also, just to confirm, is the gold plugin required even when all of the<br>
> files have been compiled/built using llvm-gcc and llvm-ar?<br>
<br>
</div>You can try llvm-ld... it isn't a fully general linker, but it might<br>
be good enough for your purposes.<br>
<font color="#888888"><br>
-Eli<br>
</font></blockquote></div><br></div>