Crash under sparc/rtems-4.11 when compiling with FPU

Athanasios.Tsiodras at Athanasios.Tsiodras at
Mon Feb 8 09:06:49 UTC 2016

Hi, Jiri.

You are right that this is the default (see quick test output below). If I 
understood him corectly, though, I think that Sebastian is saying that the 
default settings of the Leon3 BSP compilation ("-msoft-float " - see 
"c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg") do not allow me to 
use "-mhard-float" in my application code. The documentation seems to 
contradict him, stating that I should be able to, and that "deferred 
floating point context switch" is a feature, not a bug). I will try his 
suggestion anyway - I patched the .cfg and am currentlly building the BSP 
with -mhard-float - will report back whether this solves the issue or not.

$ cat foo.c
void foo()
        float a=1;
        float b;
        b= a*a;

$ sparc-rtems4.11-gcc -c foo.c

$ sparc-rtems4.11-objdump -S foo.o

Disassembly of section .text:
00000000 <foo>:
  1c:   91 a2 49 28     fmuls  %f9, %f8, %f8

European Space Agency (via HE Space)
Thanassis Tsiodras
Real-time Embedded Software Engineer 
System, Software and Technology Department

Keplerlaan 1, PO Box 299
NL-2200 AG Noordwijk, The Netherlands
Athanasios.Tsiodras at |
T +31 71 565 5332

From:   "Jiri Gaisler" <jiri at>
To:     "Sebastian Huber" <sebastian.huber at>, "RTEMS 
List" <users at>
Cc:     software at
Date:   07/02/2016 10:59
Subject:        Re: Crash under sparc/rtems-4.11 when compiling with FPU
Sent by:        "users" <users-bounces at>

On 07/02/16 07:41, Sebastian Huber wrote:
> Hello Athanasios,
> it was always a miracle to me how you are supposed to use the 
leon2/leon3 BSPs with a FPU. If you want to use the FPU, then the BSP must 
be built with the -mhard-float option, otherwise the FPU support is not 
enabled in the operating system support. In addition the application 
configuration must be compiled with exactly the same compiler flags as the 
BSP, otherwise it will generate a corrupt configuration.
> I think we need leon2fp and leon3fp BSPs, which use -mhard-float.

Isn't -mhard-float the default setting in gcc? -msoft-float is used to
force software emulation of the FPU, otherwise FPU instructions are
issued by default.

users mailing list
users at

This message and any attachments are intended for the use of the addressee or addressees only.
The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its
content is not permitted.
If you received this message in error, please notify the sender and delete it from your system.
Emails can be altered and their integrity cannot be guaranteed by the sender.

Please consider the environment before printing this email.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list