Buildroot Support for 32-bit RISC-V

The patches that I submitted to add 32-bit RISC-V architecture support to Buildroot have recently been committed upstream. As part of this patchset a configuration was added to enable the Buildroot autobuilders so that any potential build issues could be highlighted as part of the Buildroot continuous build process. The system configuration at this stage was based around a 4.15 kernel from the riscv-linux repository and a patched version of glibc 2.26 from the riscv-glibc repository. This allowed a QEMU bootable image and root filesystem to be built and tested. (Thanks to Fabrice Bellard for pointing me towards the 32-bit friendly versions of the riscv repositories based on his work on TinyEMU).

The autobuilders quickly highlighted an issue with the version of glibc that was causing a large proportion of package builds to fail when linking against the glibc library. Resolving this issue and improving 32-bit RISC-V support became my top priority task for the Buildroot Developers Meeting in Brussels at the beginning of February 2019 (which was kindly sponsored and hosted by Google). I submitted a patch for the glibc issue on the 4th of February 2019 and, thanks to the tremendous hard work of various Buildroot contributors, a vast improvement in successful package builds was achieved in a couple of days (increasing from around 31% to 87%).

In summary, RISC-V 32-bit support for building fully-featured systems has effectively been available in Buildroot since the 6th of February 2019.

On-going Work

Work is continuing on Buildroot to improve package support and add new features as the RISC-V software ecosystem advances.

At the time of writing Alistair Francis of Western Digital has submitted a number of patches for RISC-V to bump the kernel version to 4.20 (32-bit), bump the glibc version to 2.29 (32-bit) and to replace riscv-pk (BBL) with OpenSBI as the default bootloader (32 and 64-bit) .

Here at Embecosm we will continue to monitor the Buildroot autobuilders and review the status of upstream packages in an on-going effort to improve RISC-V support in Buildroot.

If you have any questions regarding Buildroot for RISC-V or have any features that you would like to see supported, please get in touch.