On 9/12/07, <b class="gmail_sendername">Chris Lattner</b> <<a href="mailto:sabre@nondot.org">sabre@nondot.org</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style=""><br><div><span class="q"><div>On Sep 12, 2007, at 3:56 PM, Dound wrote:</div><br><blockquote type="cite">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:<div><span class="gmail_quote"></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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
 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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.dound.com/tmp/nm-llvm.txt
</a></div></div></blockquote><div><br></div><br></span>Okay, this doesn't look like an alias issue :).  WIthout more information, I can't tell what is going on.  Please build the file that produces strlen.os with the -E option to get preprocessed output, and attach it to a bugzilla entry.  With that we can figure out what is happening.
</div><div><br></div><div>Thanks,</div><span class="sg"><div><br></div><div>-Chris</div></span></div></blockquote><div><br>Thanks, I  have submitted this to bugzilla (#1655 -- <a href="http://llvm.org/bugs/show_bug.cgi?id=1655">
http://llvm.org/bugs/show_bug.cgi?id=1655</a>).  I have included in that report an attachment of the object code generated for one particular function (strcpy) from both GCC and LLVM.  I also include the preprocessor output from both (-E) as well as the preprocessor output from LLVM after I make a change to an input file (described in the report #1655) since with that change I am able to get both GCC and LLVM to produce the symbol I need, 
e.g. T strcpy.<br><br>The diffs between the GCC/LLVM outputs and the two LLVM preprocessor outputs is pretty small, so hopefully someone who is knowledgeable about LLVM will be able to figure out what is going wrong (or what I'm doing wrong).
<br><br>Thanks again for the help!<br><br>~ David<br></div><br></div>