Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Cross compiler
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Canadian Cross == The '''Canadian Cross''' is a technique for building cross compilers for other machines, where the original machine is much slower or less convenient than the target. 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 [[macOS]] on an [[x86-64]] processor) to create executables for machine C (e.g. running [[Android (operating system)|Android]] on an [[ARM architecture family|ARM]] processor). The practical advantage in this example is that Machine A is slow but has a proprietary compiler, while Machine B is fast but has no compiler at all, and Machine C is impractically slow to be used for compilation. When using the Canadian Cross with GCC, and as in this example, there may be four compilers involved * The ''proprietary 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)'' [[File:Example of Canadian Cross, scheme.svg|Example of Canadian Cross, scheme]] The end-result cross compiler (4) will not be able to run on build machine A; instead it would run 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 <code>build.sh</code> 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.<ref>{{cite web|title=4.9 Canadian Crosses |work=CrossGCC |quote=This is called a `Canadian Cross' because at the time a name was needed, Canada had three national parties. |access-date=2012-08-08 |url=http://www.objsw.com/CrossGCC/FAQ-4.html#sec:CanadianCross |url-status=dead |archive-url=https://web.archive.org/web/20041009155533/http://www.objsw.com/CrossGCC/FAQ-4.html#sec:CanadianCross |archive-date=October 9, 2004 }}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)