[armedslack] ARMedSlack running on Neo FreeRunner

Stuart Winter m-lists at biscuit.org.uk
Sat Jun 13 13:28:14 UTC 2009


Hi

> in fact I have a very little expericence in cross compilers, but I think
> it should not be very difficult to create and use a cross compiler or
> you can get a pre-build toolchain (the precompiled binaries). I have
> found some instructions here
> http://www.ailis.de/~k/archives/19-ARM-cross-compiling-howto.html to
> build your own cross-compiler and binutils.  [..]

You'd need to check whether the binaries the toolchain produces are for
old ABI or new abi.

Example:

On ARMedslack:

 readelf -h /bin/ls  | grep -i flag

  Flags:                             0x2, has entry point, GNU EABI

This means that it's using the Old ABI.

Taking an 'armel' (their definition for 'ARM eabi, Little endian') Debian
binary, for example, you'll see:

New ABI:
  Flags:                  0x4000002, has entry point, Version4 EABI


For the current ARMedslack release, you need to make sure that your
toolchain produces output for the oldabi.

I build ARMedslack by building natively, but using distcc to
distribute the compile jobs to a number of X86 machines running
a cross compiler, and a distccd.
I build the toolchain myself using the script here.  I haven't built
it for a while, but everything in here ought to work on Slackware 12.2
at least:
ftp://ftp.armedslack.org/armedslack/armedslack-devtools/x-toolchain

(you might need to wait for it to appear on the ftp site - the sync only
runs every few hours)

That toolchain build script builds just what it needs to work with
distcc, and puts it into /opt/arm on your x86.
You then start distccd on the x86 hosts by adding this line to
/etc/rc.d/rc.local

# Distcc:
PATH=/opt/arm/bin /usr/bin/distccd -j 50 --daemon --allow 0/0

The number of jobs is probably a bit high there - I actually don't have
a super computer in my front room ;-)

Then, on my ARMedslack installations, I have this script:

root at stokely:~# cat ~/armedslack/dbuild
#!/bin/bash

if [ -f .no-distcc ]; then
   echo "This source is not to be built with distcc (.no-distcc exists)"
   ./arm/build
 else
   if [ ! -d /tmp/DISTCC ]; then
      mkdir -p /tmp/DISTCC
      ( cd /tmp/DISTCC
        ln -vfs /usr/bin/distcc gcc
        ln -vfs /usr/bin/distcc cc
        ln -vfs /usr/bin/distcc g++
        ln -vfs /usr/bin/distcc c++
        ln -vfs /usr/bin/distcc arm-slackware-linux-c++
        ln -vfs /usr/bin/distcc arm-slackware-linux-g++
        ln -vfs /usr/bin/distcc arm-slackware-linux-gcc )
   fi

# With zippo:
#   export DISTCC_HOSTS="192.168.1.1/2 192.168.1.15/2 192.168.1.11/2
192.168.1.2 192.168.1.14"
#   export NUMJOBS="-j5"

# Without zippo:
#   export DISTCC_HOSTS="192.168.1.1/2 192.168.1.15/2 192.168.1.11/2
192.168.1.2"

# With turrican:
   export DISTCC_HOSTS="192.168.1.2/2 192.168.1.1/2 192.168.1.15/2
192.168.1.11/2"
   export NUMJOBS="-j8"

# Without turrican or zippo:
# Timeouts may happen with distcc when compiling huge things, but these
# timeouts aren't configureable so distcc will stop waiting and run
natively
# instead :-(
   export DISTCC_HOSTS="192.168.1.1/2 192.168.1.15/2 192.168.1.11/2"
   export NUMJOBS="-j4"

   export CC=distcc
   PATH=/tmp/DISTCC:$PATH ./arm/build $@
fi

root at stokely:~#

To build bash, for example:

cd armedslack-current/source/a/bash
~/armedslack/dbuild

And this script runs the 'arm/build' script inside 'source/a/bash',
setting up the environment to use distcc rather than a local
C compiler.  It's a bit hacky which is why I don't include these
scripts in the source tree, but it works.




More information about the ARMedslack mailing list