Linking problems with Chibi-Studio

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

Moderators: tfAteba, barthess, RoccoMarco, lbednarz, utzig

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

Linking problems with Chibi-Studio

Postby levrik » Sat Sep 22, 2012 8:34 am

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
Location: India

Re: Linking problems with Chibi-Studio

Postby Abhishek » Sat Sep 22, 2012 8:39 am

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

Postby levrik » Sat Sep 22, 2012 9:12 am

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: 14704
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1146 times
Been thanked: 960 times

Re: Linking problems with Chibi-Studio

Postby Giovanni » Sat Sep 22, 2012 9:32 am

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

Postby levrik » Sat Sep 22, 2012 9:40 am

Thanks for the quick answer. I'll implement these stubs then.

mobyfab
Posts: 483
Joined: Sat Nov 19, 2011 6:47 pm
Location: Le Mans, France
Has thanked: 21 times
Been thanked: 30 times

Re: Linking problems with Chibi-Studio

Postby mobyfab » Sat Sep 22, 2012 2:03 pm



Return to “General Support”

Who is online

Users browsing this forum: No registered users and 133 guests