A few years ago, I set up the toolchain for STM8 development. Back then, simply following the steps in the README was enough to get everything compiled and working out of the box. However, after installing a clean Ubuntu 26.04 along with GCC/G++ 15, I found that compiling stm8-binutils-gdb wasn't as straightforward as it used to be. That is exactly what we will look into today.
The Problem and the Proposed Solution
Since there is no official .deb package available in the repositories, we have to build the toolchain from source. You can find the project homepage at https://stm8-binutils-gdb.sourceforge.io, and the source archives are available for download on https://sourceforge.net/projects/stm8-binutils-gdb/files/.
If you simply follow the instructions, the build fails with a compilation error in the readline library, which is required by stm8-gdb. Apparently, it has not been adapted for building with modern GCC v15. On the other hand, readline is available as a .deb package in the repositories. The idea is to avoid building it from source and instead link against the pre-compiled version provided by the repository.However, there are no out-of-the-box configuration flags to achieve this, so we will need to slightly modify the build configuration scripts.


