Canadian Cross
10 months ago
- #cross-platform
- #software-development
- #compilers
- A cross compiler generates executable code for a platform different from the one it runs on, e.g., compiling for Android on a PC.
- Useful for embedded systems with limited resources, multiple target platforms, server farms, and bootstrapping new platforms.
- Distinct from source-to-source compilers; focuses on cross-platform machine code generation.
- Canadian Cross technique involves building cross compilers across three machines (A→B→C) for efficiency.
- Early examples include UNIX (1969), ALGOL 68C (1979), and Aztec C (1980s) for home computers.
- GCC supports cross-compilation but requires platform-specific binutils and partial C library (e.g., newlib).
- Microsoft C evolved from mixed-language development (1980s) to .NET’s cross-platform capabilities.
- Free Pascal and Clang are natively cross-compilers, targeting multiple architectures/OSes.
- Plan 9’s toolchain treats all compilation as architecture-independent.