[Vm-dev] The Mac VM (pharo)

Göran Krampe goran at krampe.se
Tue Oct 1 13:11:54 UTC 2013


Hey!

My mail filters were bogged up so I missed this discussion, sorry. Let 
me clarify some things:

First I wrote that "clang" is essentially the same as "gcc" but what I 
*MEANT* by that is that given the output from those two commands on a 
Mountain Lion - they BOTH invoke llvm-gcc.

On 09/26/2013 10:35 AM, Tobias Pape wrote:> Am 26.09.2013 um 10:06 
schrieb Eliot Miranda <eliot.miranda at gmail.com>:
>>>> No; very different.  I'm not an expert but I think essentially clang is
>>>> Apple's C compiler that uses the LLVM backend, and gcc is good old gcc.
>>>
>>> Not on a default Mac Xcode installation.
>>> See my OSX 10.8 + Xcode 4.x installation:
>>>
>>> $ ls -al $(which gcc)
>>> lrwxr-xr-x  1 root  wheel  12 24 Apr 16:42 /usr/bin/gcc -> llvm-gcc-4.2
>>>
>>> But with Xcode 5, no gcc (be it a pure gcc-4.2 or a llvm backed gcc)
>>> ships. gcc is linked to clang.
>>>
>>> It is a problem of default naming. From Xcode 5 on, if you don't change
>>> a thing, "gcc" will get you "clang".

And Tobias explained exactly what I meant - "gcc" and "clang" resolve to 
the SAME compiler under Mountain Lion.

>> I think you miss my point, which is that the clang compiler is very
>> different (it uses LLVM for its code generator) than gcc.
>
> I got that point, but I was under the impression, Göran wanted to
> make a different one.

Yes, thanks! :)

>> That apple calls
>> clang gcc is neither here-nor-there.  If you get a real gcc it will compile
>> a functional VM.  If you get a clang-based compiler it won't.  Do you agree?
>
> Yes, I did not want to argue that point :).

No, I don't agree! :) Because current PharoVM *DOES* compile and run 
using clang! Which is quite cool btw.

> But what is with the two-headed hydra, llvm-gcc (gcc frontend with llvm code-gen)?
> Since Xcode 4, apple by default does _not_ ship a "normal" gcc but only a
> llvm-based one, and with Xcode 5, even that is gone.
>    My point was not about code-gen but compiler-availability ;)
> However, yours seem more important ATM.
>
>>
>>>> Right now Cog doesn't run if compiled with clang.  Only gcc will do.  No

Nope, it compiles and run :). Performance seems to be the same as the 
Pharo VM that the Pharo guys build with GCC (not sure, but I think they 
use 4.2).

I am now working on a build using GCC 4.9 - not through it yet, but almost.


For some interesting silly benchmarks:

Stock binary pharo-vm (presume built with GCC 4.2???):
	133 million sends, 800 mill bytecodes.

Built with clang from Xcode 5:
	121 million sends, 790 mill bytecodes.

Binary 2776 from Eliot:
	114 mill sends, but 980 mill bytecodes.

3 years old OpenQwaq Cog VM compiled with Intel compiler:
	138 mill sends and 1000 mill bytecodes.


Hehe. So... will be interesting to see how GCC 4.9 fares in all this - 
but this is nice - we can compile using clang!

regards, Göran


More information about the Vm-dev mailing list