Liking error only with GCC 6.3

Discussions and support about ChibiStudio, the free development environment for ARM.
User avatar
Fede
Posts: 37
Joined: Thu Nov 08, 2012 8:30 pm
Location: Milano

Liking error only with GCC 6.3

Postby Fede » Wed Nov 22, 2017 6:43 pm

Dear All,

I'm currently working with last stable version of chibios (17.6.3) and chibistudio (preview 19).

What is hapenning is that if I launch chibistudio with "Chibi Studio GCC 4.7" shortcut everything goes smooth: 0 error 0 warning.
While when I've tried to build exactly the same project with "Chibi Studio GCC 6.3" I got: 0 warning but this linker error:
...
Compiling main.c
Linking build/ch.elf
c:/chibistudio/tools/gnu tools arm embedded/6.3 2017q1/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m\libg.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'
collect2.exe: error: ld returned 1 exit status


have you ever experienced this issue?

thanks all, cheers,
Fede

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: Liking error only with GCC 6.3

Postby Giovanni » Thu Nov 23, 2017 9:08 am

Hi,

This is caused by your application calling something in the C library that requires memory allocation, the library requires an implementation of sbrk() provided by the OS.

Under /os/various there is a syscalls.c module that, if added to the project, should fix the problem. It maps sbrk() on the ChibiOS core allocator.

Giovanni

User avatar
Fede
Posts: 37
Joined: Thu Nov 08, 2012 8:30 pm
Location: Milano

Re: Liking error only with GCC 6.3

Postby Fede » Thu Nov 23, 2017 9:52 am

Dear Giovanni,

Thanks it solve the issue. But, just to understand, do you know why I need to add this file only with GCC 6.3 ?

Thanks again,
Fede

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: Liking error only with GCC 6.3

Postby Giovanni » Thu Nov 23, 2017 10:16 am

Probably the old compiler included stub functions, this would not mean it would work.

Giovanni


Return to “ChibiStudio”

Who is online

Users browsing this forum: No registered users and 12 guests