Buildroot is a quite useful tool when working with small-to-medium embedded systems. It helps you to create the toolchain, the rootfs and, of course, building the kernel and hundreds of packages normally found in standard Linux distributions.
For using Buildroot you need several mandatory and optional requirements in your host machine. They’re listed in the Buildroot manual. However, there are some sub-requirements that aren’t mentioned since they belong to a global requirement. For example the package Thread/Queue.pm is a Perl module that belongs to the global requirement Perl.
The lack of one of these packages can cause building errors that can confuse new users since it could not be clear if it’s an issue with the package that it’s been built or if it’s an issue with the host machine that is missing something.
Normally, when you see an error like the following, you can be sure that there is a missing Perl module in your host machine:
Can't locate Thread/Queue.pm in @INC (you may need to install the Thread::Queue module) (@INC contains: /home/projects/sunxi/buildroot-2015.08.1/output/host/usr/share/automake-1.15 /home/projects/sunxi/buildroot-2015.08.1/output/host/usr/lib/perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /home/projects/sunxi/buildroot-2015.08.1/output/host/usr/bin/automake line 55.
BEGIN failed--compilation aborted at /home/projects/sunxi/buildroot-2015.08.1/output/host/usr/bin/automake line 58.
autoreconf: /home/projects/sunxi/buildroot-2015.08.1/output/host/usr/bin/automake failed with exit status: 2
package/pkg-generic.mk:146: recipe for target '/home/projects/sunxi/buildroot-2015.08.1/output/build/alsa-lib-1.0.29/.stamp_configured' failed
make[1]: *** [/home/projects/sunxi/buildroot-2015.08.1/output/build/alsa-lib-1.0.29/.stamp_configured] Error 2
Makefile:36: recipe for target '_all' failed
make: *** [_all] Error 2
In this example, Buildroot fails to build the ALSA lib since it requires the Perl module Thread/Queue.pm that is missing.
You can easily install it, assuming that you already installed the CPAN module, by typing:
$ cpan
cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.
cpan[1]> install Thread/Queue.pm
This kind of issues can also be present with other requirements, such as Python that can be installed with the pip utility.
Generally speaking, when you see a message like this one, there’s a good chance that the problem is a missing requirement:
autoreconf: /home/projects/sunxi/buildroot-2015.08.1/output/host/usr/bin/automake failed with exit status: 2
package/pkg-generic.mk:146: recipe for target '/home/projects/sunxi/buildroot-2015.08.1/output/build/alsa-lib-1.0.29/.stamp_configured' failed
make[1]: *** [/home/projects/sunxi/buildroot-2015.08.1/output/build/alsa-lib-1.0.29/.stamp_configured] Error 2