Cross-compilers - Canadian Cross

The Canadian Cross is a technique for building cross compilers for other machines. Given three machines A, B, and C, one uses machine A (e.g. running Windows XP on an IA-32 processor) to build a cross compiler that runs on machine B (e.g. running Mac OS X on an x86-64 processor) to create executables for machine C (e.g. running Android on an ARM processor). When using the Canadian Cross with GCC, there may be four compilers involved:

  • The proprietary (describes goods which are made and sent out by a particular company whose name is on the product) native Compiler for machine A (1) (e.g. compiler from Microsoft Visual Studio) is used to build the gcc native compiler for machine A (2).
  • The gcc native compiler for machine A (2) is used to build the gcc cross compiler from machine A to machine B (3)
  • The gcc cross compiler from machine A to machine B (3) is used to build the gcc cross compiler from machine B to machine C (4)

The end-result cross compiler (4) will not be able to run on your build machine A; instead you would use it on machine B to compile an application into executable code that would then be copied to machine C and executed on machine C.

For instance, NetBSD provides a POSIX Unix shell script named build.sh which will first build its own toolchain with the host's compiler; this, in turn, will be used to build the cross-compiler which will be used to build the whole system.

The term Canadian Cross came about because at the time that these issues were under discussion, Canada had three national political parties.

Read more about this topic:  Cross-compilers

Famous quotes containing the words canadian and/or cross:

    We’re definite in Nova Scotia—’bout things like ships ... and fish, the best in the world.
    John Rhodes Sturdy, Canadian screenwriter. Richard Rossen. Joyce Cartwright (Ella Raines)

    Things have dropped from me. I have outlived certain desires; I have lost friends, some by death ... others through sheer inability to cross the street.
    Virginia Woolf (1882–1941)