SPARC floating point functions from math.h

Rehab Massoud rehab.massoud at gmail.com
Sun Dec 11 19:20:47 UTC 2016


Hi RTEMS users,

I have 2 questions:

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?

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:

sparc-rtems-gcc: unrecognized option '-rdynamic'
s/(my_file.c.o): In function `round':
my_file.c:(.text+0x434): undefined reference to `ceilf'
s/(my_file.c.o): In function `round':
my_file.c:(.text+0x450): undefined reference to `floorf'
s/(my_file.c.o): In function `wi':
my_file.c:(.text+0x478): undefined reference to `fmodf'
s/(my_file.c.o): In function `arc_tangens':
my_file.c:(.text+0x488): undefined reference to `atan2f'
s/(my_file.c.o): In function `arc_tangens':
my_file.c:(.text+0x498): undefined reference to `atanf'
s/(my_file.c.o): In function `tangens':
my_file.c:(.text+0x4a8): undefined reference to `tanf'
s/(my_file.c.o): In function `cosinus':
my_file.c:(.text+0x4b8): undefined reference to `cosf'
s/(my_file.c.o): In function `sinus':
my_file.c:(.text+0x4c8): undefined reference to `sinf'
s/(my_file.c.o): In function `resol':
my_file.c:(.text+0x51c): undefined reference to `sqrtf'
collect2: ld returned 1 exit status

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:

/opt/rtems-4.10/sparc-rtems/leon3/lib/include/leon.h: In function
'leon_r32_no_cache':
/opt/rtems-4.10/sparc-rtems/leon3/lib/include/leon.h:258: error: 'asm'
undeclared (first use in this function)
/opt/rtems-4.10/sparc-rtems/leon3/lib/include/leon.h:258: error: (Each
undeclared identifier is reported only once
/opt/rtems-4.10/sparc-rtems/leon3/lib/include/leon.h:258: error: for each
function it appears in.)
/opt/rtems-4.10/sparc-rtems/leon3/lib/include/leon.h:258: error: expected
';' before 'volatile'

Do these floating point functions' implementations exist in libm.a included
in the sparc-rtems binary downloaded from
http://www.gaisler.com/anonftp/rcc/src/rtems-4.10-1.2.20-src.tar.bz2
<http://www.gaisler.com/anonftp/rcc/src/rtems-4.10-1.2.20-src.tar.bz2>04-Nov-2016
07:46 8.9M? or do I have to implement these functions myself?

Best Regards,

Rehab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20161211/555749ff/attachment.html>


More information about the users mailing list