[Top][All Lists]

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

Re: [Axiom-developer] RE: cross-compiling Axiom

From: root
Subject: Re: [Axiom-developer] RE: cross-compiling Axiom
Date: Sun, 3 Sep 2006 20:01:45 -0400


Axiom was ported to the Zaurus handheld using cross-compilation.
Camm does it in the Debian setup.

There are two methods generally used, CROSS-COMPILATION and

CROSS-COMPILATION involves two systems, B -- the build system and
T -- the target system. You compile on B but tell GCC that the
target is T. 

GCC is designed in layers. The source code eventually gets compiled to
RTL (Register Transfer Language) which is a target independent
lisp-like assembler language. Since this is system-independent you
can use the RTL anywhere.

The final stage of GCC compiles RTL to the target platform. GCC
currently targets about 20 platforms.  This is useful for targets like
the Zaurus (an ARM (i386-ish) processor) that do not have the
horsepower to be a compile platform. It is also useful for embedded

CROSS-MOUNTING is easier if the target system has the tools and horsepower
to host GCC. For instance, to build on a Sun system it is easier to use
NFS (Network File System). Here we talk about S -- the source system
and T -- the target system.

On S, which contains the source tree, you 'export' the filesystem using
NFS. This allows anyone to mount the filesystem remotely. On T you 
NFS-mount the sources. They now appear to be on the target system
and you can just type 'make'

Axiom can use this system. First you build on S so that you have a 
full build tree (SRC, INT, OBJ, MNT). Notice that these are defined as

  SRC -- Human created, read-only
  INT -- Machine-generated, Machine-independent
  OBJ -- Machine-generated, Machine-dependent
  MNT -- Final distribution tree

SRC contains the source tree. NFS export on B it so it can be mounted on T.
INT contains a 'cache' of extracted code that is system-independent so it
also can be NFS exported on B and NFS-mounted on T. This saves having to
redo a lot of work.

On B you export SRC & INT.
On T you NFS-mount SRC & INT.
On T you set the AXIOM variable to the local machine 
  (e.g. export AXIOM=`pwd`/mnt/sun)
On T you type 'make' and it builds a Sun version.

In parallel, other systems can also do NFS-mount and make.
The only change is the AXIOM variable (e.g. `pwd`/mnt/macox)

The advantage of CROSS-COMPILATION is that you can build for systems
that don't support a build environment. The disadvantage is that you
need a cross-compiled environment (e.g. libraries need to be cross
compiled, .h files need to reflect the target, etc.). Since Axiom
needs the X11 libraries for a full build you need to have X11
libraries that are cross-compiled for the target (e.g. Zaurus)

The advantage of CROSS-MOUNTING is that you are building on the 
final target and can use all of the libraries, includes, and tools.
The disadvantage is that you can't do this if the target does not
have the horsepower.

Which method you use is determined by the resources of the target.


reply via email to

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