title: Compiling using arm-none-eabi-gcc and linking library liba.a error
body: <p>I am compiling a hello world program in C on a 64-bit Linux machine. I am using a GCC ARM embedded toolchain to cross compile my program on a FOX G20 V board with an ATMEL AT91SAM9G20 processor. </p>
  
  <p>On the first take, I had a few errors when compiling because the program didn't recognize the printf, return etc. functions (the standard C functions). So I decided to make the link between the functions, which I believe are defined in the libc.a library (correct me if I'm wrong), by doing <code>arm-none-eabi-gcc -o hello hello.c libc.a</code> but the outcome still results in errors: </p>
  
  <pre><code>libc.a(lib_a-exit.o): In function `exit':
  exit.c:(.text.exit+0x16): undefined reference to `_exit'
  libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
  sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'
  libc.a(lib_a-writer.o): In function `_write_r':
  writer.c:(.text._write_r+0x10): undefined reference to `_write'
  libc.a(lib_a-closer.o): In function `_close_r':
  closer.c:(.text._close_r+0xc): undefined reference to `_close'
  libc.a(lib_a-fstatr.o): In function `_fstat_r':
  fstatr.c:(.text._fstat_r+0xe): undefined reference to `_fstat'
  libc.a(lib_a-isattyr.o): In function `_isatty_r':
  isattyr.c:(.text._isatty_r+0xc): undefined reference to `_isatty'
  libc.a(lib_a-lseekr.o): In function `_lseek_r':
  lseekr.c:(.text._lseek_r+0x10): undefined reference to `_lseek'
  libc.a(lib_a-readr.o): In function `_read_r':
  readr.c:(.text._read_r+0x10): undefined reference to `_read'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>I'm really unsure as to why the program still does not recognize the standard functions even though I've linked the library to the application. If anyone has a reason as to why, or a solution as to how I can fix this problem, I would be very grateful. </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've downloaded the glibc library from <a href="http://ftp.igh.cnrs.fr/pub/gnu/libc/" rel="noreferrer">here</a>. I've compiled and created a static library from the <code>syscalls.c</code> library that I found in <code>newlib-2.1.0/libgloss/arm</code> and when I link the library to my application code, I still get the same error. </p>