EmbDev.net

Forum: ARM programming with GCC/GNU tools [YAGARTO] Linking error, project for LPC2368


Author: Andrey Korzinev (Company: RSTU) (fellrond)
Posted on:
Attached files:

Rate this post
0 useful
not useful
Hello,

just installed YAGARTO ("arm-none-eabi-") on my new dev machine, and now 
my project cannot be linked.
Perviously I have used "arm-elf-" shipped with old one version of GNUARM 
toolchain, and it worked.

Here is compile log:
make all PROJECT_NAME=LPC2368_FreeRTOS_CanSpy 
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb src/main.c -o src/main.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb src/init.c -o src/init.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb src/transfer.c -o src/transfer.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb src/user_tasks.c -o src/user_tasks.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb src/uIP_Task.c -o src/uIP_Task.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb src/emac.c -o src/emac.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb src/npctcp.c -o src/npctcp.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/uip_arp.c -o ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/uip_arp.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/psock.c -o ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/psock.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/timer.c -o ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/timer.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/uip.c -o ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/uip.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb ../FreeRTOS/Source/list.c -o ../FreeRTOS/Source/list.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb ../FreeRTOS/Source/queue.c -o ../FreeRTOS/Source/queue.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb ../FreeRTOS/Source/tasks.c -o ../FreeRTOS/Source/tasks.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx/port.c -o ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx/port.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  -mthumb ../FreeRTOS/Source/portable/MemMang/heap_2.c -o ../FreeRTOS/Source/portable/MemMang/heap_2.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx/portISR.c -o ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx/portISR.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  src/EMAC_ISR.c -o src/EMAC_ISR.o
arm-none-eabi-gcc -c -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  src/user_ISR.c -o src/user_ISR.o
arm-none-eabi-gcc -g -O1 -T./lpc2368.ld  -I . -I ../FreeRTOS/Source/include -I ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx -I ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip -I ./src -D ROWLEY_LPC23xx -D THUMB_INTERWORK -mcpu=arm7tdmi -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -fomit-frame-pointer -mthumb-interwork -std=gnu99 -D DEBUG  ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx/portISR.o src/EMAC_ISR.o src/user_ISR.o src/main.o src/init.o src/transfer.o src/user_tasks.o src/uIP_Task.o src/emac.o src/npctcp.o ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/uip_arp.o ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/psock.o ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/timer.o ../FreeRTOS/Demo/Common/ethernet/uIP/uip-1.0/uip/uip.o ../FreeRTOS/Source/list.o ../FreeRTOS/Source/queue.o ../FreeRTOS/Source/tasks.o ../FreeRTOS/Source/portable/GCC/ARM7_LPC23xx/port.o ../FreeRTOS/Source/portable/MemMang/heap_2.o  src/boot.s -mthumb -nostartfiles -Xlinker -obin/LPC2368_FreeRTOS_CanSpy.elf -Xlinker -M -Xlinker -Map=rtosdemo.map 
d:/development/tools/arm-toolchain/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb\libg.a(lib_a-sbrkr.o): In function `_sbrk_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\thumb\newlib\libc\reent/../../../../../../newlib-1.19.0/newlib/libc/reent/sbrkr.c:60: undefined reference to `_sbrk'
d:/development/tools/arm-toolchain/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb\libg.a(lib_a-writer.o): In function `_write_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\thumb\newlib\libc\reent/../../../../../../newlib-1.19.0/newlib/libc/reent/writer.c:58: undefined reference to `_write'
d:/development/tools/arm-toolchain/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb\libg.a(lib_a-closer.o): In function `_close_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\thumb\newlib\libc\reent/../../../../../../newlib-1.19.0/newlib/libc/reent/closer.c:53: undefined reference to `_close'
d:/development/tools/arm-toolchain/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb\libg.a(lib_a-fstatr.o): In function `_fstat_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\thumb\newlib\libc\reent/../../../../../../newlib-1.19.0/newlib/libc/reent/fstatr.c:62: undefined reference to `_fstat'
d:/development/tools/arm-toolchain/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb\libg.a(lib_a-isattyr.o): In function `_isatty_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\thumb\newlib\libc\reent/../../../../../../newlib-1.19.0/newlib/libc/reent/isattyr.c:58: undefined reference to `_isatty'
d:/development/tools/arm-toolchain/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb\libg.a(lib_a-lseekr.o): In function `_lseek_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\thumb\newlib\libc\reent/../../../../../../newlib-1.19.0/newlib/libc/reent/lseekr.c:58: undefined reference to `_lseek'
d:/development/tools/arm-toolchain/yagarto/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/lib/thumb\libg.a(lib_a-readr.o): In function `_read_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-none-eabi\thumb\newlib\libc\reent/../../../../../../newlib-1.19.0/newlib/libc/reent/readr.c:58: undefined reference to `_read'
collect2: ld returned 1 exit status
make: *** [LPC2368_FreeRTOS_CanSpy.elf] Error 1

Any ideas to resolve this situation? Google don't want to help me. :(

Author: Timothy Kirk (Guest)
Posted on:

Rate this post
0 useful
not useful
I don't see syscalls.c listed in your makefile. Yagarto uses stubs for 
newlib and all your problems with _sbrk, _write, etc. are due to that. 
(_sbrk is used by malloc, and _write is used by printf).

You can download a minimal syscalls.c from
http://www.yagarto.de/download/yagarto/syscalls.c

For more information, do a web search for yagarto syscalls

Hope this helps!

Tim

Author: Andrey Korzinev (Company: RSTU) (fellrond)
Posted on:

Rate this post
0 useful
not useful
Thanks, that was very helpful. Seems like it works like a charm, but I 
didn't tried to flash generated binary to LPC. Hope it will work.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.