[Clfs-support] Building CLFS 1.1.0 for the ARM architecture.

code monkey lfscodemonkey at gmail.com
Sun Aug 14 06:20:03 PDT 2011


Hello,

    I've sometimes seen people here ask if CLFS main book can be built for
ARM.  I
recently started learning about ARM and decided to see if I
could get CLFS 1.1.0 to build for it.   I was able to get it running
and thought I would share that information here.

    By starting with the PPC 32bit CLFS 1.1.0 document as my base and making
the
following changes to it, I was able to get it built for ARM:

========================================================================
In chapter 3:

    Also download glibc-ports-2.7.tar.bz2.
    It is needed to build glibc for ARM.

    Skip downloading of any powerpc specific packages & patches.

=========================
Chapter 4:  No changes.

=========================
Section 5.3 I selected my CLFS_TARGET as follows:

    export CLFS_TARGET="arm-unknown-linux-gnueabi"

    (Other ARM targets might work be easier to get working with 1.1.0...)

=========================
Section 5.4:

        Use "ARCH=arm" instead of "ARCH=powerpc" in the commands.

=========================
Section 5.7 after the same change to rs6000/linux.h, add:

echo "
#undef STARTFILE_PREFIX_SPEC
#define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >>
gcc/config/arm/linux-eabi.h
echo "
#undef STARTFILE_PREFIX_SPEC
#define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >> gcc/config/arm/linux-elf.h

=========================
Section 5.8 do:

After unpacking glibc-2.7.tar.bz2, cd into the glib-2.7 directory and then
do 'tar xvfj ../glibc-ports-2.7.tar.bz2' and 'mv glib-ports-2.7 ports'

Do not do the following command in that section:

echo "libc_cv_ppc_machine=yes" >> config.cache

=========================
Section 5.9 after the same change to rs6000/linux.h, add:
echo "
#undef STARTFILE_PREFIX_SPEC
#define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >>
gcc/config/arm/linux-eabi.h
echo "
#undef STARTFILE_PREFIX_SPEC
#define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >> gcc/config/arm/linux-elf.h

=========================
No further changes until chapter 10 except skip the building of any of the
powerpc specific packages (yaboot & such...).

=========================
In chapter 10, during the native builds of the packages, it kept trying
to build 'arm-unknown-linux-gnu' instead of 'arm-unknown-linux-gnueabi'.
A variety of build failures occured until I figured out that it was doing
that.

I added the following line to specify the target I wanted:

--build=arm-unknown-linux-gnueabi --host=arm-unknown-linux-gnueabi \

to the configure command in Chapter 10 each of building of binutils,
glibc and gcc.   The Chapter 10 build then completed and the
resulting system booted and ran ok.   It worked but I'm not sure that is the

proper way to fix it.

And of course, in section 10.7, unpack and add in the
glibc-ports package during glibc build.

And of course,  skip the building any of the powerpc specific packages.

=====================================================================

Other notes:

The 'arm-unknown-linux-gnu' target might be easier to build (i.e.
might not need specifiying the --build and --host in Chap 10 toolchain).
The -gnueabi variation is a bit newer and the support for it in config.guess
just missed the versions of packages that are in CLFS 1.1.0.  (That makes
me wonder if there are any other changes missing for ARM eabi that I
just didn't find yet).   But I wanted to build eabi so that's what I used
for a target.

I haven't tried building for 'arm-unknown-linux-gnu' specifically...  Just
guessing that it might build easier since it seems to predate the ARM
eabi support.

The chapter 10 build took a long time on my HW.  My only ARM HW
is a cheapy ARM 'netbook' with a 300ish Mhz processor and 128Meg of
RAM.   The GCC build/test/install step took 48ish hours to finish
on it.   If someone has a faster ARM machine and is willing to build CLFS
on it, I'd be interested in hearing how long it takes on faster machines.

I also ran a CLFS build using QEMU simulating an ARM 'Versatile' system.
It actually built faster on simulated HW than it did on my
ARM netbook :(..   Still painfully slow though.

The binutils test suite went well (only 2 failures),  glibc and
gcc tests had more failures but still seemed reasonable.  The GCC test
had a number of timeout failures.

To keep track of them, I hacked up a version of the PPC CLFS 1.1.0 book
with my changes (and also so I could build it with jhalfs...).   The
diffs are attached and show exactly what changes I made...  It's a hack,
and not something that's anything more than just for FYI in case my
descriptions above are not good enough.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clfs.org/pipermail/clfs-support-clfs.org/attachments/20110814/97b28e8b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clfs110arm.diff
Type: application/octet-stream
Size: 6673 bytes
Desc: not available
URL: <http://lists.clfs.org/pipermail/clfs-support-clfs.org/attachments/20110814/97b28e8b/attachment-0001.obj>


More information about the Clfs-support mailing list