-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Compiler generated main
symbol has unavoidable pointless stack check
#14912
Comments
I think that if the main function allocates a sufficient amount of data on the stack this might be necessary. |
Note that all platforms we run on have the initial stack limit as 0, which means that the initial thread has an "infinite stack". Fixing |
Still broken but you can disable all stack checks, including this one, with -C no-stack-check now. |
Updated code:
I am bad at assembly, but
|
With the new LLVM version, that stack check gets removed in an optimized build. Can we close this? .text
.file "issue14912.0.rs"
.section .text.main,"ax",@progbits
.globl main
.align 16, 0x90
.type main,@function
main:
xorl %eax, %eax
retq
.Ltmp0:
.size main, .Ltmp0-main
.section ".note.GNU-stack","",@progbits |
great, thanks @dotdash! |
Don't add --all-targets to runnables for no-std crates Fixes rust-lang/rust-analyzer#14155
compiles to
In particular the
main
function has a stack check, which can't be removed (there's no way to put a#[no_split_stack]
on it: the compiler creates it automagically), and, (I think, I could easily be wrong) it's always pointless: when would the entry point of a program be overflowing the stack immediately?The text was updated successfully, but these errors were encountered: