missing newlib stubs

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

Moderators: RoccoMarco, lbednarz, tfAteba

JoVM
Posts: 89
Joined: Thu Mar 12, 2015 12:13 pm

Re: missing newlib stubs

Post by JoVM »

Depends you want to use syscalls.o or libg.a?

Kr,Jo
bnewbold
Posts: 1
Joined: Fri Nov 13, 2015 11:08 pm

Re: missing newlib stubs

Post by bnewbold »

I ran in to basically the same problem:

Code: Select all

`_sbrk_r' referenced in section `.text._malloc_r' of /home/bnewbold/bin/gcc-arm-none-eabi-4_9-2014q4/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/libg.a(lib_a-mallocr.o): defined in discarded section `.text' of build/obj/syscalls.o (symbol from plugin)
`_sbrk_r' referenced in section `.text._malloc_r' of /home/bnewbold/bin/gcc-arm-none-eabi-4_9-2014q4/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/libg.a(lib_a-mallocr.o): defined in discarded section `.text' of build/obj/syscalls.o (symbol from plugin)
`_sbrk_r' referenced in section `.text._malloc_trim_r' of /home/bnewbold/bin/gcc-arm-none-eabi-4_9-2014q4/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/libg.a(lib_a-freer.o): defined in discarded section `.text' of build/obj/syscalls.o (symbol from plugin)
`_sbrk_r' referenced in section `.text._malloc_trim_r' of /home/bnewbold/bin/gcc-arm-none-eabi-4_9-2014q4/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/libg.a(lib_a-freer.o): defined in discarded section `.text' of build/obj/syscalls.o (symbol from plugin)
`_sbrk_r' referenced in section `.text._malloc_trim_r' of /home/bnewbold/bin/gcc-arm-none-eabi-4_9-2014q4/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/libg.a(lib_a-freer.o): defined in discarded section `.text' of build/obj/syscalls.o (symbol from plugin)
collect2: error: ld returned 1 exit status

With GCC version:

Code: Select all

bnewbold@ent$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20141119 (release) [ARM/embedded-4_9-branch revision 218278]


As a cross-reference, I found discussion on this Sourceforge bug: http://sourceforge.net/p/chibios/bugs/571/

which led me to add "-fno-use-linker-plugin" to "USE_OPT", which seems to have worked. I'm not sure what the impact on LTO was.
Post Reply