I know there are many compilers like gcc
, clang
, ninja
but I keep hearing about "Toolchains
" and so on but I don't understand what they are, like "gnu-toolchain' etc
There are several important terms:
Compiler: the tool that transforms your code into compiled binary format. This usually includes an assembler step which is strictly speaking not really the compiler. Additionally, the tools you invoke are often "drivers" for the compiler/assembler/linker backend and you call them for every step in the build process (including linking). Examples are gcc
/g++
, clang
/clang++
, cl
, icc
/icpc
, ...
Assembler: assembles binary code generated by the compiler into a specific object file format (.obj files for Visual Studio, .o files for pretty much everything else). This is often built-in or at least invoked by the compiler when generating object files from source code. E.g. as
, ...
Linker: links together object files into an executable file format. This can be either a shared library (.dll/.dylib/.so) or an executable application (.exe). Examples are ld
, link
, lld
, ...
(3a) "Librarian": the Unix tool ar
or the Visual studio tool lib.exe
. This just bundles together object files into a thin wrapper format (.a/.lib).
Debugger: tool used to inspect the values of variables defined in the source code at runtime. Examples are gdb
, lldb
, windbg
, ...
Toolchain: All of the above combined together. Debugger may or may not be considered a part of this though.
Build tool: Tool that calls toolchain tools to transform a collection of source files into one or more libraries and executables. E.g. make
, ninja
, msbuild
, xcode-build
, ...
Project generator: Takes an "abstract" description of a project and how the source files relate to the output files and generates something a build tool and/or IDE can use as if the project was built up inside that IDE. This makes cross-platform development a lot less painful if done right. Examples are cmake
, qmake
, premake
, ...
IDE: Text editor enhanced with varying levels of language annotation, code navigation, and toolchain integration. Often you can load project files, search for symbols, build, debug, etc. all from one IDE. Examples are Visual Studio, Qt Creator, KDevelop, Xcode, Eclipse, Code::Blocks, ... and with proper array of plugins: Vim, Emacs, VSCode, Atom, Sublime Text, ...
A toolchain is a set of tools (such as a compiler, linker, and assembler) intended to build your project. Additional tools, such as a debugger, can be associated with a toolchain. There can be several toolchains available, depending on the compilers installed on your system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With