ARM hardfloat and Gentoo


Since gcc-4.5.0, the option for a hardfloat toolchain has been available for ARM. I’m not going to duplicate the information about hardfloat on ARM, since its really well explained here:

Summarizing, using hardfloat over softfp and softfloat, provides a better performance. However there is a “problem”. Almost all the devices using ARMv5 processors don’t have VFP, so for the users of those devices it won’t make a difference. With ARMv7 there’s no problem, because as far as i know, there’s no ARMv7 processor which doesn’t have VFP(correct me if i’m wrong).

Anyway, focusing on the Gentoo part, back in July, Siarhei Siamashka (ssvb) bootstraped a hardfloat ARMv7 stage3. For which i’d like to thank him. I worked with Siarhei on getting the changes needed for getting a hardfloat toolchain in Gentoo if -hardfloat- is used in the CHOST, among other things.

Last month i released a hardfloat stage3, so anyone who wants to use it, is free to do so. However keep in mind that since gcc-4.5.0 is not stable(stable is 4.4.4-r2 as of this writing), you need to have this in your package.keywords file, so portage won’t downgrade gcc and diffutils:


You can download the stage3 from here:

Those stages have been built using:
-CFLAGS=”-O2 -pipe -march=armv7-a -mfpu=vfpv3-d16″

The “-mfloat-abi=hard” is implied by the hardfloat string in CHOST using the Gentoo eclasses.

Have fun and happy testing!

Update: I forgot to say that binary blobs won’t work with hardfloat if they’re not built using a hardfloat toolchain. That means that if you’re using a video driver(f.ex, pvr drivers for OMAP hw) that is built as binary, it won’t work.


10 Responses to “ARM hardfloat and Gentoo”

  1. disi Says:

    will do on the weekend with my touchbook 🙂

    WOW, from your link:
    They noticed important wins (in the order of 40% performance improvement) in floating-point heavy applications/libraries such as mesa, with a Cortex-A8 CPU.

  2. chris Says:

    Are there any ARMv7a ISA chips that don’t have NEON? I’m pretty sure that it’s a mandatory part of the ISA.

    Naturally, on an ARMv7a chip, VFP instructions are still executed by the same physical FPU, but I believe it’s done without using any SIMD.

    Wouldn’t it make more sense just to specify NEON from the get-go – so, armv7a-hardfloat-* produces -mfpu=neon -mfloat-abi=hard rather than -mfpu=vfpv3-d16 ?

    • Raúl Porcel Says:

      Hi Chris,

      both the Marvell Dove and Nvidia Tegra2 are chips that don’t have neon, check:

      with -mfpu=neon it would SIGILL on those chips. Although funnily enough building glibc on hardfloat on the tegra fails to build for me, it gives a segfault 😀 Ubuntu had an issue lately where QT was built with neon enabled, as the QT build system detected neon on the system(they use i.mx515 as buildd’s). And that was fun because it affected users of the Toshiba AC100 which is a Tegra2 smartbook. One of those users affected was one of the ubuntu arm devs 😛

  3. Aleksandr Says:

    I try build system (beagleboard-xM) with CFLAGS=”-O2 -pipe -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a8″
    I have problem with compiling ffmpeg with neon support
    Can you help me?

    • Raúl Porcel Says:

      Hi Aleksandr,

      sorry but i’m not able to help. I’d suggest you join #gentoo-embedded on and talk with Siarhei (ssvb), since he’s the one that works mainly with hardfloat.

  4. DavidPiegdon Says:

    I tried to create a crosscompile environment from x86_64 to arm, using

    crossdev –g 4.5.2 –b 2.21 –l 2.11.3 armv7a-hardfloat-linux-gnueabi

    it works until the libc in between the two gcc-stages is build. it seems like CHOST is set wrongly then; -m32 is used in configure. but even if i patch it to the right CHOST, -m32 is used. and then, even if i filter -m32 in the ebuild of libc, -m32 does not occur on the command-line, but the compiler complains about it. do you have any idea, what i am doing wrong?

    other question: did you use catalyst to build the stage3? which options did you use, if so?

  5. sectroyer Says:

    I have installed gentoo on pandaboard es based on your original pandaboard tutorial. I would like to provide the information about the changes that are necessary to make it work on es version. How can I contact you or now can I provide this information.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: