[MLton-user] problems recompiling mlton on linux

Matthew Fluet matthew.fluet at gmail.com
Mon Jan 18 10:39:11 PST 2010


John followed up with some more details and a pointer to the machine
on which the build fails.  I believe that it is another instance of
the issue described in the following thread:
  http://mlton.org/pipermail/mlton/2009-October/030674.html
In short, newer GMP's on amd64 expect 8-byte aligned limbs (and
segfault when presented with a 4-byte aligned limb to gmpz_mul_2exp
(with an exponent >= 128), which, in turn, is called from IntInf.<<
(which does an IntInf.<<(2,128) within the compiler to calculate a
limit on IntInf constant folding)).  The fix identified in that thread
is that amd64 should use "-align 8" by default (and perhaps warn that
"-align 4" could break ABI compatibility).  Unfortunately, we can't
change mlton-20070826 to be an "-align 8" executable and default to
"-align 8" for executables it produces.  On the up side,
mlton-20070826 doesn't perform an IntInf.<<(2,128) calculation, so
running mlton-20070826 is generally safe.  We can get it to default to
"-align 8" when building a new version of MLton by adding an "-align
8" flag to the Makefile for the newer version of MLton.  I've
committed such a change, and I've successfully bootstrapped from
mlton-20070826 to SVN r7392.

On Fri, Jan 15, 2010 at 7:17 PM, John Reppy <jhr at cs.uchicago.edu> wrote:
> I did a "make clean" prior to the build, but I'll try checking out a fresh copy
> just to be sure.
>
>        - John
>
> On Jan 15, 2010, at 6:13 PM, Matthew Fluet wrote:
>
>> I can't reproduce.  I was able to bootstrap on amd64-linux (Fedora 10)
>> from 20070826 to r7392 without any problems.  The recent commit that
>> changed how cross-compiler targets are represented did change where
>> libraries were stored, so might have caused some confusion if you
>> didn't have a clean source tree.
>>
>> -Matthew
>>
>> On Fri, Jan 15, 2010 at 4:32 PM, John Reppy <jhr at cs.uchicago.edu> wrote:
>>> I've been trying to compile the latest (r7392) version of mlton on linux, but I hit a segmentation
>>> fault when the make gets to mllex:
>>>
>>>        ...
>>>        Type checking mlrisc-lib library.
>>>        Type checking mlyacc-lib library.
>>>        Type checking smlnj-lib library.
>>>        make -C "mllex"
>>>        make[2]: Entering directory `/home/jhr/addon/mlton/mlton/mllex'
>>>        Compiling mllex
>>>        "mlton" -target self mllex.mlb
>>>        make[2]: *** [mllex] Segmentation fault
>>>        make[2]: Leaving directory `/home/jhr/addon/mlton/mlton/mllex'
>>>
>>> I'm using the 20070826 release (x86-64).  Any suggestions for what might be the problem or
>>> how to work around it?
>>>
>>>        - John
>>>
>>>
>>> _______________________________________________
>>> MLton-user mailing list
>>> MLton-user at mlton.org
>>> http://mlton.org/mailman/listinfo/mlton-user
>>>
>>
>
>



More information about the MLton-user mailing list