<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body style="word-wrap: break-word;" bgcolor="#ffffff" text="#000000">
    <br>
    <div>
      <div>On 6 Feb 2011, at 12:51, Andrew Bradford wrote:</div>
      <br class="Apple-interchange-newline">
      <blockquote type="cite">
        <div>On Sat, Feb 5, 2011 at 11:49 PM, Steven Swann <<a
            href="mailto:sjs205.linux@gmail.com">sjs205.linux@gmail.com</a>>
          wrote:<br>
          <blockquote type="cite">Hello all,<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">I'm having a little trouble with my
            current ARM build in that I can't seem<br>
          </blockquote>
          <blockquote type="cite">to get the CFLAGS and BUILD flags set
            up correctly.<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">Basically, I'm trying to take the
            compilation one-step further by ensuring<br>
          </blockquote>
          <blockquote type="cite">that my final system takes advantages
            of all the possible features of my ARM<br>
          </blockquote>
          <blockquote type="cite">core, rather than it being designed
            for the generic ARM architecture. With<br>
          </blockquote>
          <blockquote type="cite">this in mind, the problems seem to
            stem from having the flags set up<br>
          </blockquote>
          <blockquote type="cite">incorrectly.<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">My process so far and the logic behind
            it:<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">When building the cross compile tools
            I leave the CFLAGS variable empty and<br>
          </blockquote>
          <blockquote type="cite">use the following build flags
            '-mabi=aapcs-linux -mfloat-abi=softfp'. I have<br>
          </blockquote>
          <blockquote type="cite">chosen the softfp options since the
            FPU for my processor isn't 100% ieee<br>
          </blockquote>
          <blockquote type="cite">compatable.<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">From here I compile the static
            compiler, build uClibc with the .config<br>
          </blockquote>
          <blockquote type="cite">supplied, with the only change being
            support for EABI rather than the OABI.<br>
          </blockquote>
          <blockquote type="cite">I then compile the final compiler and
            all seems fine. I leave the remaining<br>
          </blockquote>
          <blockquote type="cite">configuration of uClibc as is; my
            logic here is that I wish to compile the<br>
          </blockquote>
          <blockquote type="cite">tool suit with generic processor
            options so that I can pass the architecture<br>
          </blockquote>
          <blockquote type="cite">specific options when compiling the
            actual target software.<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">Once I am ready to build the target
            software I simply add the following<br>
          </blockquote>
          <blockquote type="cite">CFLAGS: "-mcpu=arm1176jzf-s
            -mtune=arm1176jzf-s -mfpu=vfp".<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">The problems then starts when it comes
            to using the tool suite with these<br>
          </blockquote>
          <blockquote type="cite">CFLAGS. At first busybox failed when
            issuing the make command with:<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">"  CC      applets/applets.o<br>
          </blockquote>
          <blockquote type="cite">applets/applets.c:1:0: sorry,
            unimplemented: -mfloat-abi=hard and VFP<br>
          </blockquote>
          <blockquote type="cite">make[1]: *** [applets/applets.o] Error
            1<br>
          </blockquote>
          <blockquote type="cite">make: *** [applets_dir] Error 2<br>
          </blockquote>
          <blockquote type="cite">"<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">So I removed the "-mfloat-abi=softfp"
            build flag and busybox compiles fine.<br>
          </blockquote>
          <blockquote type="cite">Is this a bug? Since I haven't
            selected the use of the hard FLU ABI...<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">I then start to try and configure
            e2fsprogs and this fails too with:<br>
          </blockquote>
          <blockquote type="cite">"checking for
            arm-unknown-linux-uclibc-gcc... arm-unknown-linux-uclibc-gcc<br>
          </blockquote>
          <blockquote type="cite">-mabi=aapcs-linux -mfloat-abi=softfp
            -Os<br>
          </blockquote>
          <blockquote type="cite">checking whether the C compiler
            works... no<br>
          </blockquote>
          <blockquote type="cite">"<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">If I then remove both of the build
            flags from the configure command it<br>
          </blockquote>
          <blockquote type="cite">configures fine:<br>
          </blockquote>
          <blockquote type="cite">CC="${CC} ${BUILD} -Os" ../configure
            --prefix=/usr<br>
          </blockquote>
          <blockquote type="cite"> --with-root-prefix=""
            --host=${CLFS_TARGET} --disable-tls<br>
          </blockquote>
          <blockquote type="cite"> --disable-debugfs
            --disable-e2initrd-helper --disable-nls<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">I have tried a number of options with
            the building of the toolsuit, I tried<br>
          </blockquote>
          <blockquote type="cite">adding the target specific options to
            the uClibc .config but this seemed to<br>
          </blockquote>
          <blockquote type="cite">make problems worse since I couldn't
            get busybox to compile using the tools<br>
          </blockquote>
          <blockquote type="cite">due to "ld, cannot find -lfloat".<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">With this in mind I am a little stuck.
            If somebody could please give me some<br>
          </blockquote>
          <blockquote type="cite">guidance on this is would be greatly
            appreciated. If I am going about it the<br>
          </blockquote>
          <blockquote type="cite">wrong way then please let me know.<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">sjs105<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">Hardware<br>
          </blockquote>
          <blockquote type="cite">Target:<br>
          </blockquote>
          <blockquote type="cite">Samsung s3c6410,<br>
          </blockquote>
          <blockquote type="cite">ARM core: arm1176jzf-s<br>
          </blockquote>
          <blockquote type="cite">FPU: VFPv2<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <blockquote type="cite">.bashrc<br>
          </blockquote>
          <blockquote type="cite">set +h<br>
          </blockquote>
          <blockquote type="cite">umask 022<br>
          </blockquote>
          <blockquote type="cite">ARMCROSS=/mnt/arm-cross<br>
          </blockquote>
          <blockquote type="cite">LC_ALL=POSIX<br>
          </blockquote>
          <blockquote type="cite">PATH=${ARMCROSS}/cross-tools/bin:/bin:/usr/bin<br>
          </blockquote>
          <blockquote type="cite">export ARMCROSS LC_ALL PATH<br>
          </blockquote>
          <blockquote type="cite">unset CFLAGS<br>
          </blockquote>
          <blockquote type="cite">unset CXXFLAGS<br>
          </blockquote>
          <blockquote type="cite">export BUILD="-mabi=aapcs-linux
            -mfloat-abi=softfp"<br>
          </blockquote>
          <blockquote type="cite">export
            CLFS_HOST="i486-cross-linux-gnu"<br>
          </blockquote>
          <blockquote type="cite">export
            CLFS_TARGET="arm-unknown-linux-uclibc"<br>
          </blockquote>
          <blockquote type="cite">export CLFS_ARCH="arm"<br>
          </blockquote>
          <blockquote type="cite">export CLFS_ENDIAN="little"<br>
          </blockquote>
          <blockquote type="cite">export
            CC="arm-unknown-linux-uclibc-gcc"<br>
          </blockquote>
          <blockquote type="cite">export
            CXX="arm-unknown-linux-uclibc-g++"<br>
          </blockquote>
          <blockquote type="cite">export
            AR="arm-unknown-linux-uclibc-ar"<br>
          </blockquote>
          <blockquote type="cite">export
            AS="arm-unknown-linux-uclibc-as"<br>
          </blockquote>
          <blockquote type="cite">export
            LD="arm-unknown-linux-uclibc-ld"<br>
          </blockquote>
          <blockquote type="cite">export
            RANLIB="arm-unknown-linux-uclibc-ranlib"<br>
          </blockquote>
          <blockquote type="cite">export
            READELF="arm-unknown-linux-uclibc-readelf"<br>
          </blockquote>
          <blockquote type="cite">export
            STRIP="arm-unknown-linux-uclibc-strip"<br>
          </blockquote>
          <blockquote type="cite">export CFLAGS="-mcpu=arm1176jzf-s
            -mtune=arm1176jzf-s -mfpu=vfp "<br>
          </blockquote>
          <blockquote type="cite">export CXXFLAGS="-mcpu=arm1176jzf-s
            -mtune=arm1176jzf-s -mfpu=vfp"<br>
          </blockquote>
          <blockquote type="cite"><br>
          </blockquote>
          <br>
          Steven,<br>
          <br>
          I know your pain.  I've been grappling with a similar issue
          over the past week.<br>
          Currently, the embedded book is broken for those wanting to
          build an<br>
          EABI (aapcs-linux or aapcs ABI) version of GCC for arm.  I'm
          working<br>
          on fixing it.<br>
        </div>
      </blockquote>
      <div><br>
      </div>
      Glad it isn't just me then :)</div>
    <div><br>
      <blockquote type="cite">
        <div><br>
          To correctly build a GCC that supports the EABI, you need to
          set your<br>
          CLFS_TARGET triplet to be "arm-unknown-linux-uclibcgnueabi".
           Then,<br>
          when you build GCC (both static and final), pass the<br>
          "--with-abi=aapcs-linux" switch in addition to the other
          switches<br>
          passed.  If you'd like a soft-float only GCC, add the switch<br>
          "--with-float=soft" as well (but if you want to use vfp, you
          may want<br>
          to use "--with-float=softfp" which will enable hard floating
          point<br>
          code that falls back on soft if hard isn't available, see
          Debian wiki<br>
          [<a href="http://wiki.debian.org/ArmHardFloatPort">http://wiki.debian.org/ArmHardFloatPort</a>]
          for some good info on these<br>
          choices).<font class="Apple-style-span" color="#000000"><font
              class="Apple-style-span" color="#144fae"><br>
            </font></font></div>
      </blockquote>
      <div><br>
      </div>
      That is probably where I'm going wrong. I read somewhere when I
      first started out about the </div>
    <div>slight change to the target triplet, but assumed that this OS
      flag only served as a pointer to the </div>
    <div>target system OS type and was not of any great significance to
      the build process... What is it they say </div>
    <div>about assumption being the mother of all ...</div>
    <div><br>
    </div>
    <div>I also had a look at the debian site when first allocating the
      ABI type. My problem here is that </div>
    <div>my FPU isn't 100% ieee compatable so I must use either the
      'soft' or 'softfp' switch. I have </div>
    <div>also found that there is no specific ABI for my FPU since it is
      'VFPv2', gcc docs only show </div>
    <div>'VFP' or 'VFPv3'.</div>
    <div><br>
    </div>
    <div>
      <blockquote type="cite">
        <div>Then, when configuring uClibc, do a "make menuconfig"
          before the "make<br>
          oldconfig" and switch it from OABI to EABI (like it sounds
          like you're<br>
          already doing).<br>
        </div>
      </blockquote>
      <div><br>
      </div>
      Doing exactly that. </div>
    <div><br>
      <blockquote type="cite">
        <div><br>
          When you build packages, then you can use your CFLAGS and
          CXXFLAGS and<br>
          they should work as you expect, optimizing for your particular
          variant<br>
          of arm chip.<br>
        </div>
      </blockquote>
      <div><br>
      </div>
      I am currently in the process of rebuilding my toolsuite with the
      above amendments to the build options, </div>
    <div>all seems to be going well ATM. Once I start compiling the
      system software I'll report my progress.<br>
      <blockquote type="cite">
        <div><br>
          I've added some info to trac ticket 620<br>
          [<a href="http://trac.cross-lfs.org/ticket/620">http://trac.cross-lfs.org/ticket/620</a>]
          and 749<br>
          [<a href="http://trac.cross-lfs.org/ticket/749">http://trac.cross-lfs.org/ticket/749</a>]
          reflecting these things.<br>
        </div>
      </blockquote>
    </div>
    <div>
      <blockquote type="cite">
        <div>Regards,<br>
          Andrew<br>
          _______________________________________________<br>
          Clfs-support mailing list<br>
          <a href="mailto:Clfs-support@lists.cross-lfs.org">Clfs-support@lists.cross-lfs.org</a><br>
          <a
href="http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org">http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org</a><br>
        </div>
      </blockquote>
    </div>
    Perfect :) Cheers for your help
    <div><br>
    </div>
    <div>sjs205</div>
  </body>
</html>