NSLU2-Linux
view · edit · print · history

DebianSlug.CrossCompiling History

Hide minor edits - Show changes to markup

September 26, 2008, at 10:00 PM by Ropetin -- Updated .deb download location
Changed lines 51-52 from:

It's probably easiest to wget them from http://ftp.armeb.net/debian-sarge/pool/main/ <<--this is broken. These files will have names ending _armeb.deb, indicating that they are for the armeb architecture. If you try to install them on your PC you'll get an error message.

to:

It's probably easiest to wget them from http://armeb.debian.net/debian-armeb/debian/sarge/pool/main/ . These files will have names ending _armeb.deb, indicating that they are for the armeb architecture. If you try to install them on your PC you'll get an error message.

June 16, 2008, at 11:57 PM by SyNko -- broken links
Changed lines 11-12 from:

described in the rest of this page be found at http://ftp.armeb.net/other/sarge.cross-toolchain/.

to:

described in the rest of this page be found at http://ftp.armeb.net/other/sarge.cross-toolchain/. <<--this is broken

Changed lines 51-52 from:

It's probably easiest to wget them from http://ftp.armeb.net/debian-sarge/pool/main/. These files will have names ending _armeb.deb, indicating that they are for the armeb architecture. If you try to install them on your PC you'll get an error message.

to:

It's probably easiest to wget them from http://ftp.armeb.net/debian-sarge/pool/main/ <<--this is broken. These files will have names ending _armeb.deb, indicating that they are for the armeb architecture. If you try to install them on your PC you'll get an error message.

August 28, 2006, at 10:51 PM by Phil Endecott -- Further clarify gcc-3.3 patching
Changed lines 107-108 from:

At this point, at the time of writing you need to apply a patch to make gcc-3.3 compatible with dpkg-cross. This patch may be included in a future version; check the changelog. Equivalent patches have already been included in gcc-3.4, 4.0 and 4.1. Get the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=357629, saving it as 357629.patch. Then:

to:

At this point, at the time of writing you need to apply a patch to make gcc-3.3 compatible with dpkg-cross. This patch may be included in a future version; check the changelog. Equivalent patches have already been included in gcc-3.4, 4.0 and 4.1. Get the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=357629, saving it as 357629.patch.

Unfortunately this patch isn't quite right, at the time of writing (Aug 28 2006). You need to replace references to GCC_SO with CXX_SO in places where libstdc++ is mentioned.

Then:

August 28, 2006, at 08:10 PM by Phil Endecott -- Mention gcc-3.3 patch for compatibility with dpkg-cross
Changed lines 19-21 from:
to:

(Note: I don't think that these packages include the gcc-3.3 patch mentioned below, so they won't work with the current version of dpkg-cross.)

Changed lines 41-44 from:

(dpkg-cross 1.28 and dpkg-dev 1.13.22 certainly know about big-endian ARM; apparently dpkg-cross 1.26 does too. If you have older versions, consider upgrading.)

Note: at some point, dpkg-cross changed its naming convention slightly and packages produced with the old version are incompatible with the new version. Furthermore they can be incompatible with the compilers that you will build in the next steps. If you want to use gcc-3.3 you must get an old version of dpkg-cross, which unfortunately won't contain the armeb mods (see the history of this page for how to hack it). If you want to use gcc-3.4 or newer it will work with the new dpkg-cross, as long as the compiler is new enough; but will the resulting executables run on your NSLU2? Check the packages' Debian changelogs for details - search for dcv1.

to:

(You need a version of dpkg-cross >= 1.26 for big-endian ARM support.)

Changed lines 99-100 from:

The Debian gcc package has support for building cross-compilers built in, now including the necessary patches for big-endian ARM, even in the gcc-3.3 packages (but see the note above about compatibility between gcc-3.3 and the newest dpkg-cross).

to:

The Debian gcc package has support for building cross-compilers built in, now including the necessary patches for big-endian ARM, even in the gcc-3.3 packages. If you're targetting a stable OpenDebianSlug NSLU2 you'll want gcc-3.3; if your target is more up-to-date you can use a newer version of gcc. This page assumes gcc-3.3.

Changed lines 103-104 from:

(As with binutils, root will install the build deps)

to:

(As with binutils, doing this as root will install the build deps.)

Added lines 107-110:

At this point, at the time of writing you need to apply a patch to make gcc-3.3 compatible with dpkg-cross. This patch may be included in a future version; check the changelog. Equivalent patches have already been included in gcc-3.4, 4.0 and 4.1. Get the patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=357629, saving it as 357629.patch. Then:

$ patch -p1 < 357629.patch

Added lines 113-114:

Now you can compile:

Changed lines 121-124 from:

Note that the resulting .debs depend on gcc-base, which is shared with your native compiler, and must be the same version. If you have a newer gcc-3.3 than the one in stable you'll need to downgrade it with something like:

# apt-get install gcc-3.3/stable

to:

Note that the resulting .debs depend on gcc-3.3-base, which is shared with your native compiler, and must be the same version. You may need to install or upgrade it.

Changed line 132 from:

$ armeb-linux-gcc -o hw hello.c\\

to:

$ armeb-linux-gnu-gcc -o hw hello.c\\

August 25, 2006, at 10:16 PM by Phil Endecott -- Note incompatibility between gcc-3.3 and newest dpkg-cross
Added line 7:
Changed lines 19-22 from:

Note: I think these files may need updating to reflect Debian's change from a '-cross' suffix to '-dcv1'. Does anyone understand this?

to:
Added lines 41-42:

Note: at some point, dpkg-cross changed its naming convention slightly and packages produced with the old version are incompatible with the new version. Furthermore they can be incompatible with the compilers that you will build in the next steps. If you want to use gcc-3.3 you must get an old version of dpkg-cross, which unfortunately won't contain the armeb mods (see the history of this page for how to hack it). If you want to use gcc-3.4 or newer it will work with the new dpkg-cross, as long as the compiler is new enough; but will the resulting executables run on your NSLU2? Check the packages' Debian changelogs for details - search for dcv1.

Changed lines 99-100 from:

The Debian gcc package has support for building cross-compilers built in, now including the necessary patches for big-endian ARM, even in the gcc-3.3 packages.

to:

The Debian gcc package has support for building cross-compilers built in, now including the necessary patches for big-endian ARM, even in the gcc-3.3 packages (but see the note above about compatibility between gcc-3.3 and the newest dpkg-cross).

July 06, 2006, at 10:10 PM by Phil Endecott -- Bring up to date based on my recent experiences
Deleted lines 0-1:

Note: prebuilt cross-compiler packages resulting from the steps in this page can be found at http://ftp.armeb.net/cross-toolchain/sarge//

Changed lines 3-4 from:

This page describes how I have set up a cross-compilation enironment for OpenDebianSlug on my Debian Sarge PC.

to:

This page describes two ways to set up a cross-compilation environment for OpenDebianSlug on a Debian PC. You can either install binary packages, or do it yourself.

Installing from binary packages

Pre-built cross-compiler packages resulting from the steps described in the rest of this page be found at http://ftp.armeb.net/other/sarge.cross-toolchain/.

In that directory you'll find a set of .deb files. You'll also find a .tar.gz file containing all of the compiler and library files. This is not a .deb file so the Debian package system won't know anything about it, and it may be possible to use it on other systems.

Note: I think these files may need updating to reflect Debian's change from a '-cross' suffix to '-dcv1'. Does anyone understand this?

Doing It Yourself

Changed lines 29-30 from:

Things are made a bit more complicated by the fact big-endian ARM is not a supported Debian architecture; you need to hack things a bit. But it does seem to work.

to:

These steps are described in the rest of this page.

Things are easier now that big-endian ARM has some Debian support; if you're using an old Debian system you may need to hack things a bit. Look at the history of this page for the now-deleted details.

Changed lines 37-54 from:

You cannot just install the OpenDebianSlug .debs on your PC for two reasons. First, the Debian installation tools will refuse to install them because they are for the wrong architecture. Second, you don't want to replace your native PC libraries with ARM code; these libraries must be installed in a special location. Both of these issues can be fixed by using the dpkg-cross tool to convert the .debs. So install dpkg-cross, if you don't already have it:

# apt-get install dpkg-cross

At this point you need to hack a couple of files to add big-endian support. They are:

  • /usr/share/perl5/dpkg-cross.pl
  • /usr/bin/dpkg-architecture

In each case, just find each place that 'arm' is mentioned and add 'armeb' as well. The changes are obvious.

Comment: I had to edit /usr/share/dpkg/{archtable,cputable} instead of dpkg-architecture. Has this changed from sarge to etch?
Comment: Recent dpkg-cross (1.26) seem to have the necessary changes already.
Comment: Sorry, but could someone post an example. It's not too obvious to me what the changes should be.

You should also review /etc/dpkg-cross/cross-compile, though its default settings should be fine. Your armeb-specific files will be installed under /usr/armeb-linux/.

to:

You cannot just install the OpenDebianSlug .debs on your PC for two reasons. First, the Debian installation tools will refuse to install them because they are for the wrong architecture. Second, you don't want to replace your native PC libraries with ARM code; these libraries must be installed in a special location. Both of these issues can be fixed by using the dpkg-cross tool to convert the .debs. So install dpkg-cross, if you don't already have it. You probably also need fakeroot:

# apt-get install dpkg-cross fakeroot

(dpkg-cross 1.28 and dpkg-dev 1.13.22 certainly know about big-endian ARM; apparently dpkg-cross 1.26 does too. If you have older versions, consider upgrading.)

You should review /etc/dpkg-cross/cross-compile, though its default settings are fine. Your armeb-specific files will be installed under /usr/armeb-linux-gnu/.

Changed lines 64-65 from:

You can add support for building cross-compilation packages to the Debian binutils source package by installing a patch from the Debian bug-tracking system. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=231707. The procedure is as follows:

to:

Version 2.17 of binutils should build without patching. For older versions, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=231707 and the history of this page.

The build procedure is as follows:

Changed lines 70-71 from:

wget the patch from the Debian bug-tracker (check the binutils version numbers, and get the newest appropriate version). Apply the patch:

to:

(You should be able to run apt-src is a normal user, but running as root means that it will be able to install the native tools necessary for building binutils automatically. You'll then need to chown it all so that you can build as a normal user.)

Changed lines 76-79 from:

$ patch -p1 < ../binutils-cross.patch

Hack debian/rules to add armeb, as before. It should be obvious what to do.

to:
Changed lines 81-82 from:

$ TARGET=armeb-linux fakeroot debian/rules binary-cross

to:

$ TARGET=armeb-linux-gnu fakeroot debian/rules binary-cross

(Note that it's now armeb-linux-gnu, not just armeb-linux.)

Changed lines 88-90 from:

# dpkg -i binutils-armeb-linux-2.15.deb

to:

# dpkg -i binutils-armeb-linux-gnu-2.*.deb

Changed lines 99-100 from:

The Debian gcc package has support for building cross-compilers built in. But the patches for big-endian ARM are more complicated; you need the patch from http://ftp.debonaras.org/sarge/patches/gcc-3.3.5-armeb.diff.

to:

The Debian gcc package has support for building cross-compilers built in, now including the necessary patches for big-endian ARM, even in the gcc-3.3 packages.

Changed lines 102-104 from:

$ cd gcc-3.3-3.3.5
$ patch -p1 < ../gcc-3.3.5-armeb.diff

to:

(As with binutils, root will install the build deps)

$ cd gcc-3.3-3.3.*

Deleted lines 108-111:

$ ./debian/rules patch

(There is some sort of circular dependency around here I think, so you have to apply the patches before you set the target)

March 24, 2006, at 08:40 PM by dyoung --
Changed lines 1-2 from:

Note: prebuilt cross-compiler packages resulting from the steps in this page can be found at http://ftp.debonaras.org/sarge/cross-toolchain/

to:

Note: prebuilt cross-compiler packages resulting from the steps in this page can be found at http://ftp.armeb.net/cross-toolchain/sarge//

Changed lines 42-43 from:

It's probably easiest to wget them from http://ftp.debonaras.org/sarge/debian/pool/main/. These files will have names ending _armeb.deb, indicating that they are for the armeb architecture. If you try to install them on your PC you'll get an error message.

to:

It's probably easiest to wget them from http://ftp.armeb.net/debian-sarge/pool/main/. These files will have names ending _armeb.deb, indicating that they are for the armeb architecture. If you try to install them on your PC you'll get an error message.

December 29, 2005, at 04:37 PM by martin w -- comment adden
Added lines 32-33:
Comment: Sorry, but could someone post an example. It's not too obvious to me what the changes should be.
December 27, 2005, at 08:45 AM by marcusb --
Changed lines 30-31 from:
''Comment: Recent dpkg-cross (1.26) seem to have the necessary changes already.
to:
Comment: Recent dpkg-cross (1.26) seem to have the necessary changes already.
December 27, 2005, at 08:44 AM by marcusb -- dpkg-cross update
Added lines 30-31:
''Comment: Recent dpkg-cross (1.26) seem to have the necessary changes already.
November 13, 2005, at 11:10 AM by hs -- * instead of version number
Changed line 57 from:

$ cd binutils-2.15\\

to:

$ cd binutils-*\\

November 13, 2005, at 07:00 AM by hs -- +Comment on dpkg-architecture
Added lines 28-29:
Comment: I had to edit /usr/share/dpkg/{archtable,cputable} instead of dpkg-architecture. Has this changed from sarge to etch?
November 13, 2005, at 06:40 AM by hs -- Comment on gawk releases
Changed lines 78-79 from:

It should do nothing. If you see an error message you need to upgrade from 1:3.1.4-2 to 1:3.1.4-2.0.1.

to:

It should do nothing. If you see an error message you need to upgrade from 1:3.1.4-2 (=sarge) to 1:3.1.4-2.0.1 (>=etch).

October 16, 2005, at 03:15 AM by rwhitby --
Changed lines 1-2 from:

Note: prebuilt cross-compiler packages resulting from the steps in this page can be found at http://ftp.debonaras.org/sarge/cross-toolchain/

to:

Note: prebuilt cross-compiler packages resulting from the steps in this page can be found at http://ftp.debonaras.org/sarge/cross-toolchain/

October 16, 2005, at 03:14 AM by rwhitby --
Changed lines 1-2 from:

Note: prebuilt cross-compiler packages resulting from the steps in this page can be found at http://ftp.debonaras.org/sarge/cross-toolchain/

to:

Note: prebuilt cross-compiler packages resulting from the steps in this page can be found at http://ftp.debonaras.org/sarge/cross-toolchain/

September 27, 2005, at 01:46 AM by buytenh -- Adjust for new ftp.debonaras.org layout.
Changed lines 1-2 from:

Note: prebuilt cross-compiler packages resulting from the steps in this page can be found at http://ftp.debonaras.org/cross/

to:

Note: prebuilt cross-compiler packages resulting from the steps in this page can be found at http://ftp.debonaras.org/sarge/cross-toolchain/

Changed lines 36-37 from:

It's probably easiest to wget them from http://packages.debonaras.org/debian/pool/main/. These files will have names ending _armeb.deb, indicating that they are for the armeb architecture. If you try to install them on your PC you'll get an error message.

to:

It's probably easiest to wget them from http://ftp.debonaras.org/sarge/debian/pool/main/. These files will have names ending _armeb.deb, indicating that they are for the armeb architecture. If you try to install them on your PC you'll get an error message.

Changed lines 80-81 from:

The Debian gcc package has support for building cross-compilers built in. But the patches for big-endian ARM are more complicated; you need the patch from http://debian.nslu2-linux.org/patches/gcc-3.3.5-armeb.diff.

to:

The Debian gcc package has support for building cross-compilers built in. But the patches for big-endian ARM are more complicated; you need the patch from http://ftp.debonaras.org/sarge/patches/gcc-3.3.5-armeb.diff.

September 21, 2005, at 01:57 PM by buytenh -- Add link to prebuilt packages.
Added lines 1-2:

Note: prebuilt cross-compiler packages resulting from the steps in this page can be found at http://ftp.debonaras.org/cross/

September 21, 2005, at 02:03 AM by dyoung -- change patch name
Changed lines 78-79 from:

The Debian gcc package has support for building cross-compilers built in. But the patches for big-endian ARM are more complicated; you need the patch from http://debian.nslu2-linux.org/patches/gcc-3.3.5-sukurys.diff.

to:

The Debian gcc package has support for building cross-compilers built in. But the patches for big-endian ARM are more complicated; you need the patch from http://debian.nslu2-linux.org/patches/gcc-3.3.5-armeb.diff.

Changed lines 82-83 from:

$ patch -p1 < ../gcc-3.3.5-sukurys.diff

to:

$ patch -p1 < ../gcc-3.3.5-armeb.diff

September 15, 2005, at 08:27 PM by Leak -- Revert erroneous changes due to differences between Debian Stable and Unstable
Changed lines 3-4 from:

This page describes how I have set up a cross-compilation enironment for OpenDebianSlug on my Debian PC.

to:

This page describes how I have set up a cross-compilation enironment for OpenDebianSlug on my Debian Sarge PC.

Changed lines 16-17 from:

You cannot just install the OpenDebianSlug .debs on your PC for two reasons. First, the Debain installation tools will refuse to install them because they are for the wrong architecture. Second, you don't want to replace your native PC libraries with ARM code; these libraries must be installed in a special location. Both of these issues can be fixed by using the dpkg-cross tool to convert the .debs. So install dpkg-cross, if you don't already have it:

to:

You cannot just install the OpenDebianSlug .debs on your PC for two reasons. First, the Debian installation tools will refuse to install them because they are for the wrong architecture. Second, you don't want to replace your native PC libraries with ARM code; these libraries must be installed in a special location. Both of these issues can be fixed by using the dpkg-cross tool to convert the .debs. So install dpkg-cross, if you don't already have it:

Changed lines 22-24 from:
  • /usr/share/dpkg/cputable
  • /usr/share/dpkg/archtable
to:
  • /usr/bin/dpkg-architecture
September 15, 2005, at 05:11 PM by Leak -- Add paths in debian repository for .debs to download
Changed lines 30-34 from:
  • libc6
  • libc6-dev
  • libdb1-compat
  • linux-kernel-headers
to:
  • libc6 (in /debian/pool/main/g/glibc/)
  • libc6-dev (in /debian/pool/main/g/glibc/)
  • libdb1-compat (in /debian/pool/main/d/db1-compat/)
  • linux-kernel-headers (in /debian/pool/main/l/linux-kernel-headers/)
September 15, 2005, at 04:57 PM by Leak -- Add archtable
Changed lines 23-24 from:
to:
  • /usr/share/dpkg/archtable
September 15, 2005, at 04:55 PM by Leak -- Need to edit the cputable file that dpkg-architecture uses instead
Changed lines 22-23 from:
  • /usr/bin/dpkg-architecture
to:
  • /usr/share/dpkg/cputable
September 12, 2005, at 08:41 PM by Phil Endecott -- Tweak formatting
Changed line 53 from:

$ cd binutils-2.15

to:

$ cd binutils-2.15\\

Changed line 66 from:

$ cd ..

to:

$ cd ..\\

Changed lines 80-81 from:

$ apt-src install gcc-3.3 $ cd gcc-3.3-3.3.5

to:

$ apt-src install gcc-3.3
$ cd gcc-3.3-3.3.5\\

Changed lines 90-91 from:

$ export GCC_TARGET=armeb $ ./debian/rules control

to:

$ export GCC_TARGET=armeb
$ ./debian/rules control\\

Changed lines 109-111 from:

$ armeb-linux-gcc -o hw hello.c $ file hw hw: ELF 32-bit MSB executable, ARM, version 1 (ARM),

to:

$ armeb-linux-gcc -o hw hello.c
$ file hw
hw: ELF 32-bit MSB executable, ARM, version 1 (ARM),\\

September 12, 2005, at 08:32 PM by Phil Endecott -- Tweak formatting
Changed lines 1-4 from:

Cross-Compiling from Debian on a PC to OpenDebianSlug

This page describes how I have set up a cross-compilation enironment for OpenDebianSlug on my Debaian PC.

to:

Cross-Compiling from Debian on a PC to OpenDebianSlug

This page describes how I have set up a cross-compilation enironment for OpenDebianSlug on my Debian PC.

Changed lines 12-13 from:

Installing the OpenDebianSlug libraries

to:

Installing the OpenDebianSlug libraries

Changed lines 45-46 from:

Building binutils

to:

Building binutils

Changed lines 70-71 from:

Building gcc

to:

Building gcc

Changed lines 105-106 from:

Testing

to:

Testing

Changed lines 111-112 from:

hw: ELF 32-bit MSB executable, ARM, version 1 (ARM), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped

to:

hw: ELF 32-bit MSB executable, ARM, version 1 (ARM), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped

September 12, 2005, at 08:30 PM by Phil Endecott -- Created OpenDebianSlug cross-compilation instructions
Added lines 1-114:

Cross-Compiling from Debian on a PC to OpenDebianSlug

This page describes how I have set up a cross-compilation enironment for OpenDebianSlug on my Debaian PC.

There are three main steps:

  • Install the OpenDebianSlug libraries on the PC.
  • Build binutils (assembler, linker etc).
  • Build compilers (gcc and g++).

Things are made a bit more complicated by the fact big-endian ARM is not a supported Debian architecture; you need to hack things a bit. But it does seem to work.

Installing the OpenDebianSlug libraries

You need the OpenDebianSlug libraries and include files on the PC so that your programs can be linked with them. You need to install a few basic libraries before starting work on binutils and gcc because they make use of them during installation. You can add other libraries, as needed by your programs, later in the same way.

You cannot just install the OpenDebianSlug .debs on your PC for two reasons. First, the Debain installation tools will refuse to install them because they are for the wrong architecture. Second, you don't want to replace your native PC libraries with ARM code; these libraries must be installed in a special location. Both of these issues can be fixed by using the dpkg-cross tool to convert the .debs. So install dpkg-cross, if you don't already have it:

# apt-get install dpkg-cross

At this point you need to hack a couple of files to add big-endian support. They are:

  • /usr/share/perl5/dpkg-cross.pl
  • /usr/bin/dpkg-architecture

In each case, just find each place that 'arm' is mentioned and add 'armeb' as well. The changes are obvious.

You should also review /etc/dpkg-cross/cross-compile, though its default settings should be fine. Your armeb-specific files will be installed under /usr/armeb-linux/.

Now get the OpenDebianSlug .debs for at least the following libraries:

  • libc6
  • libc6-dev
  • libdb1-compat
  • linux-kernel-headers

It's probably easiest to wget them from http://packages.debonaras.org/debian/pool/main/. These files will have names ending _armeb.deb, indicating that they are for the armeb architecture. If you try to install them on your PC you'll get an error message.

Convert them using dpkg-cross as follows:

$ dpkg-cross -b -a armeb *_armeb.deb

This will generate a new .deb for each package. The new filename will end _all.deb indicating that it can be installed on any machine, and will contain armeb-cross within the name indicating that it is for armeb cross-compilation. You can now install these files:

# dpkg -i *_all.deb

Building binutils

You can add support for building cross-compilation packages to the Debian binutils source package by installing a patch from the Debian bug-tracking system. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=231707. The procedure is as follows:

$ apt-src install binutils

wget the patch from the Debian bug-tracker (check the binutils version numbers, and get the newest appropriate version). Apply the patch:

$ cd binutils-2.15 $ patch -p1 < ../binutils-cross.patch

Hack debian/rules to add armeb, as before. It should be obvious what to do.

You might want to review debian/README.cross at this pont.

Now build the tools:

$ TARGET=armeb-linux fakeroot debian/rules binary-cross

This will create a .deb, which you need to install:

$ cd .. # dpkg -i binutils-armeb-linux-2.15.deb

Building gcc

Before you start working on gcc, check that you don't have a buggy version of awk. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=303263. Try this:

$ fakeroot awk '' </dev/null

It should do nothing. If you see an error message you need to upgrade from 1:3.1.4-2 to 1:3.1.4-2.0.1.

The Debian gcc package has support for building cross-compilers built in. But the patches for big-endian ARM are more complicated; you need the patch from http://debian.nslu2-linux.org/patches/gcc-3.3.5-sukurys.diff.

$ apt-src install gcc-3.3 $ cd gcc-3.3-3.3.5 $ patch -p1 < ../gcc-3.3.5-sukurys.diff

You might like to review debian/README.cross at this point.

$ ./debian/rules patch

(There is some sort of circular dependency around here I think, so you have to apply the patches before you set the target)

$ export GCC_TARGET=armeb $ ./debian/rules control $ dpkg-buildpackage -rfakeroot

This will create several .debs including gcc and g++ and their run-time libraries.

Note that the resulting .debs depend on gcc-base, which is shared with your native compiler, and must be the same version. If you have a newer gcc-3.3 than the one in stable you'll need to downgrade it with something like:

# apt-get install gcc-3.3/stable

You can now install your new cross-compiler:

# dpkg -i *.deb

Testing

You can test the tools as follows:

$ armeb-linux-gcc -o hw hello.c $ file hw hw: ELF 32-bit MSB executable, ARM, version 1 (ARM), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped

Copy the executable to your slug and see if it works!

view · edit · print · history · Last edited by Ropetin.
Based on work by SyNko, Phil Endecott, dyoung, martin w, marcusb, hs, rwhitby, buytenh, and Leak.
Originally by Phil Endecott.
Page last modified on September 26, 2008, at 10:00 PM