Hi Rafael,<br><br>I've tried the LTO options with dragonegg, but I haven't had any luck getting it to work, I'm not sure if it is related to my installation of gold or my gcc configuration.<br><br>I'm really interested in getting the resulting program as bitcode though. Will LTO do that for me? What I'm trying to do is build a bitcode version of libc that I can combine with a program and analyze/optimize the resulting program.<br>

<br><br><br><div class="gmail_quote">2011/6/28 Rafael Ávila de Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div><div></div><div>On 11-06-28 10:45 PM, Gregory Malecha wrote:<br>
> Hello,<br>
><br>
> I've been trying to build some normal linux applications with clang and I keep running into a snag in configure scripts. Perhaps these scripts are not written very well, but the current clang behavior seems strange. When I run clang with the -emit-llvm option, it still uses /usr/bin/ld as the linker which fails to compile llvm bitcode on linux (though it works on mac). Here's a simple example:<br>



><br>
> $ cat > test.c<br>
> int main(void) { return 0; }<br>
> $ clang -emit-llvm test.c<br>
> /tmp/cc-pDfs56.o: file not recognized: File format not recognized<br>
> clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>
> $ clang -emit-llvm test.c -c<br>
> $<br>
><br>
> It seems to me that clang should call llvm-ld when it generates llvm code and ld otherwise, but maybe there's something that I have configured incorrectly. What is the appropriate way to address this?<br>
<br>
</div></div>llvm-ld is not a full replacement for a system ld. If you want to do LTO (which is why I assume you<br>
are using -emit-llvm), you should use a linker that support it. Gold support plugins and can<br>
use the LLVM one. Recently gnu ld implemented the same interface, but I haven't tested it.<br>
<br>
<a href="http://llvm.org/docs/GoldPlugin.html" target="_blank">http://llvm.org/docs/GoldPlugin.html</a><br>
<br>
> Thanks.<br>
<br>
Cheers,<br>
Rafael<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>gregory malecha<br>