Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
Cross compiler

Cross compiler

Overview
A cross compiler is a compiler
Compiler
A compiler is a computer program that transforms source code written in a computer language into another computer language...

 capable of creating executable
Executable
In computing, an executable causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a file that only contains data. Files that contain instructions for an interpreter or virtual machine may be considered executables, but are more specifically called scripts...

 code for a platform
Platform (computing)
In computing, a platform describes some sort of hardware architecture or software framework , that allows software to run...

 other than the one on which the compiler is run. Cross compiler tool
Programming tool
A programming tool or software development tool is a program or application that software developers use to create, debug, maintain, or otherwise support other programs and applications...

s are used to generate executables for embedded system
Embedded system
An embedded system is a computer system designed to perform one or a few dedicated functions , often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. In contrast, a general-purpose computer, such as a personal...

 or multiple platforms. It is used to compile for a platform upon which it is not feasible to do the compiling, like microcontroller
Microcontroller
A microcontroller is a small computer on a single integrated circuit consisting of a relatively simple CPU combined with support functions such as a crystal oscillator, timers, watchdog timer, serial and analog I/O etc. Program memory in the form of NOR flash or OTP ROM is also often included on...

s that don't support an operating system
Operating system
An operating system is an interface between hardware and user which is responsible for the management and coordination of activities and the sharing of the resources of the computer that acts as a host for computing applications run on the machine. As a host, one of the purposes of an operating...

. It has become more common to use this tool for paravirtualization
Paravirtualization
In computing, paravirtualization is a virtualization technique that presents a software interface to virtual machines that is similar but not identical to that of the underlying hardware....

 where a system may have one or more platforms in use.

Not targeted by this definition are source to source translators
Source-to-source compiler
A "source-to-source compiler" is a type of compiler that takes a high level language as its input and outputs a high level language. For example, an automatic parallelizing compiler will frequently take in a high level language program as an input and then transform the code and annotate it with...

, which are often called by the name of cross compiler.

The fundamental use of a cross compiler is to separate the build environment from the target environment.
Discussion
Ask a question about 'Cross compiler'
Start a new discussion about 'Cross compiler'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia
A cross compiler is a compiler
Compiler
A compiler is a computer program that transforms source code written in a computer language into another computer language...

 capable of creating executable
Executable
In computing, an executable causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a file that only contains data. Files that contain instructions for an interpreter or virtual machine may be considered executables, but are more specifically called scripts...

 code for a platform
Platform (computing)
In computing, a platform describes some sort of hardware architecture or software framework , that allows software to run...

 other than the one on which the compiler is run. Cross compiler tool
Programming tool
A programming tool or software development tool is a program or application that software developers use to create, debug, maintain, or otherwise support other programs and applications...

s are used to generate executables for embedded system
Embedded system
An embedded system is a computer system designed to perform one or a few dedicated functions , often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. In contrast, a general-purpose computer, such as a personal...

 or multiple platforms. It is used to compile for a platform upon which it is not feasible to do the compiling, like microcontroller
Microcontroller
A microcontroller is a small computer on a single integrated circuit consisting of a relatively simple CPU combined with support functions such as a crystal oscillator, timers, watchdog timer, serial and analog I/O etc. Program memory in the form of NOR flash or OTP ROM is also often included on...

s that don't support an operating system
Operating system
An operating system is an interface between hardware and user which is responsible for the management and coordination of activities and the sharing of the resources of the computer that acts as a host for computing applications run on the machine. As a host, one of the purposes of an operating...

. It has become more common to use this tool for paravirtualization
Paravirtualization
In computing, paravirtualization is a virtualization technique that presents a software interface to virtual machines that is similar but not identical to that of the underlying hardware....

 where a system may have one or more platforms in use.

Not targeted by this definition are source to source translators
Source-to-source compiler
A "source-to-source compiler" is a type of compiler that takes a high level language as its input and outputs a high level language. For example, an automatic parallelizing compiler will frequently take in a high level language program as an input and then transform the code and annotate it with...

, which are often called by the name of cross compiler.

Uses of cross compilers


The fundamental use of a cross compiler is to separate the build environment from the target environment. This is useful in a number of situations:
  • Embedded computers
    Embedded system
    An embedded system is a computer system designed to perform one or a few dedicated functions , often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. In contrast, a general-purpose computer, such as a personal...

     where a device has extremely limited resources. For example, a microwave oven will have an extremely small computer to read its touchpad and door sensor, provide output to a digital display and speaker, and to control the machinery for cooking food. This computer will not be powerful enough to run a compiler, a file system, or a development environment. Since debugging and testing may also require more resources than are available on an embedded system, cross-compilation can be less involved and less prone to errors than native compilation.
  • Compiling for multiple machines. For example, a company may wish to support several different versions of an operating system or to support several different operating systems. By using a cross compiler, a single build environment can be set up to compile for each of these targets.
  • Compiling on a server farm
    Server farm
    A server farm or server cluster, also called a data center, is a collection of computer servers usually maintained by an enterprise to accomplish server needs far beyond the capability of one machine...

    . Similar to compiling for multiple machines, a complicated build that involves many compile operations can be executed across any machine that is free regardless of its brand or current version of an operating system.
  • Bootstrapping to a new platform. When developing software for a new platform, or the emulator of a future platform, one uses a cross compiler to compile necessary tools such as the operating system and a native compiler.
  • Compiling native code for emulators for older now-obsolete platforms like the Commdore 64 or Apple II by enthusiasts who use cross compilers that run on a current platform (such as Aztec C's MS DOS 6502
    MOS Technology 6502
    The MOS Technology 6502 is an 8-bit microprocessor that was designed by Chuck Peddle and Bill Mensch for MOS Technology in 1975. When it was introduced, it was the least expensive full-featured microprocessor on the market by a considerable margin, costing less than one-sixth the price of...

     cross compilers running under Windows XP
    Windows XP
    Windows XP is a line of operating systems produced by Microsoft for use on personal computers, including home and business desktops, laptops, and media centers. The name "XP" is short for "eXPerience"...

    ).


Use of virtual machine
Virtual machine
A virtual machine is a software implementation of a machine that executes programs like a physical machine.-Definitions:...

s (such as Java's JVM
Java Virtual Machine
A Java Virtual Machine is a set of computer software programs and data structures that use a virtual machine model for the execution of other computer programs and scripts. The model used by a JVM accepts a form of computer intermediate language commonly referred to as Java bytecode...

) resolves some of the reasons for which cross compilers were developed. The virtual machine paradigm allows the same compiler output to be used across multiple target systems.

Typically the hardware architecture
Hardware architecture
In engineering, hardware architecture refers to the identification of a system's physical components and their interrelationships. This description, often called a hardware design model, allows hardware designers to understand how their components fit into a system architecture and provides...

 differs (e.g. compiling a program destined for the MIPS architecture
MIPS architecture
MIPS is a reduced instruction set computing instruction set architecture developed by MIPS Computer Systems . The early MIPS architectures were 32-bit, and later versions were 64-bit...

 on an x86 computer) but cross-compilation is also applicable when only the operating system
Operating system
An operating system is an interface between hardware and user which is responsible for the management and coordination of activities and the sharing of the resources of the computer that acts as a host for computing applications run on the machine. As a host, one of the purposes of an operating...

 environment differs, as when compiling a FreeBSD
FreeBSD
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via the Berkeley Software Distribution . It has been characterized as "the unknown giant among free operating systems". It is not a clone of UNIX, but works like UNIX, with UNIX-compliant internals and system APIs. FreeBSD is...

 program under Linux
Linux
Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed,...

, or even just the system library, as when compiling programs with uClibc
UClibc
In computing, uClibc is a small C standard library intended for embedded Linux systems. uClibc was created to support uClinux, a version of Linux not requiring a memory management unit and thus suited for microcontrollers .The project lead is Erik Andersen. The other main contributor is Manuel...

 on a glibc host.

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 to build a cross compiler that runs on machine B to create executables for machine C. When using the Canadian Cross with GCC, there may be four compilers involved:
  • The proprietary native Compiler for machine A (1) 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
NetBSD
NetBSD is a freely redistributable, open source version of the Unix-derivative Berkeley Software Distribution computer operating system. It was the second open source BSD descendant to be formally released, after 386BSD, and continues to be actively developed...

 provides a POSIX
POSIX
POSIX or "Portable Operating System Interface [for Unix"] is the name of a family of related standards specified by the IEEE to define the application programming interface , along with shell and utilities interfaces for software compatible with variants of the Unix operating system, although the...

 Unix shell
Unix shell
A Unix shell is a command-line interpreter and script host that provides a traditional user interface for the Unix operating system and for Unix-like systems...

 script named build.sh which will first build its own toolchain
Toolchain
In software, a toolchain is the set of computer programs that are used to create a product...

 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 all being hashed out, Canada had three national political parties.

GCC and cross compilation


GCC
GNU Compiler Collection
The GNU Compiler Collection is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain...

, a free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with minimal restrictions only to ensure that further recipients can also...

 collection of compilers, can be set up to cross compile. It supports many platforms and languages. However, due to limited volunteer time and the huge amount of work it takes to maintain working cross compilers, in many releases some of the cross compilers are broken.

GCC requires that a compiled copy of binutils be available for each targeted platform. Especially important is the GNU Assembler
GNU Assembler
The GNU Assembler, commonly known as Gas, is the assembler used by the GNU Project. It is the default back-end of gcc. It is used to compile the GNU operating system and the Linux kernel, and various other software. It is a part of the GNU Binutils package.Gas's executable is named after...

. Therefore, binutils first has to be compiled correctly with the switch --target=some-target sent to the configure script. GCC also has to be configured with the same --target option. GCC can then be run normally provided that the tools, which binutils creates, are available in the path
Path (computing)
A path, the general form of a filename or of a directory name, specifies a unique location in a file system. A path points to a file system location by following the directory tree hierarchy expressed in a string of characters in which path components, separated by a delimiting character, represent...

, 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
C standard library
The C standard library consists of a set of sections of the ISO C standard which describe a collection of header files and library routines used to implement common operations, such as input/output and string handling, in the C programming language...

 be available on the
host platform. At least the crt0
Crt0
crt0 is a set of execution startup routines that are platform-dependent, and is required in order to compile using the GCC and other GNU tools. crt stands for "C runtime"....

, ... components of the library must be available. You may choose to compile the full C library, but that can be too large for many platforms. The alternative is to use newlib
Newlib
Newlib is a C standard library implementation intended for use on embedded systems. It is a conglomeration of several library parts, all under free software licenses that make them easily usable on embedded products. It was created by Cygnus Support as part of building the first GNU...

, which is a small C library containing only the most essential components required to compile C
C (programming language)
C is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 source code. To configure GCC with newlib, use the switch --with-newlib.

The GNU autotools
GNU build system
The GNU build system, also known as the Autotools, is a suite of programming tools produced by the GNU project. These tools are designed to assist in making various source code packages portable to many Unix-like systems. The GNU build system is part of the GNU toolchain and is widely used in...

 packages (i.e. autoconf
Autoconf
GNU Autoconf is a tool for producing configure scripts for software on Unix-like computer systems. Configure scripts inspect a user's computer system and configure the software package prior to it being installed. After running a series of automated tests, a configure script generates customised...

, automake
Automake
GNU Automake is a programming tool that produces portable makefiles for use by the make program, used in compiling software. It is made by the Free Software Foundation as one of GNU programs, and is part of the GNU build system. The makefiles produced follow the GNU Coding Standards.It is written...

, and libtool
Libtool
GNU Libtool is a GNU programming tool from the GNU build system used for creating portable software libraries. To quote the introduction in the :Libtool is typically used with Autoconf and Automake, two other tools of the GNU build system.- See also :...

) use the notion of a build platform, a host platform, and a target platform. The build platform is where the code is actually compiled. The host platform is where the compiled code will execute. The target platform usually only applies to compilers. It represents what type of object code the package itself will produce (such as cross-compiling a cross-compiler); otherwise the target platform setting is irrelevant. For example, consider cross-compiling a video game that will run on a Dreamcast. The machine where the game is compiled is the build platform while the Dreamcast is the host platform.

Manx Aztec C cross compilers


Manx Software Systems, of Shrewsbury
Shrewsbury, New Jersey
Shrewsbury is a Borough in Monmouth County, New Jersey, United States. As of the United States 2000 Census, the borough population was 3,590....

, New Jersey
New Jersey
New Jersey is a state in the Mid-Atlantic region of the United States. It is bordered on the north by New York, and to the east by the Hudson River, Upper New York Bay, the Kill Van Kull, Newark Bay, the Arthur Kill, Raritan Bay, Sandy Hook Bay, Westchester County, New York City, Long Island, and...

, produced C compilers
Compiler
A compiler is a computer program that transforms source code written in a computer language into another computer language...

 beginning in the 1980s targeted at professional developers for a variety of platforms up to and including PCs
IBM PC
The IBM Personal Computer, commonly known as the IBM PC, is the original version and progenitor of the IBM PC compatible hardware platform. It is IBM model number 5150, and was introduced on August 12, 1981...

 and Macs
Macintosh
The Macintosh, or Mac, is a series of several lines of personal computers designed, developed, and marketed by Apple Inc. The first Macintosh was introduced on January 24 1984; it was the first commercially successful personal computer to feature a mouse and a graphical user interface rather than a...

.

Manx's Aztec C programming language
C (programming language)
C is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 was available for a variety of platforms including MS DOS, Apple II DOS 3.3
Apple DOS
Apple DOS refers to operating systems for the Apple II series of microcomputers from late 1978 through early 1983. Apple DOS had three major releases: DOS 3.1, DOS 3.2, and DOS 3.3; each one of these three releases was followed by a second, minor "bug-fix" release, but only in the case of Apple DOS...

 and ProDOS
ProDOS
ProDOS was the name of two similar operating systems for the Apple II series of personal computers. The original ProDOS, renamed ProDOS 8 in version 1.2, was the last official operating system usable by all Apple II series computers, and was distributed from 1983 to 1993...

, Commodore 64
Commodore 64
The Commodore 64 is an 8-bit home computer introduced by Commodore International in January, 1982. Volume production started sometime in the spring of 1982, with machines being released on to the market in August at a price of US$ 595...

, Macintosh
Macintosh
The Macintosh, or Mac, is a series of several lines of personal computers designed, developed, and marketed by Apple Inc. The first Macintosh was introduced on January 24 1984; it was the first commercially successful personal computer to feature a mouse and a graphical user interface rather than a...

 68XXX and Amiga
Amiga
The Amiga was a family of personal computers originally developed by Amiga Corporation. Development on the Amiga began in 1982 with Jay Miner as the principal hardware designer. Commodore International bought Amiga Corporation and introduced the machine to the market in 1985...

.

From the 1980s and continuing throughout the 1990s until Manx Software Systems disappeared, the MS DOS version of Aztec C was offered both as a native mode compiler or as a cross compiler for other platforms with different processors including the Commodore 64 and Apple II. Internet distributions still exist for Aztec C including their MS DOS based cross compilers. They are still in use today.

Manx's Aztec C86, their native mode 8086
Intel 8086
The 8086 is a 16-bit microprocessor chip designed by Intel and introduced on the market in 1978, which gave rise to the x86 architecture. Intel 8088, released in 1979, was essentially the same chip, but with an external 8-bit data bus , and is notable as the processor used in the original IBM...

 MS DOS compiler, was also a cross compiler. Although it did not compile code for a different processor like their Aztec C65 6502
MOS Technology 6502
The MOS Technology 6502 is an 8-bit microprocessor that was designed by Chuck Peddle and Bill Mensch for MOS Technology in 1975. When it was introduced, it was the least expensive full-featured microprocessor on the market by a considerable margin, costing less than one-sixth the price of...

 cross compilers for the Commodore 64 and Apple II, it created binary executables for then-legacy operating systems for the 16 bit 8086 family of processors.

When the IBM PC was first introduced it was available with a choice of operating systems, CP/M 86
CP/M
CP/M is an operating system originally created for Intel 8080/85 based microcomputers by Gary Kildall of Digital Research, Inc...

 and PC DOS being two of them. Aztec C86 was provided with link libraries for generating code for both IBM PC
IBM PC
The IBM Personal Computer, commonly known as the IBM PC, is the original version and progenitor of the IBM PC compatible hardware platform. It is IBM model number 5150, and was introduced on August 12, 1981...

 operating systems. Throughout the 1980s later versions of Aztec C86 (3.xx, 4.xx and 5.xx) added support for MS DOS "transitory" versions 1 and 2 and which were less robust than the "baseline" MS DOS version 3 and later which Aztec C86 targeted until its demise.

Finally, Aztec C86 provided C language developers with the ability to produce ROM-able
ROM image
A ROM image, or simply ROM, is a computer file which contains a copy of the data from a read-only memory chip, often from a video game cartridge, a computer's firmware, or from an arcade game's main board...

 "HEX"
Hexadecimal
In mathematics and computer science, hexadecimal is a numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen.Its primary use is as a...

 code which could then be transferred using a ROM Burner directly to an 8086 based processor. Paravirtualization
Paravirtualization
In computing, paravirtualization is a virtualization technique that presents a software interface to virtual machines that is similar but not identical to that of the underlying hardware....

 may be more common today but the practice of creating low-level ROM code was more common per-capita during those years when device driver
Device driver
In computing, a device driver or software driver is a computer program allowing higher-level computer programs to interact with a hardware device....

 development was often done by application programmers for individual applications, and new devices amounted to a cottage industry. It was not uncommon for application programmers to interface directly with hardware without support from the manufacturer. This practice was similar to Embedded Systems Development
Embedded system
An embedded system is a computer system designed to perform one or a few dedicated functions , often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. In contrast, a general-purpose computer, such as a personal...

 today.

Thomas Fenwick and James Goodnow II were the two principle developers of Aztec-C. Fenwick later became notable as the author of the Microsoft
Microsoft
Microsoft Corporation is a multinational computer technology corporation that develops, manufactures, licenses, and supports a wide range of software products for computing devices...

 Windows CE
Windows CE
Windows CE is an operating system developed by Microsoft for minimalistic computers and embedded systems. Windows CE is a distinctly different operating system and kernel, rather than a trimmed-down version of desktop Windows...

 Kernel or NK ("New Kernel") as it was then called.

Early History - 1980's


Microsoft C (MSC) has a long history dating back to the 1980s. The first Microsoft C Compilers were made by the same company who made Lattice C
Lattice C
Lattice C was the first C compiler for MS-DOS on the IBM PC, in 1982. It was ported to many other platforms, such as mainframes , minicomputers , workstations , OS/2, the Commodore Amiga, Atari ST and the Sinclair QL.The compiler was subsequently repackaged by Microsoft under a distribution...

 and were rebranded by Microsoft as their own until MSC 4 which was the first version that Microsoft produced themselves.

In 1987 many developers started switching to Microsoft C, and many more would follow throughout the development of Microsoft Windows to its present state. Products like Clipper and later Clarion emerged that offered easy database application development by using cross language techniques allowing part of their programs to be compiled with Microsoft C.

1987


C programs had long been linked with modules written in Assembly Language
Assembly language
Assembly languages are a family of low-level languages for programming computers, microprocessors, microcontrollers, and other integrated circuits. They implement a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture...

. C itself was usually written in Assembly Language, and most C compilers (even current compilers) offer an Assembly Language pass (that can be "tweaked" for efficiency then linked to the rest of the program after assembling).

Compilers like Aztec-C converted everything to assembly language as a distinct pass and then assembled the code in a distinct pass, and were noted for their very efficient and small code, but by 1987 the optimizer built into Microsoft C was very good and only "mission critical" parts of a program were usually considered for rewriting. In fact C language programming had taken over as the "lowest-level" language, with programming becoming a multi-disciplinary growth industry and projects becoming larger with programmers writing user interfaces and database interfaces in higher-level languages, and a need had emerged that required cross language development that continues to this day.

By 1987 with the release of MSC 5.1 Microsoft offered a cross language development environment for MS DOS. 16 bit binary object code written in Assembly Language
Assembly language
Assembly languages are a family of low-level languages for programming computers, microprocessors, microcontrollers, and other integrated circuits. They implement a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture...

 (MASM) and Microsoft's other languages including Quick Basic, Pascal
Pascal (programming language)
Pascal is an influential imperative and procedural programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structuring.A derivative known as Object Pascal...

, and Fortran
Fortran
Fortran is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation and scientific computing...

 could be linked together into one program in a process they called "Mixed Language Programming" and now "InterLanguage Calling". If BASIC
BASIC
In computer programming, BASIC is a family of high-level programming languages. The original BASIC was designed in 1964 by John George Kemeny and Thomas Eugene Kurtz at Dartmouth in New Hampshire, USA to provide computer access to non-science students...

 was used in this mix, the main program needed to be in BASIC to support the internal runtime
Run-time system
A run-time system is a collection of software designed to support the execution of computer programs written in some computer language...

 that compiled BASIC required for garbage collection and its other managed operations that simulated a BASIC Interpreter
Interpreter (computing)
In computer science, an interpreter is a computer program which reads source code written in a high-level programming language, transforms the code to machine code, and executes the machine code. Using an interpreter, a single source file can produce equal results even in vastly different systems...

 like QBasic
QBasic
QBasic is an IDE and interpreter for a variant of the BASIC programming language which is based on QuickBasic. Code entered into the IDE is compiled to an intermediate form, and this intermediate form is immediately interpreted on demand within the IDE. It can run under nearly all versions of DOS...

 in MS DOS.

The C code in particular needed to be written to pass its variables in "reverse order" on the stack
Call stack
In computer science, a call stack is a stack data structure that stores information about the active subroutines of a computer program. This kind of stack is also known as an execution stack, control stack, function stack, or run-time stack, and is often shortened to just "the stack"...

 and return its values on the stack rather than in a processor register. There were other programming rules to make all the languages work together but this particular rule persisted through the cross language development that continued throughout Windows
Microsoft Windows
Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces...

 16 and 32 bit versions and in the development of programs for OS 2 and which persists to this day. It is known as the "Pascal Calling Convention" but is so common that it is taken for granted and the term is rarely used.

Another type of cross compilation that Microsoft C was used for during this time was in retail applications that require Handheld Devices like the Symbol Technologies
Symbol Technologies
Symbol Technologies is a manufacturer and worldwide supplier of mobile data capture and delivery equipment. The company specializes in barcode scanners, mobile computers, RFID systems and Wireless LAN infrastructure. Symbol Technologies is a wholly owned subsidiary of Motorola, and headquartered in...

 PDT3100 (used to take inventory
Inventory
Inventory is a list for goods and materials, or those goods and materials themselves, held available in stock by a business. It is also used for a list of the contents of a household and for a list for testamentary purposes of the possessions of someone who has died...

), which provided a link library targeted at an 8088
Intel 8088
The Intel 8088 microprocessor was a variant of the Intel 8086 and was introduced on July 1, 1979. It had an 8-bit external data bus instead of the 16-bit bus of the 8086. The 16-bit registers and the one megabyte address range were unchanged, however...

 based Bar Code Scanner
Barcode reader
A barcode reader is an electronic device for reading printed barcodes. Like a flatbed scanner, it consists of a light source, a lens and a light sensor translating optical impulses into electrical ones...

. Comparable to what is done today for that same market using Windows Mobile
Windows Mobile
Windows Mobile is a compact operating system developed by Microsoft, and designed for use in smartphones and mobile devices.It is based on Windows CE, and features a suite of basic applications developed using the Microsoft Win32 API. It is designed to be somewhat similar to desktop versions of...

 by companies like Motorola
Motorola
Motorola, Inc. is an American, multinational, Fortune 100, telecommunications company based in Schaumburg, Illinois. It is a manufacturer of wireless telephone handsets, and also designs and sells wireless network infrastructure equipment such as cellular transmission base stations and signal...

 who bought Symbol, the application was built on the host computer then transferred to the Handheld Device (via a serial cable
Serial cable
A serial cable is a cable that can be used to transfer information between two devices using serial communication, often using the RS-232 standard. Serial cables may use D-subminiature connectors with 9 or 25 pins, but other connectors are used...

) where it was run.

Early 1990's


Throughout the 1990s and beginning with MSC 6 (their first ANSI C
ANSI C
ANSI C is the standard published by the American National Standards Institute for the C programming language. Software developers writing in C are encouraged to conform to the requirements in the document, as it encourages easily portable code....

 compliant compiler) Microsoft re-focused their C compilers on the emerging Windows Market, and also on OS 2 and in the development of GUI
Gui
Gui or guee is a generic term to refer to grilled dishes in Korean cuisine. These most commonly have meat or fish as their primary ingredient, but may in some cases also comprise grilled vegetables or other vegetarian ingredients. The term derives from the verb, "gupda" in Korean, which literally...

 programs. Mixed Language compatibility remained through MSC 6 on the MS DOS side, but the API for Microsoft Windows 3.0 and 3.1 was written in MSC 6. MSC 6 was also extended to provide support for 32 Bit assemblies and support for the emerging Windows for Workgroups (WFW) and Windows NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was originally designed to be a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was...

 which would form the foundation for Windows XP
Windows XP
Windows XP is a line of operating systems produced by Microsoft for use on personal computers, including home and business desktops, laptops, and media centers. The name "XP" is short for "eXPerience"...

. A programming practice called a Thunk
Thunk
The word thunk has at least three related meanings in computer science. A "thunk" may be:* a piece of code to perform a delayed computation * a feature of some virtual function table implementations...

 was even introduced to allow cross assembly instruction passing between 16 and 32 bit programs that took advantage of runtime binding rather than the static binding that was favoured in Monolithic
Monolithic system
Monolithic system can have different meanings in the contexts of computer software and hardware.-In software:A software system is called "monolithic" if it has a monolithic architecture, in which functionally distinguishable aspects , are not architecturally separate components but are...

 16 bit MS DOS applications. Static binding is still favoured by some native code developers but does not generally provide the degree of re-use required by newer best practices like CMM
Capability Maturity Model
The Capability Maturity Model is a service mark and a concept that was developed in the field of software development that provides a model for understanding the capability maturity of an organization's software development business processes...

.

MS DOS support was still provided with the release of Microsoft's first C++ Compiler, MSC 7, which was backwardly compatible with the C programming language and MS DOS and supported both 16 bit and 32 bit code generation.

It is fair to say at this point that MSC took over where Aztec C86 left off. Since the market share for C compilers had turned to cross compilers which took advantage of the latest and greatest Windows features, offered C and C++ in a single bundle and still supported MS DOS systems that were already a decade old, the smaller companies that produced compilers like Aztec C could no longer compete and either turned to niche markets like embedded systems or disappeared.

MS DOS and 16 bit code generation support continued until MSC 8.00c which was bundled with Microsoft C++ and Microsoft Application Studio 1.5, the forerunner of Microsoft Visual Studio which is the cross development environment that Microsoft provide today.

Late 1990's


MSC 12 was released with Microsoft Visual Studio 6 and no longer provided support for MS DOS 16 bit binaries instead providing support for 32 bit console applications, but provided support for WIN 95 and WIN 98 code generation as well as for WIN NT. Link libraries were available for other processors that ran Microsoft Windows; a practice that Microsoft continues to this day.

MSC 13 was released with Visual Studio 2003
Microsoft Visual Studio
Microsoft Visual Studio is an Integrated Development Environment from Microsoft. It can be used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all...

, and MSC 14 was released with Visual Studio 2005
Microsoft Visual Studio
Microsoft Visual Studio is an Integrated Development Environment from Microsoft. It can be used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all...

, both which will still produce code for older systems like Windows 95, but which will produce code for several target platforms including the Mobile Market and the ARM
ARM architecture
The ARM is a 32-bit reduced instruction set computer instruction set architecture developed by ARM Limited. It was known as the Advanced RISC Machine, and before that as the Acorn RISC Machine. The ARM architecture is the most widely used 32-bit ISA in terms of numbers produced...

 processor.

DotNET and Beyond


In 2001 Microsoft developed the Common Language Runtime (CLR
Common Language Runtime
The Common Language Runtime is a core component of Microsoft's .NET initiative. It is Microsoft's implementation of the Common Language Infrastructure standard, which defines an execution environment for program code...

), which formed the core for their DotNET (.NET)
.NET Framework
The Microsoft .NET Framework is a software framework that can be installed on computers running Microsoft Windows operating systems. It includes a large library of coded solutions to common programming problems and a virtual machine that manages the execution of programs written specifically for...

 compiler in the Visual Studio IDE
Integrated development environment
An integrated development environment also known as integrated design environment or integrated debugging environment is a software application that provides comprehensive facilities to computer programmers for software development...

. This layer on the operating system which is in the API allows the mixing of development languages compiled across platforms that run the Windows operating system.

The DotNET
.NET Framework
The Microsoft .NET Framework is a software framework that can be installed on computers running Microsoft Windows operating systems. It includes a large library of coded solutions to common programming problems and a virtual machine that manages the execution of programs written specifically for...

 runtime and CLR
Common Language Runtime
The Common Language Runtime is a core component of Microsoft's .NET initiative. It is Microsoft's implementation of the Common Language Infrastructure standard, which defines an execution environment for program code...

 provide a mapping
layer to the core routines for the processor and the devices on the target computer. The command line C compiler in Visual Studio will compile native code for a variety of processors and can be used to build the core routines themselves.

Microsoft .NET applications for target platforms like Windows Mobile
Windows Mobile
Windows Mobile is a compact operating system developed by Microsoft, and designed for use in smartphones and mobile devices.It is based on Windows CE, and features a suite of basic applications developed using the Microsoft Win32 API. It is designed to be somewhat similar to desktop versions of...

 on the ARM Processor
ARM architecture
The ARM is a 32-bit reduced instruction set computer instruction set architecture developed by ARM Limited. It was known as the Advanced RISC Machine, and before that as the Acorn RISC Machine. The ARM architecture is the most widely used 32-bit ISA in terms of numbers produced...

 cross-compile on Windows machines with a variety of processors and Microsoft also offer emulators and remote deployment environments that require very little configuration, unlike the cross compilers in days gone by or on other platforms.

Runtimes for non-Windows operating systems including Linux
Linux
Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed,...

, like Mono
Mono (software)
Mono is a free and open source project led by Novell to create an Ecma standard compliant, .NET-compatible set of tools, including among others a C# compiler and a Common Language Runtime...

 provide compatibility for cross-compiled .NET programs.

Libraries like Qt
Qt (toolkit)
Qt is a cross-platform application development framework, widely used for the development of GUI programs , and also used for developing non-GUI programs such as console tools and servers. Qt is most notably used in KDE, Google Earth, Skype, Qt Extended, Adobe Photoshop Album, VirtualBox and OPIE...

 and its predecessors including XVT Design
XVT
XVT is a software development environment for building cross-platform GUI applications in C or C++. XVT allows developers to graphically lay out an application's GUI, and provides cross-platform libraries to aid development....

 provide source code level cross development capability with other platforms, while still using Microsoft C to build the Windows versions. Other compilers like MinGW
MinGW
MinGW , formerly mingw32, is a native software port of the GNU Compiler Collection to Microsoft Windows, along with a set of freely distributable import libraries and header files for the Windows API. MinGW allows developers to create native Microsoft Windows applications...

 have also become popular in this area since they are more directly compatible with the Unixes that comprise the non-Windows side of software development allowing those developers to target all platforms using a familiar build environment.

External links

  • http://www.airs.com/ian/configure/configure_5.html is a book reference for configuring GNU cross compilation tools
  • Building Cross Toolchains with gcc is a wiki of other GCC cross-compilation references
  • http://www.scratchbox.org/ Scratchbox is a toolkit for Linux cross-compilation to ARM and x86 targets
  • Crosstool is a helpful toolchain
    Toolchain
    In software, a toolchain is the set of computer programs that are used to create a product...

     of scripts, which create a Linux cross-compile environment for the desired architecture, including embedded systems
  • buildroot is another set of scripts for building a uClibc
    UClibc
    In computing, uClibc is a small C standard library intended for embedded Linux systems. uClibc was created to support uClinux, a version of Linux not requiring a memory management unit and thus suited for microcontrollers .The project lead is Erik Andersen. The other main contributor is Manuel...

    -based toolchain, usually for embedded systems
  • T2 SDE is another set of scripts for building whole Linux Systems based on either GNU libC, uClibc or dietlibc for a variety of architectures
  • Cross Linux from Scratch Project
  • http://www.rubygarden.org/ruby?RubyOnUCLinux Entry on cross compiling ruby to uCLinux
  • IBM has a very clear structured tutorial about cross-building a GCC toolchain. A PDF file containing the tutorial appears to be available here, although IBM requests that you register and access the tutorial here http://tcuvelier.developpez.com/cross-gcc/gcc-cross/Here is another tutorial to build a cross-GCC toolchain, but from Windows to Linux, a subject rarely developed