What is a Linux Toolchain?

A Linux toolchain is a set of tools needed to compile source code into executable code. It includes a compiler, a linker and runtime libraries. It has to be able to compile code written in the commonly for open source packages used languages: C, C++ and Assembly.

Toolchain Components

A standard standard GNU toolchain consists of the following components:

The binutils are a set of binary utilities such as the assembler and the linker. In the GCC, there are the compilers for C and other programming languages, depending of the gcc version. Those compilers produce assembler code from your sourcecode, which is then given to the GNU assembler. C libraries form an API based on the POSIX specification for the user to interact with the kernel space. A commonly used library is libc, which comes with multiple functions, such as “open” to interact with files.

Toolchain Requirements

Along all the needed components, a valid toolchain also needs a copy of the Linux Kernel Header. It contains definitions and constants, which are needed to directly access the Kernel itself. This is not simply a question of making a copy of the header files in the include directory of your kernel source code. Those headers contain definitions, which are supposed for use in the kernel only and will cause conflicts if used raw to compile regular Linux applications.

Since the Linux Kernel shows great backward compatibility, it is not crucial whether the kernel headers are generated from the exact version of Linux you are going to be using or not. The only necessity lies within using headers from a kernel that is the same or an older Version of the Linux Kernel that is deployed on the target.

source: Mastering Embedded Linux Programming - Third Edition By Frank Vasquez, Chris Simmonds