Porting erros on LPC2129

wbasser75 wrote on Sunday, October 11, 2009:

I took the sample for the LPC2106 and added the new files that I have created.  Upon a compile, I get link errors with the following errors

arm-elf-gcc -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused -DROM_RUN -DGCC_ARM7 -I. -mcpu=arm7tdmi -Tlpc2129-rom.ld  -fomit-frame-pointer -fno-strict-aliasing processctl.o verhand.o sysconf.o tm0hand.o vichand.o list.o tasks.o queue.o heap_1.o port.o  -nostartfiles boot.s -Xlinker -oProcessCtl.elf -Xlinker -M -Xlinker -Map=ProcessCtl.map
c:/winarm-20060606/bin/…/lib/gcc/arm-elf/4.1.1/…/…/…/…/arm-elf/lib\libc.a(freer.o): In function `_malloc_trim_r’:
mallocr.c:(.text+0x48): undefined reference to `_sbrk_r’
mallocr.c:(.text+0x64): undefined reference to `_sbrk_r’
mallocr.c:(.text+0x84): undefined reference to `_sbrk_r’
c:/winarm-20060606/bin/…/lib/gcc/arm-elf/4.1.1/…/…/…/…/arm-elf/lib\libc.a(makebuf.o): In function `__smakebuf’:
makebuf.c:(.text+0x3c): undefined reference to `_fstat_r’
makebuf.c:(.text+0x110): undefined reference to `isatty’
c:/winarm-20060606/bin/…/lib/gcc/arm-elf/4.1.1/…/…/…/…/arm-elf/lib\libc.a(mallocr.o): In function `_malloc_r’:
mallocr.c:(.text+0x424): undefined reference to `_sbrk_r’
mallocr.c:(.text+0x4cc): undefined reference to `_sbrk_r’
c:/winarm-20060606/bin/…/lib/gcc/arm-elf/4.1.1/…/…/…/…/arm-elf/lib\libc.a(stdio.o): In function `__sclose’:
stdio.c:(.text+0xc): undefined reference to `_close_r’
c:/winarm-20060606/bin/…/lib/gcc/arm-elf/4.1.1/…/…/…/…/arm-elf/lib\libc.a(stdio.o): In function `__sseek’:
stdio.c:(.text+0x30): undefined reference to `_lseek_r’
c:/winarm-20060606/bin/…/lib/gcc/arm-elf/4.1.1/…/…/…/…/arm-elf/lib\libc.a(stdio.o): In function `__swrite’:
stdio.c:(.text+0x84): undefined reference to `_lseek_r’
stdio.c:(.text+0xac): undefined reference to `_write_r’
c:/winarm-20060606/bin/…/lib/gcc/arm-elf/4.1.1/…/…/…/…/arm-elf/lib\libc.a(stdio.o): In function `__sread’:
stdio.c:(.text+0xd0): undefined reference to `_read_r’
collect2: ld returned 1 exit status

Any ideas?

rtel wrote on Sunday, October 11, 2009:

Yes - you are using a compiler that requires syscalls to be defined (probably Yagarto with Newlib as a guess?).  Go to Yagarto.de and search the homepage for the text "syscalls.c".  You will find a file you can download and add to your build.

Regards.

rtel wrote on Sunday, October 11, 2009:

BTW - it is likely that that version of binutils is bugged with regard to THUMB/ARM interworking.  You are probably best off sticking with ARM mode.

Regards.