mvme5500, rtems-4.9.0: undefined reference to `cos'

rtwas rtwas at comcast.net
Fri Dec 19 00:58:40 UTC 2008


Hello,

Despite having "-lm" clearly visible in the command-line trig functions go
unresolved at link time.

I took "examples-4.9.0/psx_example/test.c", removed everything but the 
directives. I made up a
dummy pointer to *something* so the compiler wouldn't try to optimize 
out the call to "cos()".

I did this test after seeing this problem in a much more substantial build.

Help appreciated,

Thanks.

Robert W.


.....................................................................................................................................
#include <sched.h>
#include <bsp.h>
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <math.h>


void *POSIX_Init()
{

volatile unsigned int * p0;

 p0 = 0x8000000;

 printf("cos(): %f \n", cos(*p0));

  exit(0);
}
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER

#define CONFIGURE_MAXIMUM_POSIX_THREADS              10
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES  10
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES              10
#define CONFIGURE_POSIX_INIT_THREAD_TABLE

#define CONFIGURE_INIT
#include <rtems/confdefs.h>
..............................................................................................................................................................................

/opt/rtems-4.9/lib/gcc/powerpc-rtems4.9/4.3.2/collect2 -Qy -dp -Bstatic 
-e __rtems_entry_point -u __vectors -o o-optimize/psx_example.exe 
/opt/rtems-4.9/lib/gcc/powerpc-rtems4.9/4.3.2/m7400/ecrti.o 
/opt/rtems-4.9/powerpc-rtems4.9/mvme5500/lib/rtems_crti.o 
/opt/rtems-4.9/lib/gcc/powerpc-rtems4.9/4.3.2/m7400/crtbegin.o 
/opt/rtems-4.9/powerpc-rtems4.9/mvme5500/lib/mvme5500start.o 
-L/opt/rtems-4.9/lib/gcc/powerpc-rtems4.9/4.3.2/m7400 
-L/opt/rtems-4.9/lib/gcc/powerpc-rtems4.9/4.3.2/../../../../powerpc-rtems4.9/lib/m7400 
-L/opt/rtems-4.9/powerpc-rtems4.9/mvme5500/lib 
-L/opt/rtems-4.9/lib/gcc/powerpc-rtems4.9/4.3.2 
-L/opt/rtems-4.9/lib/gcc/powerpc-rtems4.9/4.3.2/../../../../powerpc-rtems4.9/lib 
-Map linkmap -lm o-optimize/main.o o-optimize/testfile.o -lgcc 
--start-group -lrtemsbsp -lrtemscpu -lc -lgcc --end-group -T 
/opt/rtems-4.9/powerpc-rtems4.9/mvme5500/lib/linkcmds -lgcc 
/opt/rtems-4.9/lib/gcc/powerpc-rtems4.9/4.3.2/m7400/crtend.o 
/opt/rtems-4.9/lib/gcc/powerpc-rtems4.9/4.3.2/m7400/ecrtn.o
o-optimize/main.o: In function `POSIX_Init':
/home/rwas/work/ata/hellads/eqm/software/rtems-test/rtems_test.121808.00/main.c:16: 
undefined reference to `cos'
collect2: ld returned 1 exit status
make: *** [o-optimize/psx_example.exe] Error



More information about the users mailing list