[MLton] Re: cygwoes

Matthew Fluet fluet@cs.cornell.edu
Tue, 11 Oct 2005 09:28:26 -0400 (EDT)


> Thanks Matthew. For the link step I get
>
> Undefined reference to `_F_0'
>
> Any idea what this might be?

I think it is related to the fact that Cygwin/MinGW add an extra "_" to 
the beginning of assembly labels.  (The label "F_0" normally corresponds 
to the label we assign to the top-level evaluation of the SML program.)

We're supposed to handle the extra "_" by recognizing the target OS and 
compensating in the codegen.  I could imagine that this becomes 
problematic if you built in a way that mis-specified/inferred the target 
OS.  Could you give any more info on how you built the .c and .S files?

> -----Original Message-----
> From: Matthew Fluet [mailto:fluet@cs.cornell.edu]
> Sent: 11 October 2005 14:00
> To: Andrew Kennedy
> Cc: MLton@mlton.org
> Subject: Re: [MLton] Re: cygwoes
>
>
>>> As another stopgap, you could use mlton -stop g and then call gcc by
>>> hand, since that works for you.
>>>
>> Please let me know what options I should pass to gcc for a successful
> build.
>
> Something like
>
>  gcc -c -Ibuild/lib/include -O1 -w mlton/mlton.*.[cS]
>  gcc -o build/lib/mlton-compile \
>         -Lbuild/lib/self \
>         -L/usr/local/lib \
>         mlton.*.o \
>         -lmlton -lgmp -lgdtoa -lm
>
> which is documented on the PortingMLton page:
>   http://mlton.org/PortingMLton
>
>
> I did a little more investigating of the Virtual{Alloc,Free} problems
> over
> the weekend, and I'm mostly convinced that (at least through Cygwin),
> they
> are not working as advertised by the API.  I've got more info at home
> that
> I'll try to post this evening.
>
> _______________________________________________
> MLton mailing list
> MLton@mlton.org
> http://mlton.org/mailman/listinfo/mlton
>