leon1 Re: undefined reference to `_CPU_Context_restore_fp'

Joel Sherrill joel.sherrill at OARcorp.com
Fri Nov 16 14:02:08 UTC 2001



Jiri Gaisler wrote:
> 
> The patch did apply OK but compilation of applications failed:
> 
> Making all in hello
> make[5]: Entering directory `/home/jiri/src/rtemsdev/build/sparc-rtems/c/leon1/tests/samples/hello'
> mkdir o-optimize
> /opt/rtems/bin/sparc-rtems-gcc --pipe -B../../../../../../leon1/lib/ -specs bsp_specs -qrtems -g
> -Wall -ansi -fasm    -mcpu=cypress -msoft-float     -c  -O4 -o o-optimize/init.o
> ../../../../../../../rtems-4.5.0-jg-2/c/src/tests/samples/hello/init.c
> /opt/rtems/bin/sparc-rtems-gcc --pipe -B../../../../../../leon1/lib/ -specs bsp_specs -qrtems -g
> -Wall -ansi -fasm    -mcpu=cypress -msoft-float      -L ../../../../../../leon1/lib  -O4  -o
> o-optimize/hello.exe  o-optimize/init.o ../../../../../../leon1/lib/no-dpmem.rel
> ../../../../../../leon1/lib/no-event.rel ../../../../../../leon1/lib/no-msg.rel
> ../../../../../../leon1/lib/no-mp.rel ../../../../../../leon1/lib/no-part.rel
> ../../../../../../leon1/lib/no-signal.rel ../../../../../../leon1/lib/no-timer.rel
> ../../../../../../leon1/lib/no-rtmon.rel
> ../../../../../../leon1/lib/librtemsall.a(threadclose.o): In function `_Thread_Close':
> /home/jiri/src/rtemsdev/build/sparc-rtems/c/leon1/exec/score/src/../../../../../../../rtems-4.5.0-jg-2/c/src/exec/score/src/threadclose.c:57:
> undefined reference to `_Thread_Is_allocated_fp'
> /home/jiri/src/rtemsdev/build/sparc-rtems/c/leon1/exec/score/src/../../../../../../../rtems-4.5.0-jg-2/c/src/exec/score/src/threadclose.c:58:
> undefined reference to `_Thread_Deallocate_fp'
> collect2: ld returned 1 exit status

Similar problem different file.  I am at home today since my wife is 
supposed to have surgery later this morning.  I am including a patch
that is in CVS but if you turn up another one, you should be able
to dig it out of CVS.  The new CVSgraph support makes it easy to hunt
for these things.

===================================================================
RCS file: /usr1/CVS/rtems/c/src/exec/score/src/threadclose.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- rtems/c/src/exec/score/src/threadclose.c    1999/11/17 17:50:40    
1.3
+++ rtems/c/src/exec/score/src/threadclose.c    2000/07/26 19:26:28    
1.4
@@ -9,7 +9,7 @@
  *  found in found in the file LICENSE in this distribution or at
  *  http://www.OARcorp.com/rtems/license.html.
  *
- *  $Id: threadclose.c,v 1.3 1999/11/17 17:50:40 joel Exp $
+ *  $Id: threadclose.c,v 1.4 2000/07/26 19:26:28 joel Exp $
  */
 
 #include <rtems/system.h>
@@ -53,6 +53,7 @@
 
   _User_extensions_Thread_delete( the_thread );
  
+#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
 #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
   if ( _Thread_Is_allocated_fp( the_thread ) )
     _Thread_Deallocate_fp();
@@ -60,7 +61,8 @@
   the_thread->fp_context = NULL;
 
   if ( the_thread->Start.fp_context )
-  (void) _Workspace_Free( the_thread->Start.fp_context );
+    (void) _Workspace_Free( the_thread->Start.fp_context );
+#endif
 
   _Thread_Stack_Free( the_thread );


> Jiri.
> --
> -----------------------------------------------------------------------
> Gaisler Research, Stora Nygatan 13, 411 08 Goteborg, Sweden, 073-9927100
> email: jiri at gaisler.com, home page: http://www.gaisler.com
> -----------------------------------------------------------------------

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



More information about the users mailing list