[LLVMdev] strict aliasing and LLVM

Chris Lattner clattner at apple.com
Fri Oct 29 23:14:28 PDT 2010


On Oct 29, 2010, at 10:21 PM, Xinliang David Li wrote:

> 
> 
> 2010/10/29 Rafael EspĂ­ndola <rafael.espindola at gmail.com>
> > clang -x c  foo.c -emit-llvm-bc -o /tmp/llvm_JnS1o8/foo.bc
> > (.text+0x20): undefined reference to `main'
> > collect2: ld returned 1 exit status
> > clang: error: linker (via gcc) command failed with exit code 1 (use -v to
> > see invocation)
> 
> Without a -c I think clang is trying to link the llvm IL file. For
> that to work you would need a linker that understands LLVM IL. Both
> the apple linker and gold support plugins for doing it.
> 
> Then it looks like a bug in llvmc driver -- -c is not passed to clang.

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.

-Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101029/9f0b3e4e/attachment.html>


More information about the llvm-dev mailing list