[Larceny-users] HOWTO Build Larceny on a 64 Bit Linux System
Ray Racine
ray.racine at comcast.net
Sun Nov 4 00:36:07 EDT 2007
For completeness regarding Ticket 488. To build Larceny on a 64 bit
system the following the 3 changes are required.
--------------
The first spoofs the system to be a i386 to the FFI.
[raymond at corwin larceny_src]$ svn diff lib/Ffi/ffi-load.sch
Index: lib/Ffi/ffi-load.sch
===================================================================
--- lib/Ffi/ffi-load.sch (revision 5067)
+++ lib/Ffi/ffi-load.sch (working copy)
@@ -25,6 +25,10 @@
(zero?
(system "test \"`uname -m | grep 'i.86'`x\" != \"x
\"")))
'i386-linux)
+ ((and (string=? os "Linux")
+ (zero?
+ (system "test \"`uname -m | grep 'x86_64'`x\" != \"x
\"")))
+ 'i386-linux)
(else
(error "FFI: unsupported operating system " os)))))
-------------------------
The second change is to add the -m32 compiler flag so ctools generate 32
bit code for struct layouts. Harmless on a 32 bit system I'd think.
[raymond at corwin larceny_src]$ svn diff lib/Standard/foreign-ctools.sch
Index: lib/Standard/foreign-ctools.sch
===================================================================
--- lib/Standard/foreign-ctools.sch (revision 5067)
+++ lib/Standard/foreign-ctools.sch (working copy)
@@ -188,6 +188,7 @@
(string-append
cc " "
include-directives
+ " -m32 "
" -D_XOPEN_SOURCE=500 "
" -o " exe-path
" " c-src-path)))))
--------------------------
The final change is to add the same -m32 flag into the Rts Makefile
template. Its there twice, once for compiling and then for linking.
[raymond at corwin larceny_src]$ svn diff src/Rts/make-templates.sch
Index: src/Rts/make-templates.sch
===================================================================
--- src/Rts/make-templates.sch (revision 5067)
+++ src/Rts/make-templates.sch (working copy)
@@ -163,7 +163,7 @@
CC=gcc
DEBUGINFO=#-g -gstabs+
OPTIMIZE=-O3 -DNDEBUG2 # -DNDEBUG
-CFLAGS+=-c -falign-functions=4
+CFLAGS+=-c -falign-functions=4 -m32
LIBS=-ldl -lm
AS=nasm
ASFLAGS+=-f elf -g -DLINUX"))
@@ -356,7 +356,7 @@
(define make-template-target-sassy-unix-static
"larceny.bin: $(X86_SASSY_LARCENY_OBJECTS)
- $(CC) $(PROFILE) $(TCOV) -o larceny.bin
$(X86_SASSY_LARCENY_OBJECTS) \\
+ $(CC) $(PROFILE) -m32 $(TCOV) -o larceny.bin
$(X86_SASSY_LARCENY_OBJECTS) \\
$(LIBS) $(EXTRALIBS) $(EXTRALIBPATH) $(LDXFLAGS)
rm Sys/version.$(O)")
More information about the Larceny-users
mailing list