<br><br><div class="gmail_quote">On Fri, Oct 29, 2010 at 11:14 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div></div><div class="h5"><br><div><div>On Oct 29, 2010, at 10:21 PM, Xinliang David Li wrote:</div><br><blockquote type="cite"><br><br><div class="gmail_quote">2010/10/29 Rafael 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>> clang -x c  foo.c -emit-llvm-bc -o /tmp/llvm_JnS1o8/foo.bc<br>
> (.text+0x20): undefined reference to `main'<br>
> collect2: ld returned 1 exit status<br>
> clang: error: linker (via gcc) command failed with exit code 1 (use -v to<br>
> see invocation)<br>
<br>
</div>Without a -c I think clang is trying to link the llvm IL file. For<br>
that to work you would need a linker that understands LLVM IL. Both<br>
the apple linker and gold support plugins for doing it.<br></blockquote><div><br></div><div>Then it looks like a bug in llvmc driver -- -c is not passed to clang.</div></div></blockquote><br></div></div></div><div>I strongly recommend not using llvmc unless you know exactly what you're doing and what the features and limitations of llvmc are.  Please use the clang driver.</div>
</div></blockquote><div><br></div><div>Is llvmc just a wrapper on top of  llvm-gcc and clang?  In search of a way to pass down internal llvm options ( I did not know about -m yet), I found that llvmc has -Wo, option (which does not work), that is why I tried it.  So many different driver programs makes it little confusing to newbies.</div>
<div><br></div><div>Thanks,</div><div><br>David</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div>
<br></div><font color="#888888"><div>-Chris</div><br></font></div></blockquote></div><br>