Revision 2 of 2026-11-25 20:31 UTC by tux, the current one. Current version - History
Toolchain
5.1
The toolchain is the set of packages that builds every other package: the assembler and linker (Binutils), the compiler (GCC), the Linux API headers and the C library (Glibc). All packages of a release are built with the same toolchain, and a new toolchain means cooking the whole wok again: that is why it changes only between releases, and any change is discussed on the forum first. This page tells what SliTaz 5.1 uses and how the toolchain is built; cooking a package is in Receipt.
The 5.1 toolchain
The same versions on i486 and x86_64:
binutils2.37;gcc6.3.0, withgcc-lib-base(libgcc_s, libstdc++) for the programs it builds;glibc-baseandglibc-dev2.20;linux-api-headers: 3.16.55 on i486, 6.12.115 on x86_64.
slitaz-toolchain is a meta package that installs them all, with
make and elfkickers. As root:
# spk-add slitaz-toolchain
Check what you run, as a user:
$ gcc --version
gcc (SliTaz64) 6.3.0
$ ld --version
GNU ld (GNU Binutils) 2.37
$ /lib/libc.so.6
GNU C Library (GNU libc) stable release version 2.20, ...
On i486 GCC says (SliTaz) instead of (SliTaz64). The target name
is i486-slitaz-linux or x86_64-slitaz-linux (gcc -dumpmachine).
The compiler flags of each architecture are in
/etc/slitaz/cook.conf: -march=i486 or -march=x86-64, both with
-Os to keep the binaries small.
GCC 8.3 next to GCC 6.3
GCC 6.3 is old: recent C++ code (C++17) or recent kernels need more.
The gcc83 package installs GCC 8.3.0 next to it, without replacing
anything: its commands end with -83.
# spk-add gcc83
$ gcc-83 --version
gcc-83 (SliTaz) 8.3.0
gcc and g++ stay GCC 6.3; gcc-83, g++-83 and cpp-83 call
GCC 8.3, whose own files live in /usr/libgcc83. In a receipt, ask
for it explicitly:
BUILD_DEPENDS="gcc83 ..."
compile_rules()
{
./configure CC=gcc-83 CXX=g++-83 $CONFIGURE_ARGS &&
make &&
make DESTDIR=$DESTDIR install
}
A C++ program built with g++-83 needs the newer libstdc++ of
gcc83-lib-base at run time: add it to DEPENDS. More than a hundred
receipts of the wok do so, and the 5.1 kernel (linux-lts) is built
with gcc-83 too (see Kernel).
The wok holds older compilers as well, such as gcc49 (GCC 4.9, i486
only) for a few old programs. Use them only when a receipt really needs
them.
How the toolchain is built
SliTaz builds its toolchain on SliTaz, from the packages of the wok: each architecture is cooked natively, in its own chroot on the build host, not with a cross compiler. The order matters, because each piece is built with the previous ones:
- Binutils, a first time;
- GCC, a first pass (C and C++ only), with the new Binutils;
- the Linux API headers;
- Glibc, built with the new GCC against the headers;
- Binutils again, then GCC again, now linked with the new Glibc.
The slitaz-toolchain receipt holds this order in its
compile_rules, and its comments explain it: cooking it runs the
whole chain. Once it is done, the developers usually cook it a second
time, to check that the new toolchain can rebuild itself.
# cook slitaz-toolchain
Never do this on the system you work on: it replaces the compiler and the C library under your feet. Use a clean chroot of the same architecture (see Building in a chroot), and count hours, not minutes.
The cross tool of cookutils builds cross toolchains, mainly for ARM.
Its x86_64 configuration is from the early days of the 64-bit port and
is no longer used: see its notes in the
Cookutils manual.
Links
- Cookutils manual
- The cooking wok: the receipts of
slitaz-toolchain,gcc,gcc83,glibcandbinutils. - Linux From Scratch: the reference on building a toolchain step by step.