MultiarchCrossCompilers

Differences between revisions 1 and 2
Revision 1 as of 2012-07-19 00:20:49
Size: 2408
Editor: cpc5-cmbg4-0-0-cust802
Comment: new page, taking out some extranaeous material from the MultiarchCross page
Revision 2 as of 2013-04-18 12:25:50
Size: 3291
Editor: doko
Comment: update cross toolchains in Ubuntu
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Cross Toolchains in Ubuntu =

Cross toolchains in Ubuntu are available under the package name gcc-<multiarch tuple>, e.g. gcc-powerpc-linux-gnu. Starting with Ubuntu 13.04, the cross compilers are available on amd64 and i386 for the target architectures aarch64, armel, armhf and powerpc, including the multilib builds available for the native toolchains. See the ToolChain wiki page for newer versions of toolchain packages.

The cross toolchains are standalone toolchains which can be used without a "guest" (or target) architecture installed in the same environment. The use of the toolchains provided by the emdebian project (as described below) is constrained to the default multilib variant of a toolchain and the need for a "guest" multiarch architecture, making it impossible to provide a toolchain for a new architecture which is not yet available in the archive.

Cross Toolchains in Ubuntu

Cross toolchains in Ubuntu are available under the package name gcc-<multiarch tuple>, e.g. gcc-powerpc-linux-gnu. Starting with Ubuntu 13.04, the cross compilers are available on amd64 and i386 for the target architectures aarch64, armel, armhf and powerpc, including the multilib builds available for the native toolchains. See the ToolChain wiki page for newer versions of toolchain packages.

The cross toolchains are standalone toolchains which can be used without a "guest" (or target) architecture installed in the same environment. The use of the toolchains provided by the emdebian project (as described below) is constrained to the default multilib variant of a toolchain and the need for a "guest" multiarch architecture, making it impossible to provide a toolchain for a new architecture which is not yet available in the archive.

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)

MultiarchCrossCompilers (last edited 2013-04-18 12:25:50 by doko)