After a year and a half of development, the release of the GNU Mes 0.25 toolset has occurred, facilitating the bootstrapping process for GCC and enabling a closed-loop rebuild from source code. This toolset addresses the challenge of verified initial compiler builds in distributions, breaking the cycle of circular rebuilding (to build a compiler, executables from an already built compiler are required, while binary builds of the compiler can be potential sources of hidden backdoors, preventing full assurance of the integrity of builds from reference source code).
GNU Mes offers a self-hosting interpreter for the Scheme language, written in C, and a basic compiler for C (MesCC), written in Scheme. Both components are mutually buildable. The Scheme interpreter allows building the C compiler MesCC, which can then compile a stripped-down version of TinyCC (tcc), whose capabilities are sufficient for building GCC.
The Scheme interpreter is very compact, consisting of about 5,000 lines of code in the simplest subset of C and can be transformed into an executable file using the universal translator M2-Planet or a basic C compiler built using the self-hosting assembler hex0, which does not require external dependencies. The interpreter includes a complete garbage collector and provides a library for loadable modules. The project is also developing the Mes C library, which is sufficient for building glibc 2.2.5, binutils 2.20.1, and gcc 2.95.3, necessary for deploying the Guix distribution for platforms i686-linux, x86_64-linux, armhf-linux, and aarch64-linux, using only source code (Full Source Bootstrap).
The new release implements support for the RISC-V architecture (RISC-V64-linux) and adds compilation support using the M2-Planet transpiler. Building with M2-Planet version 1.11.0 is supported for the target platform x86_64-linux. Specifying the ‘—bootstrap-mode’ option when using M2-Planet is no longer required. MesCC has resolved compatibility issues with GCC versions 10+, ensured the initialization of structure fields to 0, and restored the ability to debug binary files at the individual function level.
Future releases are expected to include support for NixOS bootstrapping only from source code, support for modules fully compatible with Guile, the ability to run Gash and Gash-Utils, support for bootstrapping gcc 4.6.4, and the capability for complete system builds from source code in Linux environments based on armhf and riscv64 architectures.
Source: opennet.ru
