[gambit-list] cross-compilation for dummies

Marc Feeley feeley at iro.umontreal.ca
Sun Dec 14 10:33:01 EST 2008


On 13-Dec-08, at 11:08 PM, Oisín Mac Fhearaí wrote:

> Hi all,
>
> I'm fairly out of my depth here, trying to compile Gambit such that it
> will cross-compile (on OS X) and produce executables that will run on
> my old m68k-based Palm (err, actually ARM-based, but with some weird
> caveats that make it easier to use 68k). There doesn't seem to be any
> documentation on how to do such a thing, but grepping in the latest
> source release implies that it can be done via the "--host" configure
> option.

Interesting project!  Gambit-C is highly portable because the Gambit-C  
compiler generates portable C code.  In principle, and very often in  
practice, the C code generated can be compiled without modification on  
any target platform with a "decent" C compiler.  By "decent" I mean  
that it must support all of the ANSI C standard and it must be able to  
compile large files without taking too much memory and time.

So if you install the prebuilt Gambit on Mac OS X then you can run

    gsc -c module.scm

to get module.c which you can then compile with the m68k C cross- 
compiler.  You also need to compile all the files in the lib/  
directory.  The script misc/vctoolkit.bat will give you the basic idea  
of the files that need to be compiled and linked (for MS Visual C++).

Note that Gambit expects words to be 32 or 64 bits wide.  You claim  
that the m68k has 16 bit words, but as I recall it has 32 bit words.

Also, if you want a native code compiler, the first version of Gambit  
(up to version 2.2) generated very tight code for m68k.  So perhaps  
you can also try to get it to work with the Palm.  See

   http://www.iro.umontreal.ca/~gambit/.dl/gamb68k.tar.Z

Marc




More information about the Gambit-list mailing list