<font size=2 face="sans-serif">Hi Jerry.</font>
<br>
<br><font size=2 face="sans-serif">Thanks for the suggestion - indeed,
If you look at my response to Jiri, you'll see that I verified that the
-mhard-float is not necessary (objdump verified that FPU instructions are
emitted by default, if you don't pass -msoft-float).</font>
<br>
<br><font size=2 face="sans-serif">I am now scripting my nightly build
to do the patch explicitly, so I can follow the tip of 4.11 with native
FPU support (our intended target).</font>
<br>
<br><font size=2 face="sans-serif">I didn't try the switch to v8 - since
the removal of -msoft-float from leon3.cfg proved enough in my tests, and
I am guessing the default leon3.cfg configuration was chosen to be -mcypress
for a reason... At least I hope so :-)</font>
<br>
<br><font size=2 face="sans-serif">Thanks!</font>
<br>
<br><font size=2 face="sans-serif"><b>European Space Agency (via HE Space)</b></font>
<br><font size=2 color=#000080 face="sans-serif">Thanassis Tsiodras</font>
<br><font size=2 face="sans-serif">Real-time Embedded Software Engineer
</font>
<br><font size=2 face="sans-serif">System, Software and Technology Department</font>
<br>
<br><font size=2 face="sans-serif"><b>ESTEC</b></font>
<br><font size=2 face="sans-serif">Keplerlaan 1, PO Box 299</font>
<br><font size=2 face="sans-serif">NL-2200 AG Noordwijk, The Netherlands</font>
<br><font size=2 face="sans-serif">Athanasios.Tsiodras@esa.int | </font><a href=www.esa.int><font size=2 color=blue face="sans-serif">www.esa.int</font></a>
<br><font size=2 face="sans-serif">T +31 71 565 5332</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">"Needell, Jerry"
<Jerry.Needell@unh.edu></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">"Athanasios.Tsiodras@esa.int"
<Athanasios.Tsiodras@esa.int></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc:
</font><font size=1 face="sans-serif">"Needell, Jerry"
<Jerry.Needell@unh.edu>, "RTEMS List" <users@rtems.org></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">08/02/2016 11:36</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">Re: Crash under
sparc/rtems-4.11 when compiling with FPU</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=3>sorry for the typo - I meant -mcpu v8 … </font>
<br><font size=3>I have used this for bsps (RTEMS 4.9) with FPU without
needing the -mhard-float specification</font>
<br><font size=3>For non FPU bsps I have used -msoft-float</font>
<br><font size=3>both with-mcpu v8</font>
<br>
<br>
<br><font size=3>On Feb 8, 2016, at 5:14 AM, Needell, Jerry <</font><a href=mailto:Jerry.Needell@unh.edu><font size=3 color=blue><u>Jerry.Needell@unh.edu</u></font></a><font size=3>>
wrote:</font>
<br>
<br><font size=3>I thought it was best to use -mv8 rather tahtn -mcypress
for leon3 bsps? Does this make any difference in your case?</font>
<br><font size=3>On Feb 8, 2016, at 4:50 AM, </font><a href=mailto:Athanasios.Tsiodras@esa.int><font size=3 color=blue><u>Athanasios.Tsiodras@esa.int</u></font></a><font size=3>
wrote:</font>
<br>
<br><font size=2 face="sans-serif">I verified Sebastian's suggestion -
by modifying the leon3.cfg file...</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
diff --git a/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg
b/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg</font><font size=3>
</font><font size=2 face="sans-serif"><br>
index 58f2f07..30fc3a4 100644</font><font size=3> </font><font size=2 face="sans-serif"><br>
--- a/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg</font><font size=3>
</font><font size=2 face="sans-serif"><br>
+++ b/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg</font><font size=3>
</font><font size=2 face="sans-serif"><br>
@@ -9,7 +9,8 @@ RTEMS_CPU_MODEL=leon3</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
# This contains the compiler options necessary to
select the CPU model</font><font size=3> </font><font size=2 face="sans-serif"><br>
# and (hopefully) optimize for it.</font><font size=3>
</font><font size=2 face="sans-serif"><br>
-CPU_CFLAGS = -mcpu=cypress -msoft-float</font><font size=3>
</font><font size=2 face="sans-serif"><br>
+CPU_CFLAGS = -mcpu=cypress -mhard-float</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
...the generated binary of hello.exe works fine - I went a step further
and did a test calculation, too:</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
diff --git a/testsuites/samples/hello/init.c b/testsuites/samples/hello/init.c</font><font size=3>
</font><font size=2 face="sans-serif"><br>
index d8fe450..6ee33f6 100644</font><font size=3> </font><font size=2 face="sans-serif"><br>
--- a/testsuites/samples/hello/init.c</font><font size=3>
</font><font size=2 face="sans-serif"><br>
+++ b/testsuites/samples/hello/init.c</font><font size=3>
</font><font size=2 face="sans-serif"><br>
@@ -27,8 +27,13 @@ rtems_task Init(</font><font size=3> </font><font size=2 face="sans-serif"><br>
rtems_task_argument ignored</font><font size=3> </font><font size=2 face="sans-serif"><br>
)</font><font size=3> </font><font size=2 face="sans-serif"><br>
{</font><font size=3> </font><font size=2 face="sans-serif"><br>
+ int i = 0;</font><font size=3> </font><font size=2 face="sans-serif"><br>
+ float a=3.14159f, b=1.0f;</font><font size=3> </font><font size=2 face="sans-serif"><br>
+</font><font size=3> </font><font size=2 face="sans-serif"><br>
rtems_test_begin();</font><font size=3> </font><font size=2 face="sans-serif"><br>
- printf( "Hello World\n" );</font><font size=3>
</font><font size=2 face="sans-serif"><br>
+ for (i=0; i<10; i++)</font><font size=3> </font><font size=2 face="sans-serif"><br>
+ b*=a;</font><font size=3> </font><font size=2 face="sans-serif"><br>
+ printf( "Hello World, %f\n", b );</font><font size=3>
</font><font size=2 face="sans-serif"><br>
rtems_test_end();</font><font size=3> </font><font size=2 face="sans-serif"><br>
exit( 0 );</font><font size=3> </font><font size=2 face="sans-serif"><br>
}</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
...which worked fine:</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
(gdb) tar extended-remote ... ( to grmon)</font><font size=3>
</font><font size=2 face="sans-serif"><br>
(gdb) c</font><font size=3> </font><font size=2 face="sans-serif"><br>
Continuing.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
*** BEGIN OF TEST HELLO WORLD ***</font><font size=3> </font><font size=2 face="sans-serif"><br>
Hello World, 1.000000</font><font size=3> </font><font size=2 face="sans-serif"><br>
*** END OF TEST HELLO WORLD ***</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
...and I made sure that FPU instructions are inside:</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
for (i=0; i<10; i++)</font><font size=3> </font><font size=2 face="sans-serif"><br>
28: 82 80 7f ff addcc %g1,
-1, %g1</font><font size=3> </font><font size=2 face="sans-serif"><br>
2c: 12 bf ff ff bne 28
<Init+0x28></font><font size=3> </font><font size=2 face="sans-serif"><br>
30: 91 a2 09 29 fmuls %f8,
%f9, %f8</font><font size=3> </font><font size=2 face="sans-serif"><br>
b*=a;</font><font size=3> </font><font size=2 face="sans-serif"><br>
printf( "Hello World, %f\n", b );</font><font size=3>
</font><font size=2 face="sans-serif"><br>
34: 91 a0 19 28 fstod %f8,
%f8</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
So, executive summary.... It seems that the default compilation settings
of the Leon3 BSP forbid "real FPU" work. <br>
If one needs to work in native (non-emulated) FPU mode, then the leon3.cfg
must be patched as I showed above. </font><font size=3><br>
</font><font size=2 face="sans-serif"><br>
In the long run, as Sebastian indicated, a leon3fp (and a corresponding
leon2fp, I imagine) <br>
should ideally be added as new BSP targets - and the FPU page</font><font size=3>
</font><font size=2 face="sans-serif"><br>
(</font><a href=https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support><font size=2 color=blue face="sans-serif"><u>https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support</u></font></a><font size=2 face="sans-serif">)
should probably <br>
be updated to indicate this.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Thanks to everyone for their help,</font><font size=3> </font><font size=2 face="sans-serif"><br>
Thanassis.</font><font size=3> <br>
<br>
</font><font size=2 face="sans-serif"><b><br>
European Space Agency (via HE Space)</b></font><font size=3> </font><font size=2 color=#000080 face="sans-serif"><br>
Thanassis Tsiodras</font><font size=3> </font><font size=2 face="sans-serif"><br>
Real-time Embedded Software Engineer <br>
System, Software and Technology Department</font><font size=3> <br>
</font><font size=2 face="sans-serif"><b><br>
ESTEC</b></font><font size=3> </font><font size=2 face="sans-serif"><br>
Keplerlaan 1, PO Box 299</font><font size=3> </font><font size=2 face="sans-serif"><br>
NL-2200 AG Noordwijk, The Netherlands</font><font size=3> </font><font size=2 color=blue face="sans-serif"><u><br>
</u></font><a href=mailto:Athanasios.Tsiodras@esa.int><font size=2 color=blue face="sans-serif"><u>Athanasios.Tsiodras@esa.int</u></font></a><font size=2 face="sans-serif">
| </font><a href="x-msg://11/www.esa.int"><font size=3 color=red><b><u>MailScanner
has detected a possible fraud attempt from "x-msg:" claiming
to be</u></b></font><font size=3 color=blue><u> </u></font><font size=2 color=blue face="sans-serif"><u>www.esa.int</u></font></a><font size=3>
</font><font size=2 face="sans-serif"><br>
T +31 71 565 5332</font><font size=3> <br>
<br>
<br>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
From: </font><font size=1 face="sans-serif">"Sebastian
Huber" <</font><a href="mailto:sebastian.huber@embedded-brains.de"><font size=1 color=blue face="sans-serif"><u>sebastian.huber@embedded-brains.de</u></font></a><font size=1 face="sans-serif">></font><font size=3>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
To: </font><font size=1 face="sans-serif">"RTEMS
List" <</font><a href=mailto:users@rtems.org><font size=1 color=blue face="sans-serif"><u>users@rtems.org</u></font></a><font size=1 face="sans-serif">></font><font size=3>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
Cc: </font><a href=mailto:software@gaisler.com><font size=1 color=blue face="sans-serif"><u>software@gaisler.com</u></font></a><font size=3>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
Date: </font><font size=1 face="sans-serif">07/02/2016
07:40</font><font size=3> </font><font size=1 color=#5f5f5f face="sans-serif"><br>
Subject: </font><font size=1 face="sans-serif">Re:
Crash under sparc/rtems-4.11 when compiling with FPU</font><font size=3>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
Sent by: </font><font size=1 face="sans-serif">"users"
<</font><a href="mailto:users-bounces@rtems.org"><font size=1 color=blue face="sans-serif"><u>users-bounces@rtems.org</u></font></a><font size=1 face="sans-serif">></font><font size=3>
<br>
</font>
<hr noshade><font size=3><br>
<br>
</font><tt><font size=2><br>
Hello Athanasios,<br>
<br>
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.<br>
<br>
I think we need leon2fp and leon3fp BSPs, which use -mhard-float.<br>
<br>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone : +49 89 189 47 41-16<br>
Fax : +49 89 189 47 41-09<br>
E-Mail : sebastian.huber at </font></tt><a href="http://embedded-brains.de/"><tt><font size=2 color=blue><u>embedded-brains.de</u></font></tt></a><tt><font size=2><br>
PGP : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
_______________________________________________<br>
users mailing list</font></tt><tt><font size=2 color=blue><u><br>
</u></font></tt><a href=mailto:users@rtems.org><tt><font size=2 color=blue><u>users@rtems.org</u></font></tt></a><font size=3 color=blue><u><br>
</u></font><a href=http://lists.rtems.org/mailman/listinfo/users><tt><font size=2 color=blue><u>http://lists.rtems.org/mailman/listinfo/users</u></font></tt></a><font size=3>
</font>
<br><tt><font size=3>This message and any attachments are intended for
the use of the addressee or addressees only.<br>
The unauthorised disclosure, use, dissemination or copying (either in whole
or in part) of its<br>
content is not permitted.<br>
If you received this message in error, please notify the sender and delete
it from your system.<br>
Emails can be altered and their integrity cannot be guaranteed by the sender.<br>
<br>
Please consider the environment before printing this email.<br>
</font></tt>
<br><font size=3>_______________________________________________<br>
users mailing list</font><font size=3 color=blue><u><br>
</u></font><a href=mailto:users@rtems.org><font size=3 color=blue><u>users@rtems.org</u></font></a><font size=3 color=blue><u><br>
</u></font><a href=http://lists.rtems.org/mailman/listinfo/users><font size=3 color=blue><u>http://lists.rtems.org/mailman/listinfo/users</u></font></a>
<br>
<br>
<br><PRE>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.
</PRE>