[MLton-user] Cross-compilation problem

Stephen Weeks sweeks at sweeks.com
Tue Aug 22 17:47:00 PDT 2006


> Using these files I'm able to create an x86 executable, so I tried
> to start the cross-compilation flow to cross-compile the examples
> for a PPC_4xx target machine.

Although MLton has a C codegen, it does not generate
platform-independent C -- MLton must still be ported to each new
architecture.  And no one has done PPC_4xx as far as I know.  Porting
to a new 32-bit arch with the C codegen is usually pretty easy,
though, and we'd be happy to help you do it.

In any case, when one is cross compiling (to a platform that MLton
handles), one must use the -target option, e.g.

  -stop g -target sparc-sun-solaris

> So now I just need libmlton and libgdtoa; I tried to cross-compile
> them, and then started my problems. Mlton provide a script to do it,
> but this script "uses ssh to compile the runtime on the target
> machine", so it is not suitable for me, because I cannot do it (I
> mean I cannot use ssh on the target machine)

One can work around not having ssh.  Do you have access to the target
machine, via whatever means?  If so, then you can manually mimic what
happens in bin/add-cross, copying over files and running make, etc. to
build the runtime.  The same with print-constants.c, which you can
simply manually compile and run.

I recommend to avoid dealing with cross-gcc if at all possible.  I
years ago switched to schemes where I move around files and use a
native gcc, as it is *much* simpler.  If you absolutely must use a
cross-gcc, we can probably figure it out, but we'll succeed more
quickly with other avenues first.



More information about the MLton-user mailing list