[LLVMdev] strict aliasing and LLVM

Xinliang David Li xinliangli at gmail.com
Fri Oct 29 23:30:09 PDT 2010


On Fri, Oct 29, 2010 at 11:14 PM, Chris Lattner <clattner at apple.com> wrote:

>
> 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.
>

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.

Thanks,

David



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


More information about the llvm-dev mailing list