OPENWRT buildroot–about Compilation process

Source: Internet
Author: User
Tags automake

OpenWrt BuildRoot is a set of makefiles and patches that allows users to easily generate both a cross-compilation Toolchai N and a root filesystem for embedded systems. It is a heavily modified buildroot. The Cross-compilation Toolchain uses uclibc, a tiny C standard library.

A compilation Toolchain is the set of tools used to compile code for your system. It consists of:

? A compiler (in our case, GCC/DEB:GCC)? Binary utils like assembler and linker (in our case, binutils/deb:binutils)? A C standard library (for example GNU Libc, uclibc or DIETLIBC).

Using a PC, the compilation Toolchain runs on an x86 processor and generates code for a x86 processor. On more Linux Systems, the compilation toolchain uses the GNU libc as C Standard library. It is called the ' host compilation Toolchain ', and the machine it was running on is called the "host system". The compilation toolchain are provided by the distribution, and have nothing to does with OpenWrt BuildRoot.

Embedded systems use a different processor and require a cross-compilation toolchain-a compilation toolchain that runs O n A host system but this generates code for a target system (and target 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 Ho St runs on x86 and generates code for x86 when the Cross-compilation Toolchain runs on x86 and generates code for MIPS32 .

While it's possible to manually configure and compile your own software, OpenWrt BuildRoot automates this process to work The instruction set architecture of most embedded systems.

While the OpenWrt BuildRoot is designed for developers, inexperienced users can also use it to easily build their own cus Tom Firmware!

The OpenWrt Makefile have its own syntax, and different from the conventional Makefile of the Linux make tool. The OpenWrt Makefile defines the meta information of the package, where to download the package, how to compile, where to Install the compiled binaries, etc. See how to Build OPENWRT application package for more detail.

OpenWrt buildroot–features ? 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–make Targets ? offers a number of high level do 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

    1. Tools–automake, autoconf, sed, cmake
    2. Toolchain/binutils–as, LD, ...
    3. TOOLCHAIN/GCC–GCC, g++, CPP, ...
    4. Target/linux–kernel Modules
    5. Package–core and Feed Packages
    6. Target/linux–kernel image
    7. Target/linux/image–firmware image File generation

Patch Management ? Many packages won't work as-is and need patches to work on the target or to even compile? OPENWRT BuildRoot integrates quilt for easy patch management? Turn Package patches to 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 do no sense on embedded systems get disabled through configure or is patched out? Packages must be compilable regardless of the host system, should is self contained? Shipped "Configure" scripts is 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 to porting software, in many cases it "just works" but often the package build process needs TWE Aks

This article by http://www.wifidog.pro/2015/08/07/openwrt-%E7%BC%96%E8%AF%91%E8%BF%87%E7%A8%8B.html compilation, reprint please indicate the source

OPENWRT buildroot–about Compilation process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.