encyclopegia.org

Cross compiler

A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running.[src] For example, a compiler that runs on a PC but generates code that runs on Android devices is a cross compiler.[src] A cross compiler is useful to compile code for multiple platforms from one development host.[src] Direct compilation on the target platform might be infeasible, for example on embedded systems with limited computing resources.[src] Cross compilers are distinct from source-to-source compilers.[src] A cross compiler is for cross-platform software generation of machine code, while a source-to-source compiler translates from one coding language to another in text code.[src] Both are programming tools.[src]

A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running.[src] For example, a compiler that runs on a PC but generates code that runs on Android devices is a cross compiler.[src] A cross compiler is useful to compile code for multiple platforms from one development host.[src] Direct compilation on the target platform might be infeasible, for example on embedded systems with limited computing resources.[src] Cross compilers are distinct from source-to-source compilers.[src] A cross compiler is for cross-platform software generation of machine code, while a source-to-source compiler translates from one coding language to another in text code.[src] Both are programming tools.[src] ==Timeline of early cross compilers== 1969 –The first version of UNIX was developed by Ken Thompson on a PDP-7, but due to the lack of tools and cost, it was cross-compiled on a GECOS system and transferred via paper tape.[src] This showed practical cross-compilation for OS development.[src] 1979 –ALGOL 68C generated ZCODE; this aided porting the compiler and other ALGOL 68 applications to alternate platforms.[src] To compile the ALGOL 68C compiler required about 120 KB of memory.[src] With Z80 its 64 KB memory is too small to actually compile the compiler.[src] So for the Z80 the compiler itself had to be cross compiled from the larger CAP capability computer or an IBM System/370 mainframe.[src] 1980s –Aztec C offered native and cross-compilation for home computers like Apple II and Commodore 64.[src] GCC requires that a compiled copy of binutils is available for each targeted platform.[src] Especially important is the GNU Assembler.[src] Therefore, binutils first has to be compiled correctly with the switch --target=some-target sent to the configure script.[src] GCC also has to be configured with the same --target option.[src] GCC can then be run normally provided that the tools, which binutils creates, are available in the path, which can be done using the following (on UNIX-like operating systems with bash): PATH=/path/to/binutils/bin:${PATH} make Cross-compiling GCC requires that a portion of the target platforms C standard library be available on the host platform.[src] The programmer may choose to compile the full C library, but this choice could be unreliable.[src] The alternative is to use newlib, which is a small C library containing only the most essential components required to compile C source code.[src] The GNU Autotools packages (i.e.[src] autoconf, automake, and libtool) use the notion of a build platform, a host platform, and a target platform.[src] The build platform is where the compiler is actually compiled.[src] In most cases, build should be left undefined (it will default from host).[src] The host platform is always where the output artifacts from the compiler will be executed whether the output is another compiler or not.[src] The target platform is used when cross-compiling cross compilers, it represents what type of object code the package will produce; otherwise the target platform setting is irrelevant.[src] For example, consider cross-compiling a video game that will run on a Dreamcast.[src] The machine where the game is compiled is the build platform while the Dreamcast is the host platform.[src] The names host and target are relative to the compiler being used and shifted like son and grandson.[src] Another method popularly used by embedded Linux developers involves the combination of GCC compilers with specialized sandboxes like Scratchbox and Scratchbox 2, or PRoot.[src] These tools create a "chrooted" sandbox where the programmer can build up necessary tools, libc, and libraries without having to set extra paths.[src] Facilities are also provided to "deceive" the runtime so that it "believes" it is actually running on the intended target CPU (such as an ARM architecture); this allows configuration scripts and the like to run without error.[src] Scratchbox runs more slowly by comparison to "non-chrooted" methods, and most tools that are on the host must be moved into Scratchbox to function.[src]

41 sentences · 41 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Cross compiler." encyclopegia.org, 2026, https://encyclopegia.org/wiki/cross-compiler. Accessed 25 November 2026.

Chicago

"Cross compiler." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/cross-compiler.

APA

encyclopegia.org. (2026). Cross compiler. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/cross-compiler

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Cross County

stub · references available

Cyclo-cross Ruddervoorde

stub · references available

2012–13 FIS Cross-Country World Cup

stub · references available

cross product

stub · references available

processional cross

stub · references available

Cross-border Mining Trail

stub · references available

Jessie Cross

stub · references available

Gillian Cross

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1366850989 · 0.5 · snapshot enwiki-001366850989

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.