[MLton] Broken CVS

Stephen Weeks MLton@mlton.org
Wed, 15 Dec 2004 09:24:22 -0800


> Right now in CVS a build will fail with:
...
> Error: cannot upgrade basis because the compiler doesn't work
> make[4]: *** [upgrade-basis.sml] Error 1

I just did a clean bootstrap from the CVS without problems.  I believe
you encountered the problem you did because the primitive types have
changed recently (for the Unicode support) and hence one cannot
compile the current basis library with an old compiler.  Doing a clean
bootsrap should work.

In general, we try to always keep the CVS so that one can do a clean
bootstrap from the previous stable release of MLton.

> Btw, in control/control.sml how can I grab the constant
> "MLton_Platform_Arch_bigendian" as a bool and set fun targetIsBigEndian () =
> to that?
> 
> I want the constant for the target platform. I've just being hacking that
> one spot to true/false for now. The basis library was no trouble at all with
> _constant, but if I use that in the compiler I will get the host, not the
> target.

There is code similar to what you want in main/compile.fun, line 416.
This code uses "lookupConstant" (defined in compile.fun) to get the
target-dependent values of the gcState field offsets.  You should be
able to do something similar to lookup
MLton_Platform_Arch_isBigEndian, provided you've done the necessary
hack to cause it to appear in lib/<target>/constants.  See
main/lookup-constant.fun to see how the gcState fields are hardwired
to appear in the constants file.