Linking problems with Chibi-Studio

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
User avatar
levrik
Posts: 26
Joined: Wed Dec 21, 2011 7:35 am

Linking problems with Chibi-Studio

Post by levrik »

Hi there,
I'm having problems linking projects with vanilla Chibi-Studio:

Code: Select all

c:/chibistudio/tools/gnu tools arm embedded/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'
c:/chibistudio/tools/gnu tools arm embedded/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-abort.o): In function `abort':
abort.c:(.text.abort+0xa): undefined reference to `_exit'
c:/chibistudio/tools/gnu tools arm embedded/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-signalr.o): In function `_kill_r':
signalr.c:(.text._kill_r+0xe): undefined reference to `_kill'
c:/chibistudio/tools/gnu tools arm embedded/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-signalr.o): In function `_getpid_r':
signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid'
collect2: ld returned 1 exit status
make: *** [build/chibi-mf.elf] Error 1
This Project builds smoothly with another compiler without changes to its Makefile. The demos delivered with Chibi-Studio do compile and link without erros.

Thanks in advance for hints.
Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm

Re: Linking problems with Chibi-Studio

Post by Abhishek »

Looks like this is due to a missing syscalls.c file.

Try adding it and see if it works. There is a file named syscalls.c in chibios/os/various, try including it n the makefile and see if it works

Best Regards
Abhishek
User avatar
levrik
Posts: 26
Joined: Wed Dec 21, 2011 7:35 am

Re: Linking problems with Chibi-Studio

Post by levrik »

Unfortunately did this not solve the problem. Still linking errors:

Code: Select all

c:/chibistudio/tools/gnu tools arm embedded/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-abort.o): In function `abort':
abort.c:(.text.abort+0xa): undefined reference to `_exit'
c:/chibistudio/tools/gnu tools arm embedded/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-signalr.o): In function `_kill_r':
signalr.c:(.text._kill_r+0xe): undefined reference to `_kill'
c:/chibistudio/tools/gnu tools arm embedded/4.6 2012q2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m\libc.a(lib_a-signalr.o): In function `_getpid_r':
signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid'
collect2: ld returned 1 exit status
make: *** [build/chibi-mf.elf] Error 1
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Linking problems with Chibi-Studio

Post by Giovanni »

You have to provide stubs for the missing functions or remove from your code the call to the library function depending on those.

Giovanni
User avatar
levrik
Posts: 26
Joined: Wed Dec 21, 2011 7:35 am

Re: Linking problems with Chibi-Studio

Post by levrik »

Thanks for the quick answer. I'll implement these stubs then.
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: Linking problems with Chibi-Studio

Post by mobyfab »

Post Reply