[MLton] Broken CVS

Wesley W. Terpstra terpstra@gkec.tu-darmstadt.de
Wed, 15 Dec 2004 19:17:06 +0100

On Wed, Dec 15, 2004 at 09:24:22AM -0800, Stephen Weeks wrote:
> > 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. 

That's because Matthew already fixed it. =)

revision 1.138
date: 2004/12/15 14:33:29;  author: fluet;  state: Exp;  lines: +5 -3

> There is code similar to what you want in main/compile.fun, line 416.

Yeah, I've seen that.

> This code uses "lookupConstant" (defined in compile.fun) to get the
> target-dependent values of the gcState field offsets.  

The problem is that control.mlb comes before lookup-constant.fun.
Simply reodering the inclusion does not work.

I could just put in:

datatype endian = BIG | LITTLE | UNKNOWN
exception EndianUnset
val targetBigEndian = ref UNKNOWN
fun targetIsBigEndian () = 
  case !targetBigEndian of
    UNKNOWN => raise EndianUnset
  | BIG => true
  | LITTLE => false

... and then later set it later.
Then you'd kill me for such an ugly hack. :)

I had hoped you might know of a nicer way to do this.

> provided you've done the necessary hack to cause it to appear in
> lib/<target>/constants.

This already works.

PS. I don't think it's going to be possible to port MLton to arm, m68k,
mips, or s390 on debian. None of those autobuilders have 512MB of RAM.
That leaves hppa, sparc, powerpc, ia64, alpha, and amd64.

PPS. I take it you don't want me to send mail directly to you even when it's
a small thing? (You redirected my last email to the list.) I only did it b/c
I wasn't sure if posting publicly about a bad commit would be polite.

Wesley W. Terpstra