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

Implement stack probes for x86 #2440

Merged
merged 1 commit into from
May 8, 2019
Merged

Conversation

LemonBoy
Copy link
Contributor

@LemonBoy LemonBoy commented May 6, 2019

Closes #530

@LemonBoy LemonBoy force-pushed the stack-probe branch 2 times, most recently from 241a04e to a72015f Compare May 7, 2019 09:53
// __chkstk | yes | no |
// __chkstk_ms | no | no |
// ___chkstk (__alloca) | yes | yes |
// ___chkstk_ms | no | no |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same as __chkstk_ms then? Could you make it an alias?

Similar for ___chkstk and _chkstk

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having them defined on their own is helpful because one more (or one less) underscore may break your stack.

Enabled on non-Windows systems only since it already requires stack
probes.
@andrewrk andrewrk merged commit be7cacf into ziglang:master May 8, 2019
@andrewrk
Copy link
Member

andrewrk commented May 8, 2019

Nice work!

// Define this symbol here so that we can link with the zig objects during the
// compiler bootstrap phase
extern "C" {
void __zig_probe_stack(void) { }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LemonBoy why was this needed? I tried removing this and it seems to work fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed that in order not to do a fresh rebuild when I first added the stack probe annotation, you can safely remove it now.

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.

__chkstk in debug and release-safe modes only and on all OSes
3 participants