<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Dec 11, 2016 1:21 PM, "Rehab Massoud" <<a href="mailto:rehab.massoud@gmail.com">rehab.massoud@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi RTEMS users,<br><br></div>I have 2 questions:<br><br></div>1) Can I use the -msoft-mfloat option while compiling an application that have floating point calculations to handle them using software implemented floating point functions? <br><div><div><div><br>2) I'm trying to compile an application that runs as a task in RTEMS using gaisler's sparc-rtems; and it is using some floating point functions from math.h. The program compiles and runs normally on host. But when I try to compile it with sparc-rtems compiler it doesn't accept these functions with -lm linking option as below:<br><div></div></div></div></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">What did you do to link against libm. What was the actual command line for linking?</div><div dir="auto"><br></div><div dir="auto">The methods are there. </div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><br>sparc-rtems-gcc: unrecognized option '-rdynamic'<br>s/(my_file.c.o): In function `round':<br>my_file.c:(.text+0x434): undefined reference to `ceilf'<br>s/(my_file.c.o): In function `round':<br>my_file.c:(.text+0x450): undefined reference to `floorf'<br>s/(my_file.c.o): In function `wi':<br>my_file.c:(.text+0x478): undefined reference to `fmodf'<br>s/(my_file.c.o): In function `arc_tangens':<br>my_file.c:(.text+0x488): undefined reference to `atan2f'<br>s/(my_file.c.o): In function `arc_tangens':<br>my_file.c:(.text+0x498): undefined reference to `atanf'<br>s/(my_file.c.o): In function `tangens':<br>my_file.c:(.text+0x4a8): undefined reference to `tanf'<br>s/(my_file.c.o): In function `cosinus':<br>my_file.c:(.text+0x4b8): undefined reference to `cosf'<br>s/(my_file.c.o): In function `sinus':<br>my_file.c:(.text+0x4c8): undefined reference to `sinf'<br>s/(my_file.c.o): In function `resol':<br>my_file.c:(.text+0x51c): undefined reference to `sqrtf'<br>collect2: ld returned 1 exit status<br><br>when using -std=99 to force accepting them (not sure if this is correct or if there is a better way to force it). But then I get obviously the error below: <br><br>/opt/rtems-4.10/sparc-rtems/<wbr>leon3/lib/include/leon.h: In function 'leon_r32_no_cache':<br>/opt/rtems-4.10/sparc-rtems/<wbr>leon3/lib/include/leon.h:258: error: 'asm' undeclared (first use in this function)<br>/opt/rtems-4.10/sparc-rtems/<wbr>leon3/lib/include/leon.h:258: error: (Each undeclared identifier is reported only once<br>/opt/rtems-4.10/sparc-rtems/<wbr>leon3/lib/include/leon.h:258: error: for each function it appears in.)<br>/opt/rtems-4.10/sparc-rtems/<wbr>leon3/lib/include/leon.h:258: error: expected ';' before 'volatile'<br></div></div></div></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">These likely are addressed in newer versions. The trick is using the keyword with underscores that is accepted. Can't give more specific details from my phone but checking the current source should show them.</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><br></div><div>Do these floating point functions' implementations exist in libm.a included in the sparc-rtems binary downloaded from <a href="http://www.gaisler.com/anonftp/rcc/src/" target="_blank">http://www.gaisler.com/<wbr>anonftp/rcc/src/</a><a href="http://www.gaisler.com/anonftp/rcc/src/rtems-4.10-1.2.20-src.tar.bz2" target="_blank">rtems-4.10-1.<wbr>2.20-src.tar.bz2</a>04-Nov-2016 07:46  8.9M? or do I have to implement these functions myself? <br></div><div></div></div></div></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">They should be since they have existed in the main RTEMS distribution for 20 years.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><br clear="all"><div><div class="m_3753579534945488338gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font face="Calibri" size="2">Best Regards,</font></div><font color="#888888">
<div><font size="2"> </font></div>
<div><font face="Calibri" size="2">Rehab<br></font></div></font></div></div></div></div></div></div></div>
</div></div></div></div></div>
<br>______________________________<wbr>_________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/users</a><br></blockquote></div><br></div></div></div>