FACTOID # 30: If Alaska were its own country, it would be the 26th largest in total area, slightly larger than Iran.
 
 Home   Encyclopedia   Statistics   States A-Z   Flags   Maps   FAQ   About 
   
 
WHAT'S NEW
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > 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 run. Cross compiler tools are generally found in use to generate compiles for embedded system or multiple platforms. It is a tool that one must use for a platform where it is inconvenient or impossible to compile on that platform, like microcontrollers that run with a minimal amount of memory for their own purpose. It has become more common to use this tool for paravirtualization where a system may have one or more platforms in use. A diagram of the operation of a typical multi-language, multi-target compiler. ... In computing, a platform describes some sort of framework, either in hardware or software, which allows software to run. ... A programming tool is a program or application that software developers use to create, debug, or maintain other programs and applications. ... A router, an example of an embedded system. ... It has been suggested that this article or section be merged with embedded microprocessor. ... 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. ...

Contents

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 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 is available on an embedded system, cross-compilation can be more involved and 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. 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.

Use of virtual machines (such as Java's JVM) 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. A router, an example of an embedded system. ... A typical server farm. ... Bootstrapping is a term used in computer science to describe the techniques involved in writing a compiler (or assembler) in the target programming language which it is intended to compile. ... In computer science, a virtual machine is software that creates a virtualized environment between the computer platform and its operating system, so that the end user can operate software on an abstract machine. ... The Java platform is the name for a bundle of related programs, or platform, from Sun Microsystems which allow for developing and running programs written in the Java programming language. ... A Java Virtual Machine (JVM) is a set of computer software programs and data structures which implements a specific virtual machine model. ...


Typically the hardware architecture differs (e.g. compiling a program destined for the MIPS architecture on an x86 computer) but cross-compilation is also applicable when only the operating system environment differs, as when compiling a FreeBSD program under Linux, or even just the system library, as when compiling programs with uClibc on a glibc host. Hardware is an expression used within the engineering disciplines to explicitly distinguish the (electronic computer) hardware from the software which runs in it. ... A MIPS R4400 microprocessor made by Toshiba. ... x86 or 80x86 is the generic name of a microprocessor architecture first developed and manufactured by Intel. ... // An operating system (OS) is the software that manages the sharing of the resources of a computer. ... FreeBSD is a Unix-like free operating system descended from AT&T UNIX via the Berkeley Software Distribution (BSD) branch through the 386BSD and 4. ... This article is about operating systems that use the Linux kernel. ... In computing, uClibc is a small C library intended for embedded Linux systems. ... Glibc is the GNU projects C standard library, licensed under the LGPL. The lead contributor and maintainer is Ulrich Drepper. ...


GCC and cross compilation

gcc, a free software 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. The GNU Compiler Collection (usually shortened to GCC) is a set of programming language compilers produced by the GNU Project. ... Clockwise from top: The logo of the GNU Project (the GNU head), the Linux kernel mascot Tux the Penguin, and the FreeBSD daemon Free software is a term coined by Richard Stallman and the Free Software Foundation[1] to refer to software that can be used, studied, and modified without...


gcc requires that a compiled copy of binutils be available for each targeted platform. Especially important is the GNU Assembler. 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, which can be done using the following (on UNIX-like operating systems with bash): The GNU Compiler Collection (usually shortened to GCC) is a set of programming language compilers produced by the GNU Project. ... The GNU Binutils is a collection of programming tools developed by the Free Software Foundation for the manipulation of object code in various object file formats. ... Gas, commanded as as when typed from the shell, is the GNU assembler. ... The introduction to this article provides insufficient context for those unfamiliar with the subject matter. ... The GNU Compiler Collection (usually shortened to GCC) is a set of programming language compilers produced by the GNU Project. ... The introduction to this article provides insufficient context for those unfamiliar with the subject matter. ... The GNU Compiler Collection (usually shortened to GCC) is a set of programming language compilers produced by the GNU Project. ... The GNU Binutils is a collection of programming tools developed by the Free Software Foundation for the manipulation of object code in various object file formats. ... Look up path in Wiktionary, the free dictionary. ...

 PATH=/path/to/binutils/bin:$PATH; make 

Cross compiling gcc requires that a portion of the target platform's C standard library be available on the host platform. At least the crt0, ... 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, which is a small C library containing only the most essential components required to compile C source code. To configure gcc with newlib, use the switch --with-newlib. The GNU Compiler Collection (usually shortened to GCC) is a set of programming language compilers produced by the GNU Project. ... The C standard library is a now-standardised collection of header files and library routines used to implement common operations, such as input/output and string handling, in the C programming language. ... crt0 (or crt0. ... Newlib is a C library intended for use on embedded systems. ... A C library is a collection of libraries used in programming with the C programming language. ... C is a general-purpose, block structured, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system. ...


The GNU autotools packages (i.e. autoconf, automake, and libtool) 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. The GNU logo, drawn by Etienne Suvasa The GNU Project was announced in 1983 by Richard Stallman. ... GNU Libtool is a GNU programming tool from the GNU build system used for creating portable software libraries. ... The GNU build system is a suite of tools produced by the GNU project that assist in making packages portable to many UNIX-like systems. ... Flow diagram of autoconf and automake Autoconf is a tool for producing shell scripts that automatically configure software source code packages to adapt to many kinds of UNIX-like systems. ... Automake is a programming tool that produces portable makefiles for use by the make program, used in compiling software. ... GNU Libtool is a GNU programming tool from the GNU build system used for creating portable software libraries. ... The Dreamcast , code-named White Belt, Black Belt, Dural, Dricas, Vortex, Katana, Shark and Guppy during development) is Segas final video game console and the successor to the Sega Saturn. ...


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 execute the resulting compiler 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. NetBSD is a freely redistributable, open source version of the Unix-like BSD computer operating system. ... POSIX or Portable Operating System Interface[1] is the collective name of a family of related standards specified by the IEEE to define the application programming interface (API) for software compatible with variants of the Unix operating system. ... Screenshot of a sample Bash session, taken on Gentoo Linux. ... In computer programming, a toolchain is the set of computer programs (tools) that are used to create a product (typically another computer program or system of programs). ...


The term Canadian Cross came about because at the time that these issues were all being hashed out, Canada had three national political parties.


External links

  • How to Choose a Cross Compiler
  • 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/ Scratch box is a toolkit for Linux cross-compilation to ARM and x86 targets
  • Crosstool is a helpful toolchain 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-based toolchain, usually for embedded systems
  • Cross Linux from Scratch Project
  • http://www.rubygarden.org/ruby?RubyOnUCLinux Entry on cross compiling ruby to uCLinux

In computer programming, a toolchain is the set of computer programs (tools) that are used to create a product (typically another computer program or system of programs). ... Scripting programming languages (commonly called scripting languages or script languages) are computer programming languages designed for scripting the operation of a computer. ... In computing, uClibc is a small C library intended for embedded Linux systems. ...

See also


 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m