[gccsdk] VFP in GCC 4.1.2

John Tytgat John.Tytgat at aaug.net
Thu Dec 23 16:42:00 PST 2010

In message <Pine.WNT.4.62.1011281808010.2664 at c203>
          Jeffrey Lee <me at phlamethrower.co.uk> wrote:

> GCC changes to get VFP working:
> * /gcc4/srcdir/gcc/gcc/config/arm/arm.c:
> In arm_override_options(), get rid of these two lines (around line 1267):
>    if (arm_float_abi == ARM_FLOAT_ABI_SOFTFP)
>      sorry ("arm-unknown-riscos and -mfloat-abi=softfp");
> * /gcc4/srcdir/gcc/gcc/config/arm/riscos-elf.h:
> The bit that picks a default -mfpu value is broken. The line should be 
> changed from this:
> "%{!mfpu:%{mhard-float|mfloat-abi=hard:-mfpu=fpa; :-mfpu=softfpa}}" \
> to this:
> "%{!mfpu=*:%{mhard-float|mfloat-abi=hard:-mfpu=fpa; :-mfpu=softfpa}}" \
> With those two changes, you should be able to compile (but not link!) by 
> using "-mfpu=vfp -mfloat-abi=softfp -march=armv6". Hacking the linker 
> to get rid of the error message will allow you to link against the 
> softfloat libraries, but since I haven't actually tried running any code 
> yet I can't guarantee whether there'll be any knock-on effects or not.

I've added those changes to the gcc 4.6 branch at

Note, you can use -march=armv7-a instead of -march=armv6 for, I guess,
using VFPv3.

John Tytgat, in his comfy chair at home                                 BASS
John.Tytgat at aaug.net                             ARM powered, RISC OS driven

More information about the gcc mailing list