Static Infrastructure for Building a Cross Compiler
https://doi.org/10.25682/NIISI.2025.3.0008
Abstract
The paper addresses the problem of deploying a GCC- and binutils-based cross-compiler toolchain for domestic microprocessors in the context of a wide variety of hardware platforms and Linux distributions. It is shown that the use of shared libraries (primarily glibc) and distribution-specific builds leads to numerous incompatibilities and complicates maintenance. A static, self-contained infrastructure for building a cross-compiler is proposed, comprising the compiler, binary utilities, and a set of libraries built using musl – an alternative implementation of the C standard library. A multi-stage bootstrapping procedure is described that makes it possible to obtain a final toolchain which does not utilize shared libraries and only minimally dependent on the parameters of a specific system (apart from CPU word size and the Linux kernel interface). The limitations associated with abandoning shared libraries (LTO support, sanitizers) are discussed, as well as possible directions for extending the infrastructure by adding auxiliary tools for building, testing, and debugging.
About the Authors
A. A. AsonovRussian Federation
S. V. Samborskiy
Russian Federation
References
1. GCC, the GNU Compiler Collection. https://gcc.gnu.org/ (дата обращения 08.11.2025).
2. GNU Binutils. https://www.gnu.org/software/binutils/ (дата обращения 08.11.2025).
3. gdb and binutils. https://sourceware.org/git/binutils-gdb.git (дата обращения 08.11.2025).
4. В. А. Галатенко, Г. Л. Левченкова, С. В. Самборский. Особенности сборки кросс-компилятора GCC и бинарных утилит. «Труды НИИСИ РАН», Т. 12 (2022), № 4, 43-49.
5. The GNU C Library. https://www.gnu.org/software/libc/ (дата обращения 08.11.2025).
6. The GNU C Library (glibc). https://sourceware.org/glibc/ (дата обращения 08.11.2025).
7. musl libc. https://musl.libc.org/ (дата обращения 08.11.2025).
Review
For citations:
Asonov A.A., Samborskiy S.V. Static Infrastructure for Building a Cross Compiler. SRISA Proceedings. 2025;15(3):60-64. (In Russ.) https://doi.org/10.25682/NIISI.2025.3.0008