<br><br><div><span class="gmail_quote">On 9/12/07, <b class="gmail_sendername">Chris Lattner</b> <<a href="mailto:sabre@nondot.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">sabre@nondot.org
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wed, 12 Sep 2007, Dound wrote:<br>> I am trying compile a libc with llvm (currently uclibc).  I am able to<br>> compile uclibc by changing the Rules.mak to use llvm-gcc, llvm-ar, llvm-ad,<br>> and not using strip.  (I also use the --emit-llvm flag for llvm-gcc).  When
<br>> I run llvm-nm on libc.a (or try to use libc.a) I run into problems.  For<br>> example, strlen is not defined -- llvm-nm shows that strlen.os has<br>> __GI_strlen while if I compile with the "normal" tools (gcc, ar, ...)
<br>> strlen.os has __GI_strlen as well as strlen listed (both have the symbol<br>> value 00000000).<br>><br>> Any ideas why the archive I create with llvm doesn't define the strlen (and<br>> most other) symbols but does define the __GI_strlen?
<br><br>Can you paste the output of nm for the native GCC version?  It's possible<br>that uclibc is using aliases for these, and it seems very likely that<br>llvm-nm just isn't printing aliases at all.  Anton, do you want to see if
<br>llvm-nm should be extended by this?</blockquote><div><br>Sure, thanks for your thoughts ... it is  a little long so I'll just include links to the nm output:<br><br>nm on the gcc generated native archive: <a href="http://www.dound.com/tmp/nm-native.txt">
http://www.dound.com/tmp/nm-native.txt</a><br>llvm-nm on the llvm generated archive: <a href="http://www.dound.com/tmp/nm-llvm.txt">http://www.dound.com/tmp/nm-llvm.txt</a><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

> I'm sure it is obvious by now, but I am pretty new to LLVM -- thanks in<br>> advance for your help and time!<br><br>Happy to help!<br><br>> PS.  Also, out of curiosity, was someone able to successfully compile all or
<br>> part of glibc?  I saw it was on the open projects page a few years ago<br>> (thanks to the old CVS data) but could not find the revision in which it was<br>> removed from that list.  I suspect that because it was removed, perhaps
<br>> someone else has figured it out and I could see what they did and try to<br>> compile it myself?<br><br>I don't know of anyone who has tried.  If you try it and run into bugs,<br>please file bugzilla entries!
<br><br>-Chris</blockquote><div><br>Thanks! ~ David <br></div><br></div><br>