Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:guide-developer:toolchain:buildsystem_essentials [2023/03/03 20:17] – [Directory structure] tools stinteldocs:guide-developer:toolchain:buildsystem_essentials [2024/02/26 08:23] (current) – [Description] grammar issue juyongchun
Line 21: Line 21:
 The **build system** is a set of [[wp>Make_(software)#Makefiles|Makefiles]] and [[wp>Patch_(computing)|patches ]] that automates the process of building a [[wp>Cross_compiler|cross-compilation]] [[wp>Toolchain|toolchain]] and then using it to build the Linux kernel, the [[http://gnulinux.in/forum/what-root-file-system|root filesystem]] and possibly other pieces of software (such as [[wp>Das_U-Boot|uboot]]) required to run OpenWrt on a specific device. The **build system** is a set of [[wp>Make_(software)#Makefiles|Makefiles]] and [[wp>Patch_(computing)|patches ]] that automates the process of building a [[wp>Cross_compiler|cross-compilation]] [[wp>Toolchain|toolchain]] and then using it to build the Linux kernel, the [[http://gnulinux.in/forum/what-root-file-system|root filesystem]] and possibly other pieces of software (such as [[wp>Das_U-Boot|uboot]]) required to run OpenWrt on a specific device.
 A typical toolchain consists of: A typical toolchain consists of:
-  * compiler, such as [[wp>GNU Compiler Collection|gcc]] +  * compiler, such as [[wp>GNU Compiler Collection|gcc]] 
-  * binary utilities such as an assembler and a linker; for example [[wp>GNU Binutils|binutils]]  +  * Binary utilities such as an assembler and a linker; for example [[wp>GNU Binutils|binutils]]  
-  * [[wp>C standard library]], such as glibc, musl, uClibc or dietlibc+  * [[wp>C standard library]], such as glibc, musl, uClibc or dietlibc
  
 Usually a toolchain generates code for the same instruction set architecture (ISA) that it runs on ([[wp>x86_64]] in the case of most PCs and servers). Usually a toolchain generates code for the same instruction set architecture (ISA) that it runs on ([[wp>x86_64]] in the case of most PCs and servers).
Line 37: Line 37:
  
 The process of creating a cross compiler can be tricky. The process of creating a cross compiler can be tricky.
-It's not something that's regularly attempted and so the there's a certain amount of mystery and black magic associated with it.+It's not something that's regularly attempted and so there's a certain amount of mystery and black magic associated with it.
 When you're dealing with embedded devices you'll often be provided with a binary copy of a compiler and basic libraries rather than instructions for creating your own - it's a time saving step but at the same time often means you'll be using a rather dated set of tools. When you're dealing with embedded devices you'll often be provided with a binary copy of a compiler and basic libraries rather than instructions for creating your own - it's a time saving step but at the same time often means you'll be using a rather dated set of tools.
 It's also common to be provided with a patched copy of the Linux kernel from the board or chip vendor, but this is also dated and it can be difficult to spot exactly what has been changed to make the kernel run on the embedded platform. It's also common to be provided with a patched copy of the Linux kernel from the board or chip vendor, but this is also dated and it can be difficult to spot exactly what has been changed to make the kernel run on the embedded platform.
Line 103: Line 103:
 ===== Patch management ===== ===== Patch management =====
   * Many packages will not work as-is and need patches to work on the target or to even compile   * Many packages will not work as-is and need patches to work on the target or to even compile
-  * the build system integrates [[wp>Quilt (software)|quilt]] for easy patch management+  * The build system integrates [[wp>Quilt (software)|quilt]] for easy patch management
   * Turn package patches into quilt series: ''make package/foo/prepare QUILT=1''   * Turn package patches into quilt series: ''make package/foo/prepare QUILT=1''
   * Update patches from modified series: ''make package/foo/update''   * Update patches from modified series: ''make package/foo/update''
Line 111: Line 111:
   * Main objective is small memory and size footprint   * Main objective is small memory and size footprint
   * Features that make no sense on embedded systems are disabled through configure or patched out   * Features that make no sense on embedded systems are disabled through configure or patched out
-  * Packages must be compilable regardless of the host system, they should be self contained+  * Packages must be compatible regardless of the host system, they should be self contained
   * Shipped "configure" scripts are often faulty or unusable in a cross-compile setting, autoreconf or patching is often needed   * Shipped "configure" scripts are often faulty or unusable in a cross-compile setting, autoreconf or patching is often needed
   * Build variants and kconfig includes allow for configurable compile-time settings   * Build variants and kconfig includes allow for configurable compile-time settings
  • Last modified: 2023/03/03 20:17
  • by stintel