Dovetail-Automata / docker-cross-builder

Cross-build Debian packages in Docker for `i386` and `armhf` using `gcc --sysroot`
2 stars 2 forks source link

Docker Cross-Builder

This builds a Docker image containing multistrap system root trees for Debian Jessie armhf and i386 architectures, with tools in the native system to cross-build Debian packages.

The container is meant to be built upon by other containers, adding build dependencies and sysroot tweaks.

These containers are suitable for use either interactively on a workstation or in automated build environments like Travis CI.

Right now, this build method is still under initial evaluation. Build results may have unpredicted results, and are only suited for testing in simulated development environments.

Using the builder

How it works

This Dockerfile bootstraps foreign-arch system roots (using multiarch) with needed host-architecture dependencies installed. It makes a few adjustments to links and package build tools, and installs the Emdebian armhf cross-compile tool chain. The commands above to cross-build packages instruct the compilers, linkers and build tools to look for architecture-specific headers, libraries and build configuration under the foreign-arch system root.

This method works around the rapidly progressing but still not yet complete Debian Multi-Arch: support, where packages not yet Multi-Arch:-aware may not have foreign-arch versions installed next to or instead of native-arch versions, and cross-build dependencies cannot be satisfied. Even once Multi-Arch: works to build against Debian mainline package streams, someday, this method also enables building against e.g. a Raspbian system root, where lagging package versions are sufficient to break Multi-Arch: package installation.