build RTEMS with arm ADS tools

Ren, Han Tao (Hans) renht at lucent.com
Thu Nov 13 07:33:01 UTC 2003


I just wrote a simple C file 
==========
#include "stdlib.h"
int main()
{
  exit(0);
}
==========

Then built it by ADS compiler "armcc"
ccarm -c test.c  -o test.o

Then linked with ADS default library.
armlink -o -v test.exe test.o 2>&1 | tee link.log
(Passed without error, please see the log file in attachment)

but I failed linking "test.o" to "libc.a(built by RTEMS tools)"

>armlink -v -noscanlib -o test.exe test.o libc.a
Loading object test.o.
              definition:  main
              reference :  exit
              reference :  __main
              reference :  _main
Selecting member exit.o(libc.a) to define exit.
Loading member exit.o from libc.a.
              definition:  exit
              reference :  _exit
              reference :  _impure_ptr
Selecting member impure.o(libc.a) to define _impure_ptr.
Loading member impure.o from libc.a.
              definition:  _impure_ptr
Building image.
Error: L6218E: Undefined symbol __main (referred from test.o).
Error: L6218E: Undefined symbol _main (referred from test.o).
Error: L6218E: Undefined symbol _exit (referred from exit.o).
Finished: 14 information, 0 warning and 3 error messages.

I'm now wondering are "_main" and "_exit" implementation in libc?

Thanks

Hans


-----Original Message-----
From: Ralf Corsepius [mailto:corsepiu at faw.uni-ulm.de]
Sent: Thursday, November 13, 2003 2:21 PM
To: Ren, Han Tao (Hans)
Cc: Joel Sherrill; RTEMS Users
Subject: RE: build RTEMS with arm ADS tools


On Thu, 2003-11-13 at 02:49, Ren, Han Tao (Hans) wrote:
>   Now have some other questions, is
> "/opt/rtems/arm-rtems/lib/libc.a" the newlib library?
Yes. This is the default multilib variant of newlib. There are others in
subdirectories.

>   Are
> "/opt/rtems/arm-rtems/armulator/lib/librtemsbsp.a librtemscpu.a" the RTEMS
> operating system library?
Yes. librtemscpu.a contains the CPU specific parts, librtemsbsp.a the
BSP specific parts.

>   So, Are these three library I should link my
> sample code in? 
Yes.

>  should I also link "start.o" in
> "/opt/rtems/arm-rtems/armulator/lib/"?
Normally yes.

Ralf




More information about the users mailing list