[MLton] A few changes proposals for MLton

Nicolas Bertolotti Nicolas.Bertolotti at mathworks.fr
Mon Nov 17 15:04:37 PST 2008


> It isn't clear to me why upgrade-basis needs to know the target.  In any

upgrade-basis generates the MLton structure with a value for Platform.host and OS.host that is based on the target so I guess this has an impact on those values when they are used in the compiler binary itself.

Anyway, before I implemented those changes, I remember my cross compiler already worked fine so I am not really sure this is really important.

> case, your changes don't seem to completely support cross compiling the
> compiler.  For example, in <src>/Makefile, in the 'world-no-check' target,
> you don't execute the compiler on the target system, which would be
> necessary after a
>    make TARGET=xx TARGET_ARCH=xx TARGET_OS=xx TARGET_MACHINE=xx compiler
> to have both build/lib/mlton-compile and build/lib/world.mlton for the
> target.

Well, I actually use the changes to rebuild a 32 bit version of the compiler (to use less RAM) after building it natively on a 64 bit platform. I do this by running:
$ touch mlton/main.sml
$ make compiler TARGET=... ...
and finally:
$ make world-no-check TARGET=... ... (to rebuild the main compiler binary only)
or:
$ make world libraries tools TARGET=... ... (to rebuild the tools as well)
After running:
$ make all-no-docs
But I do this using an external script so I guess I should add a bit of additional packaging (Makefile modifications) in order to propose an efficient complete cross compilation entry.




More information about the MLton mailing list