[M3devel] help booting CM3 on FreeBSD 4.11?

Jay jay.krell at cornell.edu
Sat Apr 25 01:21:49 CEST 2009


> By the way, I take it booting the compiler "old-fashionedly" with
> PM3 is out of the question?


What is the PM3 way?
  The SRC way is out of the question at least (unless you want to /start/ with it and go through a few releases...).

I gather that the PM3 was good and could be resusitated.
But it is is some work..maybe too much.

I gather that PM3 factored out word size and endianness from the IL?
And padding/alignment? And jmpbuf size?
  And whatever else is target-dependent?
  There isn't much.
Not impossible, but seems a bit onerous.

padding/alignment actually don't have to be factored out, kind of.
They can be made "worst case", as long as the interactions with C are correct.

word size and endianness are in the IL but I think only barely.

jmpbuf size is easy to factor out at a small perf cost.
or again, make it worst case.


These "worst cases" are likely to be pretty bad, such that they are ok for building the first compiler, but then you'd want to immediately rebuild it "ideally".
jmpbuf size varies from around 16 bytes to over 200 bytes for example.
You could also use
extern int jmpbufsize;
jmpbuf = alloca(jmpbufsize)


thereby not blowing stack, but still being slow.
Again, fine for bootstrap purposes but it should end there.


"aligned procedures" can be factored out easily via acting worst case.


Is this what PM3 did though?
Shipped one textual IL for all platforms, built m3cc (which doesn't /really/
require having cm3), then built everything from the portable IL, then rebuilt it all again more ideally?

I think if a portable distribution format is to be had, maybe go all the way to using a C backend? However that doesn't solve all/many/any of the above problems, given how low level the IL is.


 - Jay



More information about the M3devel mailing list