[MLton] MinGW hosted MLton

Wesley W. Terpstra wesley@terpstra.ca
Wed, 4 May 2005 00:13:37 +0200


On Tue, May 03, 2005 at 04:04:14PM -0400, Matthew Fluet wrote:
> This patch breaks a self-compile on Linux (and presumably on every 
> non-Windows platform).  Although it is clear that 
> Primitive.MLton.Platform.OS.useWindowsProcess  must be false on a 
> non-Windows platform (and, hence,  usCwait  must be false), it is 
> insufficiently optimized, leaving a reference to MLton_Process_cwait in 
> the final object files, which are left unsresolved by libmlton.a on 
> non-Windows platforms.

Eek! 
I did more or less the same thing in reap from mlton/process.sml.
Sorry about that; I didn't imagine it would affect linux.

> I suspect that the issue arises from the fact that the computation of  
> useCwait  is caught up in the closure of the  wait  function above and 
> constant propagation isn't able to push the constant value of  
> Primitive.MLton.Platform.OS.useWindowsProcess  though to its use.  While 
> it would be nice to improve constant propagation (or some other 
> optimization) to eliminate this situation, it would also be desirable to 
> have a dummy MLton_Process_cwait  on non-Windows platforms in the 
> situations when the optimizer isn't sufficiently powerful.

A new dummy-cwait.c in platform/ which gets included by linux,c, darwin.c,
...?

-- 
Wesley W. Terpstra