EmbDev.net

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


Author: Michael Okincha (m1ke0)
Posted on:

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 Okincha (m1ke0)
Posted on:

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 Jomed (jomed)
Posted on:

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?
Thanks for your help.
Joel

Author: Michael Okincha (m1ke0)
Posted on:

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?
> Thanks for your help.
> 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.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.