[MLton] Cross-Compile

Stephen Weeks MLton@mlton.org
Tue, 19 Oct 2004 23:12:15 -0700

> I'm trying to cross-compile from Linux to Mingw, but it's failing after
> generating the ASM and C files.  I suspect it's looking for the
> C compiler, but I don't know  what path it expects to use:
>    Compile C and Assemble starting
>    Compile C and Assemble raised in 0.00 + 0.00 (0% GC)
> MLton raised in 7.65 + 3.32 (30% GC)
> No such file or directory
> Can you tell me what path it's searching for GCC?  I can't find it by
> grepping through the sources.

The C compiler is set with the -cc switch in the call to doit in the
bin/mlton script.  The default is "gcc", with no absolute path, so it
should work if gcc is in your PATH.  Perhaps there is some other
problem with cross compilation -- I never use MLton for cross
compilation in the way you do above so it's not well tested.  I always
cross compile with -stop g, and then copy the .c and .s files over to
the target machine and make an ordinary call to gcc to finish.
Perhaps an strace can reveal more about what system call is failing
and give us a clue as to the problem.