[Buildroot] Using a precompiled busybox toolchain as an external toolchain

Willy Lambert lambert.willy at gmail.com
Tue Jan 29 16:49:14 UTC 2013


2013/1/29 Thomas Petazzoni <thomas.petazzoni at free-electrons.com>:
> Dear Willy Lambert,
>
> On Tue, 29 Jan 2013 16:57:56 +0100, Willy Lambert wrote:
>
>> > As I have seen some chat about buildroot toolchain and these problem
>> > of relocability, a question arise :
>> >
>> > Is buildroot toolchain supposed to be maintained in the long run ? Or
>> > do you expect people switching more and more on external toolchains ?
>
> Let's make a status of the available toolchain backends:
>
>  * Buildroot internal toolchain backend. This is the historical
>    backend. Everything is done by Makefile directly inside Buildroot:
>    building binutils, gcc, uClibc, etc. It is limited to uClibc. There
>    are discussions since a long time on phasing out this backend in
>    favor of the Crosstool-NG backend, but this hasn't happened yet, as
>    there are remaining issues to solve with the Crosstool-NG backend. I
>    am not sure when/if the internal backend will really go away one day.
>
>  * External toolchain backend. It allows to re-use existing, pre-built,
>    toolchains. Those toolchains could have been generated by
>    Crosstool-NG, Buildroot, manually, or be provided by a hardware/SoC
>    manufacturer. Buildroot really doesn't care here, it simply uses the
>    pre-built toolchain as is, and it doesn't build the toolchain.
>
>  * Crosstool-NG backend. In this case, Buildroot builds the toolchain,
>    but instead of doing it with internal Makefiles (as done by the
>    internal backend described above), it downloads Crosstool-NG,
>    installs it, generates a configuration file for it, and triggers the
>    build. Once the Crosstool-NG build is done, we are back to the normal
>    case where a toolchain is now available, and Buildroot can continue
>    its work.
>
>> I will try crosstool-ng. Is this toolchain relocable  ? so I can build
>> it first and then take it out of buildroot ?
>
> If you use Crosstool-NG outside of Buildroot, then the toolchain
> produced by Crosstool-NG itself is relocatable. This is a raw
> toolchain: it has only the C library, C library headers and kernel
> headers. No additional libraries.
>
> Then, you can use this pre-build toolchain as an external toolchain in
> Buildroot. Buildroot will build additional libraries, and will install
> them and their headers in a copy of the toolchain sysroot. In some
> sense, the $(O)/host directory of Buildroot becomes a new toolchain,
> which contains your pre-built toolchain, and additional libraries and
> headers. And this new toolchain (in $(O)/host) is *NOT* relocatable at
> the moment, due to various issues: hardcoded paths in .la files, in
> <foobar>-config scripts, in the RPATH of the binaries installed in
> $(O)/host/usr/bin/, etc.
>
> This is something we intend to fix, but that hasn't happened yet.
>
> Does that clarify the situation?
>

Yes, it's kind of you to have written all those historical details.
May I update the documentation with some of those clarifications ?

So in the end, if I want to use the generated toolchain  (in
$(O)/host) to build my own application (which is not a package, it's
the user end application) it is never relocable if I use buildroot
internal or crosstool-ng. I don't mind with that, it's just a matter
of knowing what's happening.

> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com


More information about the buildroot mailing list