<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">On 08/02/16 11:46,
<a class="moz-txt-link-abbreviated" href="mailto:Athanasios.Tsiodras@esa.int">Athanasios.Tsiodras@esa.int</a> wrote:<br>
</div>
<blockquote
cite="mid:23834_1454928421_56B87225_23834_301_1_OF1ED66A1E.100EDDFA-ONC1257F53.003AB14D-C1257F53.003B3B1D@esa.int"
type="cite"><font face="sans-serif" size="2">Hi Jerry.</font>
<br>
<br>
<font face="sans-serif" size="2">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 face="sans-serif" size="2">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 face="sans-serif" size="2">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></blockquote>
<br>
<br>
Just remember that if the compiler emits *any* FPU instruction in
the kernel or non-FPU threads, you can get a crash. You should use
objdump on the final binary to verify that you don't have spurious
FPU instructions in the wrong place.<br>
<br>
Jiri.<br>
<br>
<blockquote
cite="mid:23834_1454928421_56B87225_23834_301_1_OF1ED66A1E.100EDDFA-ONC1257F53.003AB14D-C1257F53.003B3B1D@esa.int"
type="cite">
<br>
<br>
<font face="sans-serif" size="2">Thanks!</font>
<br>
<br>
<font face="sans-serif" size="2"><b>European Space Agency (via HE
Space)</b></font>
<br>
<font color="#000080" face="sans-serif" size="2">Thanassis
Tsiodras</font>
<br>
<font face="sans-serif" size="2">Real-time Embedded Software
Engineer
</font>
<br>
<font face="sans-serif" size="2">System, Software and Technology
Department</font>
<br>
<br>
<font face="sans-serif" size="2"><b>ESTEC</b></font>
<br>
<font face="sans-serif" size="2">Keplerlaan 1, PO Box 299</font>
<br>
<font face="sans-serif" size="2">NL-2200 AG Noordwijk, The
Netherlands</font>
<br>
<font face="sans-serif" size="2"><a class="moz-txt-link-abbreviated" href="mailto:Athanasios.Tsiodras@esa.int">Athanasios.Tsiodras@esa.int</a> | </font><a
moz-do-not-send="true" href="www.esa.int"><font color="blue"
face="sans-serif" size="2"><a class="moz-txt-link-abbreviated" href="http://www.esa.int">www.esa.int</a></font></a>
<br>
<font face="sans-serif" size="2">T +31 71 565 5332</font>
<br>
<br>
<br>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">From:
</font><font face="sans-serif" size="1">"Needell, Jerry"
<a class="moz-txt-link-rfc2396E" href="mailto:Jerry.Needell@unh.edu"><Jerry.Needell@unh.edu></a></font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">To:
</font><font face="sans-serif" size="1"><a class="moz-txt-link-rfc2396E" href="mailto:Athanasios.Tsiodras@esa.int">"Athanasios.Tsiodras@esa.int"</a>
<a class="moz-txt-link-rfc2396E" href="mailto:Athanasios.Tsiodras@esa.int"><Athanasios.Tsiodras@esa.int></a></font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Cc:
</font><font face="sans-serif" size="1">"Needell, Jerry"
<a class="moz-txt-link-rfc2396E" href="mailto:Jerry.Needell@unh.edu"><Jerry.Needell@unh.edu></a>, "RTEMS List"
<a class="moz-txt-link-rfc2396E" href="mailto:users@rtems.org"><users@rtems.org></a></font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Date:
</font><font face="sans-serif" size="1">08/02/2016 11:36</font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Subject:
</font><font face="sans-serif" size="1">Re: Crash under
sparc/rtems-4.11 when compiling with FPU</font>
<br>
<hr noshade="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
moz-do-not-send="true" href="mailto:Jerry.Needell@unh.edu"><font
color="blue" size="3"><u><a class="moz-txt-link-abbreviated" href="mailto:Jerry.Needell@unh.edu">Jerry.Needell@unh.edu</a></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
moz-do-not-send="true" href="mailto:Athanasios.Tsiodras@esa.int"><font
color="blue" size="3"><u><a class="moz-txt-link-abbreviated" href="mailto:Athanasios.Tsiodras@esa.int">Athanasios.Tsiodras@esa.int</a></u></font></a><font
size="3">
wrote:</font>
<br>
<br>
<font face="sans-serif" size="2">I verified Sebastian's suggestion
-
by modifying the leon3.cfg file...</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><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 face="sans-serif" size="2"><br>
index 58f2f07..30fc3a4 100644</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
--- a/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg</font><font
size="3">
</font><font face="sans-serif" size="2"><br>
+++ b/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg</font><font
size="3">
</font><font face="sans-serif" size="2"><br>
@@ -9,7 +9,8 @@ RTEMS_CPU_MODEL=leon3</font><font size="3">
<br>
</font><font face="sans-serif" size="2"><br>
# This contains the compiler options necessary to
select the CPU model</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
# and (hopefully) optimize for it.</font><font size="3">
</font><font face="sans-serif" size="2"><br>
-CPU_CFLAGS = -mcpu=cypress -msoft-float</font><font size="3">
</font><font face="sans-serif" size="2"><br>
+CPU_CFLAGS = -mcpu=cypress -mhard-float</font><font size="3">
<br>
</font><font face="sans-serif" size="2"><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 face="sans-serif" size="2"><br>
diff --git a/testsuites/samples/hello/init.c
b/testsuites/samples/hello/init.c</font><font size="3">
</font><font face="sans-serif" size="2"><br>
index d8fe450..6ee33f6 100644</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
--- a/testsuites/samples/hello/init.c</font><font size="3">
</font><font face="sans-serif" size="2"><br>
+++ b/testsuites/samples/hello/init.c</font><font size="3">
</font><font face="sans-serif" size="2"><br>
@@ -27,8 +27,13 @@ rtems_task Init(</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
rtems_task_argument ignored</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
)</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
{</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
+ int i = 0;</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
+ float a=3.14159f, b=1.0f;</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
+</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
rtems_test_begin();</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
- printf( "Hello World\n" );</font><font size="3">
</font><font face="sans-serif" size="2"><br>
+ for (i=0; i<10; i++)</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
+ b*=a;</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
+ printf( "Hello World, %f\n", b );</font><font size="3">
</font><font face="sans-serif" size="2"><br>
rtems_test_end();</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
exit( 0 );</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
}</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
...which worked fine:</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
(gdb) tar extended-remote ... ( to grmon)</font><font
size="3">
</font><font face="sans-serif" size="2"><br>
(gdb) c</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
Continuing.</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
*** BEGIN OF TEST HELLO WORLD ***</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
Hello World, 1.000000</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
*** END OF TEST HELLO WORLD ***</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
...and I made sure that FPU instructions are inside:</font><font
size="3">
<br>
</font><font face="sans-serif" size="2"><br>
for (i=0; i<10; i++)</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
28: 82 80 7f ff addcc %g1,
-1, %g1</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
2c: 12 bf ff ff bne 28
<Init+0x28></font><font size="3"> </font><font
face="sans-serif" size="2"><br>
30: 91 a2 09 29 fmuls %f8,
%f9, %f8</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
b*=a;</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
printf( "Hello World, %f\n", b );</font><font size="3">
</font><font face="sans-serif" size="2"><br>
34: 91 a0 19 28 fstod %f8,
%f8</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><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 face="sans-serif" size="2"><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 face="sans-serif" size="2"><br>
(</font><a moz-do-not-send="true"
href="https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support"><font
color="blue" face="sans-serif" size="2"><u>https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support</u></font></a><font
face="sans-serif" size="2">)
should probably <br>
be updated to indicate this.</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
Thanks to everyone for their help,</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
Thanassis.</font><font size="3"> <br>
<br>
</font><font face="sans-serif" size="2"><b><br>
European Space Agency (via HE Space)</b></font><font size="3">
</font><font color="#000080" face="sans-serif" size="2"><br>
Thanassis Tsiodras</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
Real-time Embedded Software Engineer <br>
System, Software and Technology Department</font><font size="3">
<br>
</font><font face="sans-serif" size="2"><b><br>
ESTEC</b></font><font size="3"> </font><font
face="sans-serif" size="2"><br>
Keplerlaan 1, PO Box 299</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
NL-2200 AG Noordwijk, The Netherlands</font><font size="3"> </font><font
color="blue" face="sans-serif" size="2"><u><br>
</u></font><a moz-do-not-send="true"
href="mailto:Athanasios.Tsiodras@esa.int"><font color="blue"
face="sans-serif" size="2"><u>Athanasios.Tsiodras@esa.int</u></font></a><font
face="sans-serif" size="2">
| </font><a moz-do-not-send="true"
href="x-msg://11/www.esa.int"><font color="red" size="3"><b><u>MailScanner
has
detected a possible fraud attempt from "x-msg:" claiming
to be</u></b></font><font color="blue" size="3"><u> </u></font><font
color="blue" face="sans-serif" size="2"><u>www.esa.int</u></font></a><font
size="3">
</font><font face="sans-serif" size="2"><br>
T +31 71 565 5332</font><font size="3"> <br>
<br>
<br>
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
From: </font><font face="sans-serif" size="1">"Sebastian
Huber" <</font><a moz-do-not-send="true"
href="mailto:sebastian.huber@embedded-brains.de"><font
color="blue" face="sans-serif" size="1"><u>sebastian.huber@embedded-brains.de</u></font></a><font
face="sans-serif" size="1">></font><font size="3">
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
To: </font><font face="sans-serif" size="1">"RTEMS
List" <</font><a moz-do-not-send="true"
href="mailto:users@rtems.org"><font color="blue"
face="sans-serif" size="1"><u>users@rtems.org</u></font></a><font
face="sans-serif" size="1">></font><font size="3">
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
Cc: </font><a moz-do-not-send="true"
href="mailto:software@gaisler.com"><font color="blue"
face="sans-serif" size="1"><u>software@gaisler.com</u></font></a><font
size="3">
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
Date: </font><font face="sans-serif" size="1">07/02/2016
07:40</font><font size="3"> </font><font color="#5f5f5f"
face="sans-serif" size="1"><br>
Subject: </font><font face="sans-serif" size="1">Re:
Crash under sparc/rtems-4.11 when compiling with FPU</font><font
size="3">
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
Sent by: </font><font face="sans-serif" size="1">"users"
<</font><a moz-do-not-send="true"
href="mailto:users-bounces@rtems.org"><font color="blue"
face="sans-serif" size="1"><u>users-bounces@rtems.org</u></font></a><font
face="sans-serif" size="1">></font><font size="3">
<br>
</font>
<hr noshade="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
moz-do-not-send="true" href="http://embedded-brains.de/"><tt><font
color="blue" size="2"><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 color="blue" size="2"><u><br>
</u></font></tt><a moz-do-not-send="true"
href="mailto:users@rtems.org"><tt><font color="blue" size="2"><u>users@rtems.org</u></font></tt></a><font
color="blue" size="3"><u><br>
</u></font><a moz-do-not-send="true"
href="http://lists.rtems.org/mailman/listinfo/users"><tt><font
color="blue" size="2"><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 color="blue" size="3"><u><br>
</u></font><a moz-do-not-send="true"
href="mailto:users@rtems.org"><font color="blue" size="3"><u>users@rtems.org</u></font></a><font
color="blue" size="3"><u><br>
</u></font><a moz-do-not-send="true"
href="http://lists.rtems.org/mailman/listinfo/users"><font
color="blue" size="3"><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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@rtems.org">users@rtems.org</a>
<a class="moz-txt-link-freetext" href="http://lists.rtems.org/mailman/listinfo/users">http://lists.rtems.org/mailman/listinfo/users</a></pre>
</blockquote>
<br>
</body>
</html>