[MLton] self-compiling failed

Baojian Hua huabj at mail.ustc.edu.cn
Thu May 20 23:37:14 PDT 2010


> Actually, you would need to install it in /usr/lib/mlton/.  Also, note
> that you can't generally replace the mlton-compile executable (or
> mlton-smlnj.x86-linux heap) from one version of the compiler with
> another version, since the runtime library, basis library, etc. may
> have also changed.  If /usr/bin/mlton and /usr/lib/mlton correspond to
> mlton-20070826 (as might be the case if you installed them from your
> Linux distribution's package manager or if you installed it from
> mlton-20070826-1.x86-linux.tgz from mlton.org), then this will almost
> certainly not work.
> 
> Generally, the best thing to do when self-compiling is to run the
> resulting compiler directly from build/bin/mlton.
> 
The installed MLton is 20100504, so the problem you mentioned hasn't been
observed. In fact, I tried to build MLton (by MLton) from the source
root, and after I copied the generated "mlton-compile" to /usr/lib/mlton, 
it works fine. :-)

> > de=d' -target-link-opt darwin ' -L/usr/local/lib' -target-link-opt freebsd -L/usr/local/lib/ -target-link-opt aix -maix64 -target-link-opt ia64 '' -target-link-opt mingw '-lws2_32 -lkernel32 -lpsapi -lnetapi32 -lwinmm' -target-link-opt mingw -Wl,--enable-stdcall-fixup -target-link-opt netbsd '-Wl,-R/usr/pkg/lib -L/usr/pkg/lib/' -target-link-opt openbsd -L/usr/local/lib/ -target-link-opt solaris '-lnsl -lsocket -lrt' -target-link-opt x86 -m32 -profile-exclude '\$\(SML_LIB\)'
> > unknown switch: -fno-common
> > usage: mlton [option ...] file.{c|cm|mlb|o|sml} [file.{c|o|s|S} ...]
> >    -align {4|8}                    object alignment
> >    -as-opt <opt>                   pass option to assembler
> >    -cc-opt <opt>                   pass option to C compiler
> >    -codegen {native|x86|c}         which code generator to use
> >    -const '<name> <value>'         set compile-time constant
> >    -default-ann <ann>              set annotation default for mlb files
> >    -default-type '<ty><N>'         set default type
> >    -disable-ann <ann>              disable annotation in mlb files
> >
> > Are we missing something else?
> 
> Looks like something got corrupted in your mlton script.  Has it been
> altered from that in SVN HEAD?
Maybe we've not decribe our difficulty clear. We followd these
steps to try to build an smlnj heap image (just as you mentioned in a 
previous post):
1. run "make" at the source root;
2. run "make smlnj-mlton"
3. copy the generated "mlton-smlnj.x86-linux" to "build/lib/"
4. remove "mlton-compile" in the "build/lib/"
5. run the script "mlton" in the "build/bin"
but we got the error message:
"unknown switch: -fno-common:
just as in the previous post.

Is there something we forgot?



More information about the MLton mailing list