Differences

This shows you the differences between two versions of the page.

about:toolchain [2012/12/17 23:30]
about:toolchain [2014/05/27 20:22] (current)
wutje old revision restored, previous had link spam
Line 1: Line 1:
====== OpenWrt Buildroot – About ====== ====== OpenWrt Buildroot – About ======
-**OpenWrt Buildroot** is a set of [[wp>Make_(software)#Makefiles|Makefiles]] and [[wp>Patch_(computing)|patches ]]that allows you to easily generate both a [[wp>Cross_compiler|cross-compilation]] [[wp>Toolchain|toolchain]] and a [[http://gnulinux.in/forum/what-root-file-system|root filesystem]] for [[wp>Embedded_system|embedded systems]]. It is a heavily modified [[http://www.buildroot.org/|Buildroot]]. The cross-compilation toolchain uses [[wp>uClibc|uClibc]], a tiny [[wp>C_standard_library|C standard library]].+**OpenWrt Buildroot** is a set of [[wp>Make_(software)#Makefiles|Makefiles]] and [[wp>Patch_(computing)|patches ]]that allows users to easily generate both a [[wp>Cross_compiler|cross-compilation]] [[wp>Toolchain|toolchain]] and a [[http://gnulinux.in/forum/what-root-file-system|root filesystem]] for [[wp>Embedded_system|embedded systems]]. It is a heavily modified [[http://www.buildroot.org/|Buildroot]]. The cross-compilation toolchain uses [[wp>uClibc|uClibc]], a tiny [[wp>C_standard_library|C standard library]].
-A compilation toolchain is the set of tools that allows you to compile code for your system. +A compilation toolchain is the set of tools used to compile code for your system.
It consists of: It consists of:
-  * a compiler (in our case, ''[[wp>GNU Compiler Collection|gcc]]'' / [[http://packages.debian.org/squeeze/gcc|deb: gcc]]) +  * a compiler (in our case, ''[[wp>GNU Compiler Collection|gcc]]'' / [[http://packages.debian.org/wheezy/gcc|deb: gcc]]) 
-  * binary utils like assembler and linker (in our case, ''[[wp>GNU Binutils|binutils]]'' / [[http://packages.debian.org/squeeze/binutils|deb: binutils]] ) +  * binary utils like assembler and linker (in our case, ''[[wp>GNU Binutils|binutils]]'' / [[http://packages.debian.org/wheezy/binutils|deb: binutils]] )
  * a [[wp>C standard library]] (for example GNU Libc, uClibc or dietlibc).   * a [[wp>C standard library]] (for example GNU Libc, uClibc or dietlibc).
-If you're using a PC, your compilation toolchain runs on an [[wp>x86]] processor and generates code for a x86 processor. Under most Linux systems, the compilation toolchain uses the [[wp>GNU_C_Library|GNU libc]] as C standard library. This compilation toolchain is called the "host compilation toolchain", and more generally, the machine on which it is running, and on which you're working is called the "host system". The compilation toolchain is provided by your distribution, and OpenWrt Buildroot has nothing to do with it.+Using a PC, the compilation toolchain runs on an [[wp>x86]] processor and generates code for a x86 processor. On most Linux systems, the compilation toolchain uses the [[wp>GNU_C_Library|GNU libc]] as C standard library. It is called the "host compilation toolchain", and the machine it is running on is called the "host system". The compilation toolchain is provided by the distribution, and has nothing to do with OpenWrt Buildroot.
-As said above, the compilation toolchain that comes with your system runs and generates code for the processor of your host system. As your embedded system has a different processor, you need a cross-compilation toolchain: it's a compilation toolchain that runs on your host system but that generates code for your target system (and target [[doc:hardware:cpu|processor]]'s ISA). For example, if your host system uses x86 and your target system uses MIPS32, the regular compilation toolchain of your host runs on x86 and generates code for x86, while the cross-compilation toolchain runs on x86 and generates code for MIPS32.+Embedded systems use a different processor and require a cross-compilation toolchain - a compilation toolchain that runs on a host system but that generates code for a target system (and target [[doc:hardware:cpu|processor]]'s instruction set architecture (ISA). For example, if your host system uses x86 and your target system uses MIPS32, the regular compilation toolchain of your host runs on x86 and generates code for x86, while the cross-compilation toolchain runs on x86 and generates code for MIPS32.
-You might wonder why such a tool is needed when you can compile ''gcc'', ''binutils'', ''uClibc'' and all the tools by hand. Well, it is not needed. Of course, you can do everything manually, but dealing with all the configure options, with all problems of every ''gcc'' or ''binutils'' version is very time-consuming and uninteresting. OpenWrt Buildroot automates this process through the use of Makefiles, and has a collection of patches for each ''gcc'' and ''binutils'' version to make them work on the respective instruction set architecture of most embedded systems.+While it is possible to manually configure and compile your own software, OpenWrt Buildroot automates this process to work on the instruction set architecture of most embedded systems.
-While the OpenWrt Buildroot was intended mostly for developers, it is still simple enough that an inexperienced end user can easily build his or her own customized firmware!+While the OpenWrt Buildroot was designed for developers, inexperienced users can also use it to easily build their own custom firmware!
 +The OpenWrt Makefile has its own syntax, different from the conventional Makefile of Linux make tool. The OpenWrt Makefile defines the meta information of the package, where to download the package,how to compile, where to installed thecompiled binaries,etc. See How to Build OpenWrt Application Package for more detail.
-==== Available Documentation ==== +===== OpenWrt Buildroot – Features ===== 
-  * [[http://downloads.openwrt.org/docs/buildroot-documentation.html]] solid docu from 2006. Only minor things are outdated!+  * Makes it easy to port software 
 +  * Uses kconfig (Linux Kernel menuconfig) for configuration of features 
 +  * Provides integrated cross-compiler toolchain (gcc, ld, ...) 
 +  * Provides abstraction for autotools (automake, autoconf), cmake, scons 
 +  * Handles standard download, patch, configure, compile and packaging workflow 
 +  * Provides a number of common fixups for badly behaving packages
-  - OpenWrt Buildroot – About+===== OpenWrt Buildroot – Make Targets ===== 
 +  * Offers a number of high level make targets for standard package workflows 
 +  * Targets always in the format „component/name/action“, e.g. „toolchain/gdb/compile“ or „package/mtd/install“ 
 +  * Prepare a package source tree: package/foo/prepare 
 +  * Compile a package: package/foo/compile 
 +  * Clean a package: package/foo/clean 
 + 
 +===== OpenWrt Buildroot – Build sequence ===== 
 +  - ''tools'' – automake, autoconf, sed, cmake 
 +  - ''toolchain/binutils'' – as, ld, ... 
 +  - ''toolchain/gcc'' – gcc, g++, cpp, ... 
 +  - ''target/linux'' – kernel modules 
 +  - ''package'' – core and feed packages 
 +  - ''target/linux'' – kernel image 
 +  - ''target/linux/image'' – firmware image file generation 
 + 
 +===== Patch management ===== 
 +  * Many packages will not work as-is and need patches to work on the target or to even compile 
 +  * OpenWrt Buildroot integrates [[wp>Quilt (software)|quilt]] for easy patch management 
 +  * Turn package patches into quilt series: make package/foo/prepare QUILT=1 
 +  * Update patches from modified series: make package/foo/update 
 +  * Automatically rebase patches after an update: make package/foo/refresh 
 + 
 +===== Packaging considerations ===== 
 +  * Main objective is small memory and size footprint 
 +  * Features that make no sense on embedded systems get disabled through configure or are patched out 
 +  * Packages must be compilable regardless of the host system, should be self contained 
 +  * Shipped „configure“ scripts are often faulty or unusable in a cross-compile setting, autoreconf or patching needed 
 +  * Build variants and kconfig includes allow for configurable compile-time settings 
 +  * There is no standard way for porting software, in many cases it „just works“ but often the package build process needs tweaks 
 + 
 +===== Documentation ===== 
 +  - [[about:toolchain|OpenWrt Buildroot – About]]
  - [[doc:howto:buildroot.exigence|OpenWrt Buildroot – Installation]]   - [[doc:howto:buildroot.exigence|OpenWrt Buildroot – Installation]]
  - [[doc:howto:build|OpenWrt Buildroot – Usage]]   - [[doc:howto:build|OpenWrt Buildroot – Usage]]
-  - [[doc:devel:feeds|OpenWrt Buildroot – Feeds]] +  - [[doc:devel:patches|OpenWrt Buildroot – Patches]] 
- - [[doc:techref:buildroot|OpenWrt Buildroot – Technical Reference]] {{:meta:icons:tango:48px-construction.svg.png?nolink&16}} this article needs //your// attention.+
-  * Keep in mind that there are 4 methods to [[doc:howto:obtain.firmware]]+===== History ===== 
 +  * [[https://dev.openwrt.org/search?changeset=on&q=buildroot-ng|commits concerning OpenWrt Buildroot]] 
 +  * [[https://dev.openwrt.org/browser/trunk/include/target.mk|include/target.mk]] 
 +  * [[https://forum.openwrt.org/viewtopic.php?pid=31794#p31794|OpenWrt Forums: An introduction to OpenWrt Buildroot]]

Back to top

about/toolchain.1355783424.txt.bz2 · Last modified: 2012/12/17 23:30 (external edit)