[MLton] Problem with MinGW

Matthew Fluet fluet@cs.cornell.edu
Thu, 8 Jun 2006 16:57:48 -0400 (EDT)


>>> things, but I can't see what happened earlier... gdb fails to debug the 
>>> assembler section, and the c-codegen doesn't compile on MinGW.
>> 
>> Why doesn't the c-codegen work on MinGW?
>
> Oddly, now it works. Perhaps something was changed between then and now?

I don't believe that anything significant has changed.

> At any rate, not only does the c-codegen compile, it succeeds at opening 
> files. Indeed, using the C codegen, MinGW is working perfectly. The moment 
> one uses the native codegen, the problem reappears. This shoots my hopes of 
> debugging it via the c-codegen in the foot. :-)

But, it does appear to lay the blame squarely on the native codegen.

> The parameters passed to the open3 method are identical in both cases. The 
> only difference is the stack. The first argument is 00 aligned for the C 
> codegen, and 1a aligned for the native codgen. However, I think this should 
> be ok... right?

Maybe yes, maybe no.  Could MinGW have a different calling convention than 
x86-linux and x86-cygwin?  In particular, does MinGW demand different 
stack alignment.  I could see that causing a problem very much like that 
which we are seeing.

> As I have no better idea on how to proceed, I've been adding printf()s to 
> many runtime methods to see if there is some difference in what gets called, 
> but so far no luck. There has to be a better way to debug this ... From 
> looking at the basis, the only difference in the codegens should be handling 
> of real numbers, which seems completely unrelated.

The codegens are very different outside the Basis Library.