[MLton-commit] r7393

Matthew Fluet fluet at mlton.org
Mon Jan 18 10:44:07 PST 2010


Avoid a segfault in gmpz_mul_2exp when passed a 4-byte aligned limb
and an exponent >= 128; the amd64 ABI requires an 8-byte aligned array
of 64-bit words.  See
  http://mlton.org/pipermail/mlton/2009-October/030674.html
  http://mlton.org/pipermail/mlton-user/2010-January/001594.html
for more details.  This should avoid issues with bootstrapping from
compilers < r7255 (20091014), including mlton-20070826.


----------------------------------------------------------------------

U   mlton/trunk/mlton/Makefile

----------------------------------------------------------------------

Modified: mlton/trunk/mlton/Makefile
===================================================================
--- mlton/trunk/mlton/Makefile	2010-01-11 19:01:24 UTC (rev 7392)
+++ mlton/trunk/mlton/Makefile	2010-01-18 18:44:06 UTC (rev 7393)
@@ -25,6 +25,12 @@
   FLAGS += -default-ann 'warnUnused true'
   # FLAGS += -type-check true
 else
+# We're compiling MLton with an older version of itself. 
+# Use "-align 8" for amd64 to avoid GMP/mul_2exp segfault with a
+# mis-aligned limb when compiling with <= 20070826.
+ifeq (amd64,$(findstring $(HOST_ARCH), amd64))
+  FLAGS += -align 8
+endif
 ifneq (,$(findstring $(HOST_OS), cygwin mingw))
   # The stubs don't work on Cygwin or MinGW, since they define spawn
   # in terms of fork, and fork doesn't work on Cygwin or MinGW.  So,




More information about the MLton-commit mailing list