[Vm-dev] VM dev and compilation

Bruno Durin bruno.durin at gmail.com
Fri Aug 11 13:54:33 UTC 2017


Hi,

I have been tinkering with Pharo and Squeak for a few weeks and I am very
enthusiastic with these great pieces of software! I would like to ask
questions to check my understanding. I am refering from time to time to
Squeak as it runs on the same VM as Pharo but my questions are focused on
Pharo.

As an exercice to learn, I am trying to compile Pharo VMs and get the VM
simulator run in a Pharo image (first a 32-bit image+VM and later a 64-bit
image+VM).
I am doing this both under Ubuntu 14.04 LTS and Mac OS X 10.12.6.
What I succeeded in doing:
- compiling the squeak and pharo VM using the state of their respective git
repo as of about 20 July 2017: on Mac both 32 and 64 bits, on Linux only 64
bits (mainly because I did not want to spend the time to fix the 32-bit
libraries which do not coexist well with their 64-bit counterparts),
- on Mac, generating the VM development image (SpurVMMaker) for Squeak on
top a (32 bits) V5 image, launch it and run the VM simulator,
- on Mac, generating the VM development image (generator.image) for Pharo
on top of a (32 bits) V5 image, launch it and starting to run a
CogVMSimulator (which currently fails, but I am debugging it and learning
along the way.)

So, my questions:

1) About the Pharo VM compilation (Below "the" Pharo VM means the official
VMs that are published on the Pharo website but if VM developers use a
different process between 2 releases I would be happy to know the
differences.)
a) is it correct that the Pharo VM is built using the github pharo-vm
repository?
b) in the pharo-vm tree, is it correct that "build" and "results"
directories are remnant of the build process before Pharo reunited with
Squeak on opensmalltalk vm and that the builder classes in the
generator.image (PharoVMSpur32Builder and co) do not create the build.sh
script in the "build" directory any more.
c) is it correct that the Pharo VM is now built with the pharo.cog.spur
(for example) make process in the various build sub-directories of the
"opensmalltalk-vm" directory?

2) When running a Pharo VM compiled on Mac, the GUI was noticeably slower
that the official VM downloaded from pharo.org. (I compared running the
official image.) I did not see such slow down when compiling a Squeak VM.
My educated guess is that it is related to libcairo and dependencies. Are
there compiler optimisations that I should have manually added? Should I
generate a XCode project with cmake and compile in XCode (I currently use
./mvm make script)? I have not had this problem under Linux.

3) On Mac, is the difference between having the plugins as Mach-O bundle in
Squeak and as dylib libraries in Pharo only a packaging choice or does it
have deeper implications? (Does it change for example the way FFI is done?)

4) Do I understand well that currently the simplest way to convert a 32-bit
image to a 64-bit one is to use Spur32to64BitBootstrap class in a VM
development image? (As far as I understand, the other way is to use
SystemTracer.)

A remark: when manually compiling a Pharo VM in the pharo-vm repo following
Eliot's instructions, the updateSCCSVersions script does not work (because
it is one level down with respect to the top of the git tree as compared to
the opensmalltalk-vm repository). I eventually understood that the correct
build procedure is in the travis scripts but as I do not know well the CI
tools, it took a long time before I thought of looking into these scripts.
If pharo-vm is used to build the Pharo VM (see question 1.a) I think it
would be good to update the build process in README.md in pharo-vm tree
(and I can do it).

Thanks,
Bruno

PS: Torsten Bergmann advised to repost here (initially posted on
pharo-users).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170811/c96e112e/attachment.html>


More information about the Vm-dev mailing list