The Buildroot user manual 12 / 114
• Use a predefined external toolchain profile, and let Buildroot download, extract and install the toolchain. Buildroot already
knows about a few CodeSourcery and Linaro toolchains. Just select the toolchain profile in Toolchain from the available
ones. This is definitely the easiest solution.
• Use a predefined external toolchain profile, but instead of having Buildroot download and extract the toolchain, you can tell
Buildroot where your toolchain is already installed on your system. Just select the toolchain profile in Toolchain through
the available ones, unselect Download toolchain automatically, and fill the Toolchain path text entry with
the path to your cross-compiling toolchain.
• Use a completely custom external toolchain. This is particularly useful for toolchains generated using crosstool-NG or with
Buildroot itself. To do this, select the Custom toolchain solution in the Toolchain list. You need to fill the Toolch
ain path, Toolchain prefix and External toolchain C library options. Then, you have to tell Buildroot
what your external toolchain supports. If your external toolchain uses the glibc library, you only have to tell whether your
toolchain supports C++ or not and whether it has built-in RPC support. If your external toolchain uses the uClibc library, then
you have to tell Buildroot if it supports RPC, wide-char, locale, program invocation, threads and C++. At the beginning of the
execution, Buildroot will tell you if the selected options do not match the toolchain configuration.
Our external toolchain support has been tested with toolchains from CodeSourcery and Linaro, toolchains generated by crosstool-
NG, and toolchains generated by Buildroot itself. In general, all toolchains that support the sysroot feature should work. If not,
do not hesitate to contact the developers.
We do not support toolchains or SDK generated by OpenEmbedded or Yocto, because these toolchains are not pure toolchains (i.e.
just the compiler, binutils, the C and C++ libraries). Instead these toolchains come with a very large set of pre-compiled libraries
and programs. Therefore, Buildroot cannot import the sysroot of the toolchain, as it would contain hundreds of megabytes of
pre-compiled libraries that are normally built by Buildroot.
We also do not support using the distribution toolchain (i.e. the gcc/binutils/C library installed by your distribution) as the
toolchain to build software for the target. This is because your distribution toolchain is not a "pure" toolchain (i.e. only with the
C/C++ library), so we cannot import it properly into the Buildroot build environment. So even if you are building a system for a
x86 or x86_64 target, you have to generate a cross-compilation toolchain with Buildroot or crosstool-NG.
If you want to generate a custom toolchain for your project, that can be used as an external toolchain in Buildroot, our recom-
mendation is definitely to build it with crosstool-NG. We recommend to build the toolchain separately from Buildroot, and then
import it in Buildroot using the external toolchain backend.
Advantages of this backend:
• Allows to use well-known and well-tested cross-compilation toolchains.
• Avoids the build time of the cross-compilation toolchain, which is often very significant in the overall build time of an embed-
ded Linux system.
Drawbacks of this backend:
• If your pre-built external toolchain has a bug, may be hard to get a fix from the toolchain vendor, unless you build your external
toolchain by yourself using Crosstool-NG.
6.1.2.1 External toolchain wrapper
When using an external toolchain, Buildroot generates a wrapper program, that transparently passes the appropriate options
(according to the configuration) to the external toolchain programs. In case you need to debug this wrapper to check exactly what
arguments are passed, you can set the environment variable BR2_DEBUG_WRAPPER to either one of:
• 0, empty or not set: no debug
• 1: trace all arguments on a single line
• 2: trace one argument per line