Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Buildroot: install and build the toolchain only

I want to install and build just the toolchain for my Buildroot project. make help suggests that the command make <options> toolchain should work; however, running that command simply returns Nothing to be done for 'toolchain'. and output/host is never created.

like image 378
Alessandro Power Avatar asked Dec 07 '22 18:12

Alessandro Power


2 Answers

You first have to configure Buildroot in order to instruct it about what toolchain you want to produce. See Buildroot quick start in the Buildroot user manual.

If you just downloaded Buildroot, the steps to produce a toolchain are:

  1. run make menuconfig
    • In Target options select your hardware platform and ABI
    • In Toolchain configure the kind of toolchain you want
    • exit saving
  2. run make toolchain

The toolchain is in output/host/.

like image 124
Luca Ceresoli Avatar answered Dec 11 '22 11:12

Luca Ceresoli


A more recent way to build just the toolchain, which can be used both within and outside of Buildroot, is documented in the Buildroot manual.

Though make toolchain in Luca's answer does build the toolchain, it also places other host dependencies into output/host/, making it slightly more difficult to get a clean toolchain as compared to make sdk below, which produces a toolchain tarball in output/images/:

6.1.3. Build an external toolchain with Buildroot

The Buildroot internal toolchain option can be used to create an external toolchain. Here are a series of steps to build an internal toolchain and package it up for reuse by Buildroot itself (or other projects).

Create a new Buildroot configuration, with the following details:

  • Select the appropriate Target options for your target CPU architecture
  • In the Toolchain menu, keep the default of Buildroot toolchain for Toolchain type, and configure your toolchain as desired
  • In the System configuration menu, select None as the Init system and none as /bin/sh
  • In the Target packages menu, disable BusyBox
  • In the Filesystem images menu, disable tar the root filesystem

Then, we can trigger the build, and also ask Buildroot to generate a SDK. This will conveniently generate for us a tarball which contains our toolchain:

make sdk

This produces the SDK tarball in $(O)/images, with a name similar to arm-buildroot-linux-uclibcgnueabi_sdk-buildroot.tar.gz. Save this tarball, as it is now the toolchain that you can re-use as an external toolchain in other Buildroot projects.

like image 33
mxxk Avatar answered Dec 11 '22 10:12

mxxk