next up previous contents
Next: 4. Structure CMB Up: 3. Differences between CMB Previous: 3.4 PIDMAP file   Contents

3.5 Cross-compiling

Several different versions of the bootstrap compiler can coexist--each being responsible for targeting another CPU-OS combination. Structure CMB is the default bootstrap compiler that targets the current system; it is exported from $smlnj/cmb.cm. The following table lists the names of other structures--those corresponding to various cross-compilers. All these structures share the same signature.

The table also shows the names of libraries that the structures are exported from as well as those arch and os strings that are used to name binfile- and stablefile-directory.

library structure architecture OS arch os
$smlnj/cmb.cm
$smlnj/cmb/current.cm
CMB current current
$smlnj/cmb/alpha32-unix.cm Alpha32UnixCMB Alpha Unix alpha32 unix
$smlnj/cmb/hppa-unix.cm HPPAUnixCMB HP-PA Unix hppa unix
$smlnj/cmb/ppc-macos.cm PPCMacOSCMB Power-PC Mac-OS ppc macos
$smlnj/cmb/ppc-unix.cm PPCUnixCMB Power-PC Unix ppc unix
$smlnj/cmb/sparc-unix.cm SparcUnixCMB Sparc Unix sparc unix
$smlnj/cmb/x86-unix.cm X86UnixCMB Intel x86 Unix x86 unix
$smlnj/cmb/x86-win32.cm X86Win32CMB Intel x86 Win32 x86 win32
$smlnj/cmb/all.cm all of the above (except CMB)

As an example, consider targeting a Sparc/Unix system. The first step is to load the library that exports the corresponding cross-compiler:


  CM.autoload "$smlnj/cmb/sparc-unix.cm";

Once this is done, run the equivalent of CMB.make:


  SparcUnixCMB.make ();

This will recompile the compiler, producing object code for a Sparc. Binfiles will be stored under sml.bin.sparc-unix and stable libraries under sml.boot.sparc-unix.


next up previous contents
Next: 4. Structure CMB Up: 3. Differences between CMB Previous: 3.4 PIDMAP file   Contents
Matthias Blume
2001-07-19