MultiarchCrossCompilers
Debian Cross Toolchains
The emdebian project provides precompiled binaries for several architectures, but it is not currently possible to build and distribute these tools within Debian itself. Building these packages in the archive, with autobuilders, requires either full 'bootstrap builds' or cross-architecture build dependencies to be specifiable.
Multiarch enabled apt with cross-architecture dependencies and build-dependencies is now in Debian, and thus enables toolchain builds to use multiarch libraries to build. Packages to do this have been produced by Thibaut Girka as a GSOC project, and are currently available for i386 and amd64 at http://emdebian.org/~thibg/repo/
Arch Qualification vs Toolchain Builds
Cross compiler generation can be automated without using multiarch, by utilizing the "binutils-source", "gcc-source", "glibc-source"/"uclibc-source", "kernel-source" and "gdb-source" binary packages together with a framework package containing build scripts and several small helper packages that can be fed to autobuilders.
This is the actual process using the various source trees:
Step |
Source |
Prerequisite |
Action |
0 |
linux |
none |
build linux-libc-dev headers |
1 |
binutils |
none |
build binutils |
2 |
gcc |
none |
build "freestanding" gcc |
3 |
gcc |
1,2 |
build static libgcc |
4 |
libc |
0,1,2,3 |
build intermediate libc, statically linked against libgcc |
5 |
gcc |
1,2,4 |
build shared libgcc, linked against intermediate shared libc |
6 |
libc |
0,1,2,5 |
build final libc |
7 |
gcc |
1,2,5,6 |
build final "hosted" gcc |
8 |
gcc |
1,5,6,7 |
build language support libraries |
This method allows cross-toolchains to be auto-built without cross-architecture dependencies, at the expense of rebuilding a lot of stuff that is already built in the archive (linux-libc-dev:<host>, libgcc:<host> (and libgomp, mudflap etc), libc:<host>, libc-dev:<host>). This method is used by the src:gcc-cross and src:cross-toolchain-base packages used to make cross-compilers in Ubuntu.
The equivalent process for a multiarch-using toolchain build is:
Step |
Source |
Prerequisite |
Action |
0 |
binutils |
none |
build binutils |
1 |
gcc |
1,2,5,6 |
build final "hosted" gcc |
(because the other components already exist in the archive for other arches)