axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] RE: cross-compiling Axiom


From: Waldek Hebisch
Subject: [Axiom-developer] RE: cross-compiling Axiom
Date: Tue, 5 Sep 2006 14:23:45 +0200 (CEST)

There have been doubts here wether Lisp systems can be croos- 
compiled. Let me mention here a simple method which is used
by some Lisp-like system -- this method shows that cross-
compiling Lisp has no fundamental problems (only usual
problems).

First, why croos-compiling Lisp looks difficult? The reason
is dynamic nature of Lisp: freshly compiled code is loaded
into hast system and used in subsequent compilations. Moreover,
compiling Lisp means building apropriate data structures
which mix ordinary data with machine code. There seem to
be difficulty here: we want data stuctures containg target
machine code as a final result, but during compilation we
need host machine code.

One method which can solve this difficulty is: compile
everything twice, one version for host machine to be
used in further compilation, the second one for target.
In particular, for GCL one can probably just run the
C compiler twice to get object files for target machine.

If done naively this process still requires loading
object files into target Lisp to build the final image.
With such a method to do full build on host one has to
provide cross-Lisp capable just of loading object files
and saving image. While non-trivial (since some code is
executed at load time) such limited cross-Lisp should be
much simpler than full compiler. Alternatively, since
final loading of object files and dumping image is
unlikely to be time critical one can build the final
image at install time.

Of course there are usual cross-compilation problems, for
example (in GCL case) one must make sure that generated
C code works both on host and target machine.

-- 
                              Waldek Hebisch
address@hidden 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]