<br>Hello,<br><br>    I've sometimes seen people here ask if CLFS main book can be built for ARM.  I<br>recently started learning about ARM and decided to see if I <br>could get CLFS 1.1.0 to build for it.   I was able to get it running<br>
and thought I would share that information here.<br><br>    By starting with the PPC 32bit CLFS 1.1.0 document as my base and making the<br>following changes to it, I was able to get it built for ARM:<br><br>========================================================================<br>
In chapter 3:<br><br>    Also download glibc-ports-2.7.tar.bz2.   <br>    It is needed to build glibc for ARM.<br><br>    Skip downloading of any powerpc specific packages & patches.<br><br>=========================<br>
Chapter 4:  No changes.<br><br>=========================<br>Section 5.3 I selected my CLFS_TARGET as follows:<br><br>    export CLFS_TARGET="arm-unknown-linux-gnueabi"<br><br>    (Other ARM targets might work be easier to get working with 1.1.0...)<br>
<br>=========================<br>Section 5.4:<br><br>        Use "ARCH=arm" instead of "ARCH=powerpc" in the commands.<br><br>=========================<br>Section 5.7 after the same change to rs6000/linux.h, add:<br>
<br>echo "<br>#undef STARTFILE_PREFIX_SPEC<br>#define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >> gcc/config/arm/linux-eabi.h<br>echo "<br>#undef STARTFILE_PREFIX_SPEC<br>#define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >> gcc/config/arm/linux-elf.h<br>
<br>=========================<br>Section 5.8 do:<br><br>After unpacking glibc-2.7.tar.bz2, cd into the glib-2.7 directory and then<br>do 'tar xvfj ../glibc-ports-2.7.tar.bz2' and 'mv glib-ports-2.7 ports'<br>
<br>Do not do the following command in that section:<br><br>echo "libc_cv_ppc_machine=yes" >> config.cache<br><br>=========================<br>Section 5.9 after the same change to rs6000/linux.h, add:<br>echo "<br>
#undef STARTFILE_PREFIX_SPEC<br>#define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >> gcc/config/arm/linux-eabi.h<br>echo "<br>#undef STARTFILE_PREFIX_SPEC<br>#define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >> gcc/config/arm/linux-elf.h<br>
<br>=========================<br>No further changes until chapter 10 except skip the building of any of the <br>powerpc specific packages (yaboot & such...).<br><br>=========================<br>In chapter 10, during the native builds of the packages, it kept trying <br>
to build 'arm-unknown-linux-gnu' instead of 'arm-unknown-linux-gnueabi'.<br>A variety of build failures occured until I figured out that it was doing that.<br><br>I added the following line to specify the target I wanted:<br>
<br>--build=arm-unknown-linux-gnueabi --host=arm-unknown-linux-gnueabi \<br><br>to the configure command in Chapter 10 each of building of binutils,<br>glibc and gcc.   The Chapter 10 build then completed and the<br>resulting system booted and ran ok.   It worked but I'm not sure that is the <br>
proper way to fix it.<br><br>And of course, in section 10.7, unpack and add in the <br>glibc-ports package during glibc build.<br><br>And of course,  skip the building any of the powerpc specific packages.<br><br>=====================================================================<br>
<br>Other notes:<br><br>The 'arm-unknown-linux-gnu' target might be easier to build (i.e.<br>might not need specifiying the --build and --host in Chap 10 toolchain).  <br>The -gnueabi variation is a bit newer and the support for it in config.guess<br>
just missed the versions of packages that are in CLFS 1.1.0.  (That makes<br>me wonder if there are any other changes missing for ARM eabi that I<br>just didn't find yet).   But I wanted to build eabi so that's what I used <br>
for a target.  <br><br>I haven't tried building for 'arm-unknown-linux-gnu' specifically...  Just<br>guessing that it might build easier since it seems to predate the ARM<br>eabi support.<br><br>The chapter 10 build took a long time on my HW.  My only ARM HW<br>
is a cheapy ARM 'netbook' with a 300ish Mhz processor and 128Meg of <br>RAM.   The GCC build/test/install step took 48ish hours to finish<br>on it.   If someone has a faster ARM machine and is willing to build CLFS<br>
on it, I'd be interested in hearing how long it takes on faster machines.<br><br>I also ran a CLFS build using QEMU simulating an ARM 'Versatile' system.<br>It actually built faster on simulated HW than it did on my<br>
ARM netbook :(..   Still painfully slow though.<br><br>The binutils test suite went well (only 2 failures),  glibc and<br>gcc tests had more failures but still seemed reasonable.  The GCC test<br>had a number of timeout failures.<br>
<br>To keep track of them, I hacked up a version of the PPC CLFS 1.1.0 book <br>with my changes (and also so I could build it with jhalfs...).   The<br>diffs are attached and show exactly what changes I made...  It's a hack, <br>
and not something that's anything more than just for FYI in case my <br>descriptions above are not good enough.<br><br>