[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A problem to compile RTEMS with manually makefile scripts,maybe a linking proble



I'm a student,I want to study RTEMS. 
I try to write a MakeFile manually to compile RTEMS.The compile process 
succeed,then I use i386-rtems-ar command to create static lib 
(libkernel,libbsp,libc,libstart)just like the auto generate scripts do,it 
is also OK. 
But when I build the demo(c/src/tests/samples/hello) ,gcc report: 

  /c/src/tests/samples/hello/init.c:31: undefined reference to `printk'. 
but I can sure the printk define and implement in libbsp.a.Because the 
result of command "i386-rtems-nm -s libbsp.a" contain : 

printk.o: 
        U BSP_output_char 
00000271 t Letext 
00000000 t printNum 
000000c4 T printk 


The scripts to build the demo is: 
        ${CC}  -c -Wall -fasm -g  ${INCLUDEFLAGS} init.c -o init.o 
${AR} ruvs libhello.a init.o 
${LD} -N -T linkcmds -Map map.txt -e _start  -L./  --start-group -l hello 
-lc -lkernel -lbsp -lstart --end-group init.o -o hello.elf 

       What's Wrong?? 


_________________________________________________________________
???? MSN Explorer:  http://explorer.msn.com/lccn/