Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `_sbrk' when using AutoShift with Ergodox Infinity #2089

Closed
twhiston opened this issue Dec 3, 2017 · 4 comments
Closed

Comments

@twhiston
Copy link

twhiston commented Dec 3, 2017

Hi,
I found that if i enabled AutoShift on the Ergodox Infinity the build failed.

Linking: .build/ergodox_infinity_workman.elf                                                        [ERRORS]
 | 
 | /usr/local/Cellar/gcc-arm-none-eabi/20160928/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/libg.a(lib_a-sbrkr.o): In function `_sbrk_r':
 | sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'
 | collect2: error: ld returned 1 exit status
 | 
make[1]: *** [.build/ergodox_infinity_workman.elf] Error 1
make: *** [ergodox_infinity:workman:dfu-util] Error 1

Solution seems to be to add $(CHIBIOS)/os/various/syscalls.c to the SRC value in rules.mk for the board, but not sure if you want that always added.

@drashna
Copy link
Member

drashna commented Mar 25, 2018

If you alter the make process, you don't need to always add it.

I've issued a pull request that fixes this: #2608.

You can pull the diff from that page and apply. But I can confirm that it compiles properly now.

@fredizzimo
Copy link
Contributor

The real reason why it fails, is that it's including stdio.h and using snprintf. The QMK print functions should be used instead of that, since we don't have a standard console for the output.

I'm re-opening this issue, so that a proper fix can be made. I will probably do that tomorrow.

@fredizzimo fredizzimo reopened this Apr 7, 2018
@drashna
Copy link
Member

drashna commented Oct 22, 2018

This should be fixed in #2608 I think.

@jackhumbert
Copy link
Member

I think this is fixed now with #8268 being merged - if not, please reopen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants