[Vm-dev] VM Platform contribution (Plan9)

Alex Franchuk alex.franchuk at gmail.com
Tue Dec 23 21:37:00 UTC 2014


There's been no port of gcc to Plan9 that I know of, but I haven't done
research into it. However it's better to compile with the Plan9 compiler,
as the Plan9 ecosystem is designed for distributed computing on many
architectures, so there are many conveniences offered which use their
compiler. For instance, makefiles can include the system makefile, which
defines which build tools to use (and each architecture has its own
compiler). This is in contrast to gcc's approach of passing flags to
specify architectures and whatnot. So that's why I made it a priority to
get compilation using all of the native Plan9 tools.
On Dec 23, 2014 3:49 PM, "Eliot Miranda" <eliot.miranda at gmail.com> wrote:

>
> Hi Alex,
>
> On Tue, Dec 23, 2014 at 11:43 AM, Alex Franchuk <alex.franchuk at gmail.com>
> wrote:
>
>>
>>
>> Hi Eliot,
>>
>> A couple examples of the issues which are present that the Plan9 compiler
>> complains about, and my changeset fixes:
>> Functions which declare a return type and don't return a value.
>> Absence of proper casting when assigning values.
>> Absence of proper casting of function pointers.
>> Some incorrect function parameters.
>>
>> All pretty basic stuff, it just so happens that the Plan9 compiler is
>> strict and cannot be told to back off on these points. I've looked at the
>> Cog VMMaker, but haven't had a chance to try porting the Cog VM to Plan9
>> yet, so just the interpreter VM has been ported right now. Is there any
>> chance that these changes just be in place for the interpreter VMMaker, or
>> do you try to apply changes to both VMMakers?
>>
>
> There's no hurry.  When you're ready to compile Cog and/or Spur for Plan9
> we can address the issues then.  The code in the Cog/Spur interpreter and
> the JIT is pretty clean.  The only warnings are to do with
> - shifts beyond the integer range that are in scope at compilation time
> but are optimised out during compilation because they apply to 64-bit code
> that is not used in the 32-bit VM
> - gcc warning about printf being used without a format string, when I'm
> passing a perfectly good string; it wants me to say printf("%s",s) instead
> of printf(s) and I'm too stubborn to waste the few bytes this would waste
> ;-)
>
> So hopefully there won't be too many problems.  Has no one ported gcc to
> Plan9 yet?
>
> Thanks,
>> Alex
>>
>
> Thank you!  A new platform is always exciting.
>
>
>> On Dec 23, 2014 12:36 PM, "Eliot Miranda" <eliot.miranda at gmail.com>
>> wrote:
>>
>>>
>>> Hi Alex,
>>>
>>>      exactly what issues have you had with the Plan 9 compiler and what
>>> are the changes to VMMaker you had to make?  You may have already written a
>>> message on this.  Of so, can you send me a link to it.  Otherwise it will
>>> help me integrating to know.  The Cog VMMaker's translation-to-C subsystem
>>> is quite different from the trunk VMMaker and straight-forward integration
>>> is probably not possible.
>>>
>>> On Tue, Dec 2, 2014 at 10:44 AM, Alex Franchuk <alex.franchuk at gmail.com>
>>> wrote:
>>>
>>>>
>>>>
>>>> On 12/02/2014 07:54 AM, David T. Lewis wrote:
>>>>
>>>>> On Mon, Dec 01, 2014 at 11:58:02AM -0500, Alex Franchuk wrote:
>>>>>
>>>>>> On 12/01/2014 10:34 AM, Eliot Miranda wrote:
>>>>>>
>>>>>>>   On Nov 30, 2014, at 8:21 PM, Alex Franchuk <
>>>>>>> alex.franchuk at gmail.com> wrote:
>>>>>>>
>>>>>>>  Hello all,
>>>>>>>>
>>>>>>>> I'm at a stage of stability in my port of Squeak to the Plan9
>>>>>>>> operating
>>>>>>>> system. I was wondering who I should contact, or where I should go,
>>>>>>>> to
>>>>>>>> either submit my work or get access to the SVN repository of
>>>>>>>> platforms
>>>>>>>> hosted at squeakvm.org. It didn't quite seem like the sort of
>>>>>>>> thing that
>>>>>>>> should be put on the Mantis bug tracker, but I could be wrong.
>>>>>>>>
>>>>>>>> Any push in the right direction would be much appreciated!
>>>>>>>>
>>>>>>> If your port uses Cog then please send me a tarball of the files
>>>>>>> plus some
>>>>>>> description of any changes you had to make.  And thanks!!
>>>>>>>
>>>>>> Currently it does not use Cog, although that is actually my next step
>>>>>> in
>>>>>> development if I have enough time! It just uses the normal interpreter
>>>>>> (as generated by VMMaker).
>>>>>>
>>>>>>  Hi Alex,
>>>>>
>>>>> I see that you have uploaded your Plan9-Compat.4.cs change set to the
>>>>> Mantis
>>>>> issue, thanks for doing that.
>>>>>
>>>>>    http://bugs.squeak.org/view.php?id=7821
>>>>>
>>>>> I think that you are working with a "trunk" VMMaker as your base. I
>>>>> may be
>>>>> able to help by testing your changes first with Linux and an
>>>>> interpreter VM.
>>>>>  From there, I should be able to forward the applicable changes to
>>>>> Eliot for Cog.
>>>>>
>>>>> I need to ask couple of questions so that I start from the right place:
>>>>>
>>>>> - Are all of the changes for Plan 9 compatibility in the change set
>>>>> for VMMaker?
>>>>> Or are there additional changes that need to be applied to the
>>>>> trunk/Cross or
>>>>> trunk/unix source code? If there are platforms files, please follow
>>>>> Eliot's
>>>>> suggestion of sending a tarball (or zip, or whatever is convenient).
>>>>> If it is
>>>>> not too large, please send it directly to the vm-dev list.
>>>>>
>>>>> - Which version of the VMMaker package did you start with? If you can
>>>>> give me
>>>>> a specific VMMaker mcz file that you initially loaded, or tell me what
>>>>> Squeak
>>>>> image you initially used, that would help. Or, try evaluating "VMMaker
>>>>> versionString"
>>>>> in your VMMaker image, and let me know what it says.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Dave
>>>>>
>>>>>
>>>> Hi Dave,
>>>>
>>>> To answer your questions:
>>>>
>>>> - I believe almost all of the changes in the change set are for
>>>> VMMaker, although there is a change to the abstract SequenceableCollection
>>>> object to add a doWithIndex:separatedBy: message.
>>>>
>>>> - The version of VMMaker that I started with was VMMaker-dtl.350, which
>>>> I loaded from source.squeak.org/VMMaker into a Squeak-4.5 image.
>>>>
>>>> I'll wrap up the platforms code into a tarball and send it to Eliot
>>>> (and the vm-dev list). Currently the platform code assumes that the
>>>> FilePlugin, SocketPlugin, B2DPlugin, and BitBltPlugin have been generated
>>>> as internal plugins with the interpreter code, I still need to make changes
>>>> for it to intelligently generate the makefile based on the configuration
>>>> (there are no autoconf tools in Plan9 so that will end up being some
>>>> script). So I will probably be making more changes as time goes on.
>>>>
>>>> Thanks,
>>>> Alex
>>>>
>>>
>>>
>>>
>>> --
>>> best,
>>> Eliot
>>>
>>>
>>
>
>
> --
> best,
> Eliot
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20141223/c7bca126/attachment.htm


More information about the Vm-dev mailing list