undefined ref to _exit even though syscalls.c is added to CSRC

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

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

svenssonjoel
Posts: 10
Joined: Wed Jul 31, 2019 10:38 am
Been thanked: 1 time

undefined ref to _exit even though syscalls.c is added to CSRC

Postby svenssonjoel » Tue Jun 15, 2021 7:10 pm

Hello.

I get this error upon linking:

in function `abort':
abort.c:(.text.abort+0xa): undefined reference to `_exit'
/home/storage/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: /home/storage/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libg.a(lib_a-signalr.o): in function `_kill_r':
signalr.c:(.text._kill_r+0x12): undefined reference to `_kill'
/home/storage/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: /home/storage/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libg.a(lib_a-signalr.o): in function `_getpid_r':
signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid'
collect2: error: ld returned 1 exit status

And this is even though I have added $(CHIBIOS)/os/various/syscalls.c\ to CSRC and I can see that in the call to gcc, syscalls.o is present.

arm-none-eabi-gcc ./build/obj/crt0_v7m.o ./build/obj/vectors.o ./build/obj/chcoreasm_v7m.o ./build/obj/syscalls.o

What could be the cause of this? Are there some other configurations to tweak here?
If anyone has any idea what could cause this let me know. ChibiOS version 20.3.2.

Thanks, have a great day.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: undefined ref to _exit even though syscalls.c is added to CSRC

Postby Giovanni » Tue Jun 15, 2021 7:25 pm

Hi,

In that version syscalls.c is not complete, you should update to 20.3.3 or 21.6.0.

Giovanni

svenssonjoel
Posts: 10
Joined: Wed Jul 31, 2019 10:38 am
Been thanked: 1 time

Re: undefined ref to _exit even though syscalls.c is added to CSRC

Postby svenssonjoel » Tue Jun 15, 2021 8:38 pm

Great! Thanks.

Have a good day.


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 20 guests