You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rust should have a way to output a call to a chkstk-like function for frames larger than the guard size. LLVM has support for chkstk so this could be leveraged on other platforms too. The Linux pthread API provides pthread_getattr_np so the available stack space can be checked.
This bug may not be so much as we don't have support for this but rather we're just not doing this. We're not using segmented stacks the way that they're supposed to be used in the compiler, and our strategy on all platforms should align with that of chkstk. I've looked into LLVM and it is indeed implemented, but it's all special-cased on codegen for the windows platform.
To pursue this, we will need to modify to accept an option to codegen chkstk on all platforms, hopefully take a symbol as well (so we can implement our own), and then implement the necessary prologue for all our platforms and architectures (I have a feeling that LLVM only implements it for x86 windows right now).
It would probably be worth chatting with the upstream LLVM guys before pursuing this just to make sure that we're aligned correctly in how to do this.
Rust should have a way to output a call to a
chkstk
-like function for frames larger than the guard size. LLVM has support forchkstk
so this could be leveraged on other platforms too. The Linux pthread API providespthread_getattr_np
so the available stack space can be checked.Here's the documentation for the GCC support:
http://gcc.gnu.org/onlinedocs/gccint/Stack-Checking.html
The text was updated successfully, but these errors were encountered: