Is there a way to increase the stack size of a Windows application at compile/link time with GCC?
One cannot increase the stack size.
If the stack would be allowed to grow arbitrarily large, these errors (like infinite recursion) would be caught very late, only after the operating systems resources are exhausted. This is prevented by setting an arbitrary limit to the stack size.
IIRC, In GCC you can provide the --stack,[bytes] parameter to ld.
E.g.
gcc -Wl,--stack,16777216 -o file.exe file.c
To have a stack of 16MiB, I think that the default size is 8MiB.
You could run editbin after linking.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With