LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   arm-elf-gcc _sbrk errors (https://www.linuxquestions.org/questions/programming-9/arm-elf-gcc-_sbrk-errors-818061/)

fairuz.ismail 07-05-2010 05:17 AM

arm-elf-gcc _sbrk errors
 
Hi,
I tried to compile an empty main function (just to test the toolchain) but i got these errors.

Code:

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

This is my main

Code:

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,
Fairuz


All times are GMT -5. The time now is 04:04 AM.