Differences between revisions 45 and 46
Revision 45 as of 2014-11-27 03:58:51
Size: 1974
Editor: wookey
Comment:
Revision 46 as of 2015-01-04 14:33:31
Size: 2236
Editor: wookey
Comment:
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
== I really do want to build a Cross Compiler == == I really do want to build a cross compiler ==
Line 13: Line 13:
Pick the most relevant heading from the list below Pick the most relevant heading from the list below.
Line 15: Line 15:
=== I want a combination of BUILD x HOST not in Debian === === I want a combination of BUILD x HOST not in Debian on unstable ===
Line 18: Line 18:
 * Check out the cross-gcc git repo
 * generate a cross-gcc-<ver>-<arch> source package
 * Install the cross-gcc-dev binary package
 * Generate a cross-gcc-<ver>-<arch> source package
Line 22: Line 22:
git clone http://anonscm.debian.org/cgit/crosstoolchain/cross-gcc.git
TARGET_LIST=hostarch cross-gcc/gensources
TARGET_LIST=hostarch cross-gcc/buildall
apt-get install cross-gcc-dev
TARGET_LIST=<hostarch> gensource
Line 26: Line 26:
Fill in your own hostarch above. You will need sbuild 0.64.3 or later installed, and a suitable chroot or build env for the target suite.
Fill in your own <hostarch> above. You will need sbuild 0.64.3 or later installed, and a suitable chroot or build env for the target suite.
Line 30: Line 31:
cd packages/cross-gcc-4.9-hostarch
dpkg --add-architecture hostarch
cd packages/cross-gcc-4.9-<hostarch>
dpkg --add-architecture <hostarch>
Line 43: Line 44:
Linaro's cross-toolchains (tarball install, sadly) are very up to date with patches and support, and may well be useful. Linaro's cross-toolchains (tarball install, sadly) are very up to date with patches and support, and may well be useful. But they are supplied as a binary tarball, not as debian packages.

=== I want toolchain packages for wheezy ===

The packages on emdebian.org aimed at wheezy have been uninstallable for a long time.
Install buildcross from experimental and use that to build your own.

<some instructions here would be helpful>

Crosstoolchain documentation is now collected on CrossToolchains

Building a Cross Compiler

Very few people need to build a cross-toolchain. It is a complicated business and unless you are doing something really quite obscure you should just install a suitable apt-able toolchain.

We'll say that again: MOST PEOPLE SHOULDN'T BE BUILDING THEIR OWN CROSS-TOOLCHAIN - THEY SHOULD JUST INSTALL A PRE-BUILT ONE LIKE ANY OTHER PACKAGE.

But there are reasons why you might need to do this.

I really do want to build a cross compiler

Pick the most relevant heading from the list below.

I want a combination of BUILD x HOST not in Debian on unstable

If HOST is a debian release architecture then this is fairly straightforward:

  • Install the cross-gcc-dev binary package
  • Generate a cross-gcc-<ver>-<arch> source package

  • Build it

apt-get install cross-gcc-dev
TARGET_LIST=<hostarch> gensource

Fill in your own <hostarch> above. You will need sbuild 0.64.3 or later installed, and a suitable chroot or build env for the target suite.

A more manual build, probably best done in a chroot, could be

cd packages/cross-gcc-4.9-<hostarch>
dpkg --add-architecture <hostarch>
apt-get update
<install build-deps>
dpkg-buildpackage

(This essentially automates the procedure described on MultiarchCrossToolchainBuild).

If HOST is not a debian release architecture (debian-ports architecture or a new arch), then it may be much harder because you need to do a full bootstrap. cross-toolchain-base packages exist in Ubuntu for this for some architectures, but the procedure is broken in Debian at the time of writing (Nov 2014) so you'll need to fiddle with patches.

I want the very latest arm support

Linaro's cross-toolchains (tarball install, sadly) are very up to date with patches and support, and may well be useful. But they are supplied as a binary tarball, not as debian packages.

I want toolchain packages for wheezy

The packages on emdebian.org aimed at wheezy have been uninstallable for a long time. Install buildcross from experimental and use that to build your own.

<some instructions here would be helpful>