EmbDev.net

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


von Michael O. (m1ke0)


Rate this post
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!

von Michael O. (m1ke0)


Rate this post
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

von Joel J. (jomed)


Rate this post
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

von Michael O. (m1ke0)


Rate this post
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.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.