EmbDev.net

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


von Andrey K. (Company: RSTU) (fellrond)


Attached files:

Rate this post
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:
1
make all PROJECT_NAME=LPC2368_FreeRTOS_CanSpy 
2
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
3
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
4
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
5
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
6
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
7
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
8
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
9
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
10
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
11
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
12
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
13
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
14
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
15
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
16
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
17
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
18
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
19
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
20
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
21
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 
22
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':
23
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'
24
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':
25
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'
26
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':
27
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'
28
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':
29
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'
30
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':
31
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'
32
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':
33
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'
34
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':
35
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'
36
collect2: ld returned 1 exit status
37
make: *** [LPC2368_FreeRTOS_CanSpy.elf] Error 1

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

von Timothy Kirk (Guest)


Rate this post
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

von Andrey K. (Company: RSTU) (fellrond)


Rate this post
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.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.