arm-elf-gcc _sbrk errors

Discussion in 'Embedded Systems and Microcontrollers' started by mdpai, Jul 5, 2010.

  1. mdpai

    Thread Starter New Member

    Jan 5, 2010
    I tried to compile an empty main function (just to test the toolchain) but i got these errors.

    Code ( (Unknown Language)):
    1. fairuz@ubuntu:~/test$ arm-elf-gcc -mcpu=arm7tdmi-s test.c
    2. /opt/gnuarm/lib/gcc/arm-elf/4.4.1/../../../../arm-elf/lib/libc.a(lib_a-exit.o): In function `exit':
    3. /home/fairuz/build-newlib/arm-elf/newlib/libc/stdlib/../../../../../newlib-1.17.0/newlib/libc/stdlib/exit.c:65: undefined reference to `_exit'
    4. /opt/gnuarm/lib/gcc/arm-elf/4.4.1/../../../../arm-elf/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
    5. /home/fairuz/build-newlib/arm-elf/newlib/libc/reent/../../../../../newlib-1.17.0/newlib/libc/reent/sbrkr.c:60: undefined reference to `_sbrk'
    6. collect2: ld returned 1 exit status
    This is my main

    Code ( (Unknown Language)):
    1. void main (void){}
    I compile my own toolchain using gcc 4.4.1, binutils 2.19.1, newlib 1.17, GDB 6.8, insight 6.8-1

    I've read somewhere that this kind of error is caused by newlib syscall and they suggest to add --disable-newlib-supplied-syscalls option when compiling newlib. I've did this but I still got the same errors.

    Anyone have some ideas on this matter?

    Thanks for your time,

    Kind regards,