[MLton-commit] r6991

Wesley Terpstra wesley at mlton.org
Sun Nov 16 07:10:20 PST 2008


On a native amd64 system, sometimes you want to build a 32-bit MLton. The flag
-m32 has been around for quite a while and suffices to let a multilib gcc (like
the one in most amd64 linux systems) build MLton with "i386 make". This is 
analagous to the current use of -m64 for compiling to an amd64 target from an
i386 one.


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

U   mlton/trunk/bin/mlton-script
U   mlton/trunk/runtime/Makefile

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

Modified: mlton/trunk/bin/mlton-script
===================================================================
--- mlton/trunk/bin/mlton-script	2008-11-12 23:11:29 UTC (rev 6990)
+++ mlton/trunk/bin/mlton-script	2008-11-16 15:10:19 UTC (rev 6991)
@@ -89,6 +89,7 @@
         -link-opt '-lm -lgmp'                                    \
         -mlb-path-map "$lib/mlb-path-map"                        \
         -target-as-opt amd64 '-m64'                              \
+        -target-as-opt x86 '-m32'                                \
         -target-cc-opt amd64 '-m64'                              \
         -target-cc-opt darwin                                    \
                 '-I/usr/local/include 
@@ -99,7 +100,8 @@
         -target-cc-opt openbsd '-I/usr/local/include'            \
         -target-cc-opt sparc '-m32 -mcpu=v8 -Wa,-xarch=v8plusa'  \
         -target-cc-opt x86                                       \
-                '-fno-strength-reduce
+                '-m32
+                -fno-strength-reduce
                 -fschedule-insns
                 -fschedule-insns2
                 -malign-functions=5
@@ -115,5 +117,6 @@
                 '-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\)'                         \
         "$@"

Modified: mlton/trunk/runtime/Makefile
===================================================================
--- mlton/trunk/runtime/Makefile	2008-11-12 23:11:29 UTC (rev 6990)
+++ mlton/trunk/runtime/Makefile	2008-11-16 15:10:19 UTC (rev 6991)
@@ -79,6 +79,7 @@
 endif
 
 ifeq ($(TARGET_ARCH), x86)
+FLAGS += -m32
 ifeq ($(findstring $(GCC_MAJOR_VERSION), 3 4),$(GCC_MAJOR_VERSION))
 OPTFLAGS += -falign-loops=2 -falign-jumps=2 -falign-functions=5
 else




More information about the MLton-commit mailing list