[LLVMdev] Different Runtimes using clang-gcc and clang-opt-llc-gcc

Suresh Purini suresh.purini at gmail.com
Wed Jun 8 05:14:05 PDT 2011


Hello,

  I have trouble compiling programs using clang on Ubuntu-Natty
(getting some linker errors). So I generated a object file using "-c"
and then used gcc to generate the final executable. It worked fine.

I tried the following method also:

$ clang -O0 -c -flto foo.c
$ llc foo.o
$ gcc foo.o.s

It also worked. However the problem is I am getting different runtimes
using the two different methods. The executable generated using the
second method is running faster than the one generated using the first
method. I am confused as in both cases I am using -O0.

In general if I want measure runtimes which of the two methods is more accurate.

Thanks in advance.
-Suresh

PS: Is there any fix for the linker errors generated by clang on Natty.



More information about the llvm-dev mailing list