MultiarchCross

Revision 1 as of 2009-10-10 22:38:29

Clear message

Summary

Extensions to the MultiarchSpec necessary for automated cross compilation and toolchain builds.

Motivation

The emdebian project aims to provide precompiled binaries for several embedded architectures, for some of which it is not possible or sensible to compile natively. For these, we need to build cross compilers and subsequently compile individual packages using these.

Current Status

The binutils package can be told to build a cross variant by passing a special environment variable. As there are no dependencies on target packages, this works for any GNU triplet supported by upstream, and can be automated easily.

The gcc package has a mechanism in place that rewrites various files in debian/ so that a set of cross compiler packages is built. The rewritten control file then declares build dependencies on several packages whose names end in a dash, the target Debian triplet and "-cross". These must be generated with the "dpkg-cross" tool from target packages. Automated bootstrap of new architectures is not possible this way, as a C library package compiled for the target is necessary to start building the packaged compiler.

Individual packages can be cross-compiled by passing a "-a" option to dpkg-buildpackage, which presets the environment variables accordingly. The package is responsible for honoring these variables, which most of the time can be achieved by passing --build and --host parameters to the configure script. The package's build dependencies need to be split into host and target dependencies manually, which precludes automation. An extended control file syntax that uses a "Build-Depends-Tools" field to list build dependencies that should not be translated is used in emdebian, but this solution is generally not considered scalable.

(to be continued)