# Forum: ARM programming with GCC/GNU tools Building Yagarto with soft-float support

 Author: Michael O. (m1ke0) Posted on: 2009-01-19 19:31

Rate this post
 0 ▲ useful ▼ not useful
Hi,

I'm trying to recompile the Yagarto tool chain (4.3.2) with support for
msoft-float, instead of the default mhard-float.  My problem is that I
can't find where to disable the mhard-float option.

I've added '-msoft-float' to the build scripts for newlib, and it's
accepted just fine.  However at the end of the build, I get an error
that the options hard-float and soft-float can't be used together.  Fair
enough, but nowhere in newlibs does it specify hard floats.  I've even
replaced all instances of 'hard' with 'soft' in the newlib package, and
still no luck.

So where in the build chain is the -mhard-float option specified?  I've
tried recompiling all the tools after adding -msoft-float to CFLAGS,
with no success.

What's the right place to change mhard-float to msoft-float?

For background, I'm doing all this to avoid the error "your app is
compiled with for soft floats, but -lm is compiled for hard-floats."  It
seems the accepted wisdom is to either recompile the libs for
soft-floats (which I'm trying), or add support for the soft FPU via the
exception handler (which I don't want to try right now).  I'm running on
an STR912 MCU.

Thanks!

 Author: Michael O. (m1ke0) Posted on: 2009-01-22 07:59

Rate this post
 0 ▲ useful ▼ not useful
I solved the problem.  Here's the solution in case others have the same
problem:

Be sure you include '-mfpu=fpa' switch in your project's arm-elf-gcc
command line.

Mike

 Author: Joel J. (jomed) Posted on: 2009-01-22 13:23

Rate this post
 0 ▲ useful ▼ not useful
Michael Okincha wrote:
> I solved the problem.  Here's the solution in case others have the same
> problem:
>
> Be sure you include '-mfpu=fpa' switch in your project's arm-elf-gcc
> command line.
>
> Mike

Hi Mike,
Thanks for your work, it is a long time I have been trying to use
Yagarto with floating point arithmetic and printf floats (do you use
also printf function with formated float?).
In fact I gave up and switched to Idealist, but I will try again with
your advices, so can you tell me: is the '-mfu=fpa' option to be
inserted in the STR9 project or did you add it when you rebuilt the
Yagarto toolchain?
Joel

 Author: Michael O. (m1ke0) Posted on: 2009-02-18 08:37

Rate this post
 0 ▲ useful ▼ not useful
Joel Jomed wrote:
> Michael Okincha wrote:
>> I solved the problem.  Here's the solution in case others have the same
>> problem:
>>
>> Be sure you include '-mfpu=fpa' switch in your project's arm-elf-gcc
>> command line.
>>
>> Mike
>
> Hi Mike,
> Thanks for your work, it is a long time I have been trying to use
> Yagarto with floating point arithmetic and printf floats (do you use
> also printf function with formated float?).
> In fact I gave up and switched to Idealist, but I will try again with
> your advices, so can you tell me: is the '-mfu=fpa' option to be
> inserted in the STR9 project or did you add it when you rebuilt the
> Yagarto toolchain?
> Joel

You add the '-mfpu=fpa' switch to your project's make file.  Yagarto is
fine as it is; you don't have to rebuild it.

Funny; I'm trying to switch to IDEaliST because of printf issues.

• $formula (LaTeX syntax)$