EmbDev.net

Forum: ARM programming with GCC/GNU tools ERROR: x.o uses software FP,where as @.elf uses hardware FP


Author: Gerard Sequeira (bluehash)
Posted on:

Rate this post
0 useful
not useful
Hello,
I get the following error when building my project.
My setup:
Yagarto consisting of Eclipse 3.2 and gcc 4.1.1
Chip: LPC2106

I had some help from Clifford(look below) to add -msoft-float to EFLAGS
in the makefile,
but that didnt go through.
His other option was to rebuild libea_startup_thumb.a.
I do have the framework.c and other files.

Could you tell me how to rebuild them.
My Makefile is here
http://www.machinegrid.com/temp/makefile.txt




>
> These are the messages i get
>
> "c:\program
> files\yagarto\bin\..\lib\gcc\arm-elf\4.1.1\..\..\..\..\arm-elf\bin\ld.ex e:
> ERROR: startup/libea_startup_thumb.a(framework.o) uses software FP,
> whereas srv1.elf uses hardware FP"
>
> Im using gcc 4.1.1 on the LPC2106 board from olimex.

Your problem is different (you probably should not have chipped in on
Joerg's thread on that basis) srv1.elf is built with the default
hard-float, but framework.o was built with soft-float.

You have to have consistency; either add -msoft-float to the EFLAGS
macro in the make file, or if you are able, rebuild
libea_startup_thumb.a without -msoft-float (I'd recommend the latter if
you have the source and build files).

Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 useful
not useful
gerard sequeira wrote:
> I had some help from Clifford(look below) to add -msoft-float to EFLAGS
> in the makefile,
> but that didnt go through.

I think you would be better off in this case then trying to figure out
why that did not work. Post the build log (for a clean build - you did
do a clean build didn't you? It would not have worked unless you force
all sources to re-build). And post the modified makefile - the one you
posted does not have the EFLAGS modification suggested (perhaps that is
the problem?).

Clifford

Author: Gerard Sequeira (bluehash)
Posted on:

Rate this post
0 useful
not useful
Clifford Slocombe wrote:
> gerard sequeira wrote:
>> I had some help from Clifford(look below) to add -msoft-float to EFLAGS
>> in the makefile,
>> but that didnt go through.
>
> I think you would be better off in this case then trying to figure out
> why that did not work. Post the build log (for a clean build - you did
> do a clean build didn't you? It would not have worked unless you force
> all sources to re-build). And post the modified makefile - the one you
> posted does not have the EFLAGS modification suggested (perhaps that is
> the problem?).
>
> Clifford


I managed to get off the errors.I have no clue how it worked, but these
were the steps.

In the EFlags field (which was EFLAGS  = -mthumb-interwork ), I inserted
the -msoft-fpu flag
(EFLAGS  = -mthumb-interwork -msoft-fpu)

When I cleant and the built the project, it said -msoft-fpu command was
not found.

So I removed the flag and rebuilt the project.
The floating point errors never showed up again.

This happened on the other systems I installed yagarto on too.
Hope this helps anyone.

Thank you for your help Clifford.

Regards,
Gerard

Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 useful
not useful
> I managed to get off the errors.I have no clue how it worked, but these
> were the steps.
>
> In the EFlags field (which was EFLAGS  = -mthumb-interwork ), I inserted
> the -msoft-fpu flag
> (EFLAGS  = -mthumb-interwork -msoft-fpu)
>
> When I cleant and the built the project, it said -msoft-fpu command was
> not found.
>
> So I removed the flag and rebuilt the project.
> The floating point errors never showed up again.
>
> This happened on the other systems I installed yagarto on too.
> Hope this helps anyone.

Perhaps all that was needed was a clean build in any case. Alternatively
the -mthumb-interwork switch, (which your original makefile as posted
did not have), forced the use of an alternate library that was built
with compatible settings.

Why it said  -msoft-fpu not found I don't know. Did it really say
"command not found"? It is a compiler switch not a command - you really
need to post the log to resolve such issues, vague descriptions are
'lossy' information.

Clifford

Author: Gerard Sequeira (bluehash)
Posted on:

Rate this post
0 useful
not useful
Clifford Slocombe wrote:
>> I managed to get off the errors.I have no clue how it worked, but these
>> were the steps.
>>
>> In the EFlags field (which was EFLAGS  = -mthumb-interwork ), I inserted
>> the -msoft-fpu flag
>> (EFLAGS  = -mthumb-interwork -msoft-fpu)
>>
>> When I cleant and the built the project, it said -msoft-fpu command was
>> not found.
>>
>> So I removed the flag and rebuilt the project.
>> The floating point errors never showed up again.
>>
>> This happened on the other systems I installed yagarto on too.
>> Hope this helps anyone.
>
> Perhaps all that was needed was a clean build in any case. Alternatively
> the -mthumb-interwork switch, (which your original makefile as posted
> did not have), forced the use of an alternate library that was built
> with compatible settings.
>
> Why it said  -msoft-fpu not found I don't know. Did it really say
> "command not found"? It is a compiler switch not a command - you really
> need to post the log to resolve such issues, vague descriptions are
> 'lossy' information.
>
> Clifford





It says "unrecognized command line option "-msoft-fpu""
The earlier makefile was from the main directory "srv1".
I put the switch in the makefile from the /startup directory.
makefile : http://www.machinegrid.com/temp/makefile.txt


Log snip:
make[1]: Entering directory `c:/Program Files/swarm/srv1/startup'
arm-elf-gcc -c -mcpu=arm7tdmi  -I . -DEL -DGCC   -mthumb-interwork
-msoft-fpu -DLPC2106  -Os -gdwarf-2 -Wall -Wcast-align -Wcast-qual
-Wimplicit -Wnested-externs -Wpointer-arith -Wswitch -Wreturn-type
-Wa,-ahlms=consol.lst -o consol.o consol.c
cc1.exe: error: unrecognized command line option "-msoft-fpu"
make[1]: *** [consol.o] Error 1
arm-elf-gcc -c -mcpu=arm7tdmi  -I . -DEL -DGCC   -mthumb-interwork
-msoft-fpu -DLPC2106  -Os -gdwarf-2 -Wall -Wcast-align -Wcast-qual
-Wimplicit -Wnested-externs -Wpointer-arith -Wswitch -Wreturn-type
-Wa,-ahlms=framework.lst -o framework.o framework.c
cc1.exe: error: unrecognized command line option "-msoft-fpu"
make[1]: *** [framework.o] Error 1
arm-elf-gcc -c -mcpu=arm7tdmi  -I . -DEL -DGCC   -mthumb-interwork
-msoft-fpu -DLPC2106  -x assembler-with-cpp -gstabs
-Wa,-alhms=startup.lst -o startup.o startup.S
cc1.exe: error: unrecognized command line option "-msoft-fpu"
make[1]: *** [startup.o] Error 1
make[1]: Target `all' not remade because of errors.
make[1]: Leaving directory `c:/Program Files/swarm/srv1/startup'

Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 useful
not useful
Now I see it! Why did you use -msoft-fpu ?

The correct option (and the one I suggested) is -msoft-float .

http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/ARM-Op...


Not that it matters since it now works.

Clifford

Author: Gerard Sequeira (bluehash)
Posted on:

Rate this post
0 useful
not useful
Clifford Slocombe wrote:
> Now I see it! Why did you use -msoft-fpu ?
>
> The correct option (and the one I suggested) is -msoft-float .
>
> http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/ARM-Op...
>
>
> Not that it matters since it now works.
>
> Clifford

My mistake.Thank you so much for your help.

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.