Skip to content

Fix broken mp_stack_check() when using -flto #146

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

Merged
merged 1 commit into from
Jun 5, 2017

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Jun 5, 2017

Fixes #144. Force py/stackctrl.c routines that effectively read the $sp not be to inlined, by using asm(""). MP_NOINLINE is not effective to prevent inlining in this case. Something about -flto makes these routines not work correctly. They work fine without -flto.

With this fix, MP_STACK_CHECK() stack overflow checking works again with -flto.

@dhalbert dhalbert changed the title Fix broken mp_stack_check: force mp_stack_ctrl_init() and mp_stack_us… Fix broken mp_stack_check() when using -flto Jun 5, 2017
@tannewt
Copy link
Member

tannewt commented Jun 5, 2017

Thank you so much for figuring this out! Its super important for CircuitPython that the stack checking works.

@tannewt tannewt merged commit 9805abd into adafruit:master Jun 5, 2017
@dhalbert dhalbert deleted the stack_check-fix branch June 5, 2017 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack overflow checking broken
2 participants