Is there a way to increase the stack size of a Windows application at compile/link time with GCC?
I definitely could - and this appears to be what I'll inevitably have to do - but I was looking for a way to do it at link time. Thanks though.
Landon
2008-10-02 00:56:23
A:
When creating threads you use the dwStackSize paremater, but I'm not sure how to change the size for the main thread, this indicates its in the exe's header, so it may be an option for the compiler/linker, else you need to find the relevant part of the header and change it yourself.
http://msdn.microsoft.com/en-us/library/ms686774(VS.85).aspx
Fire Lancer
2008-10-01 07:06:49
+5
A:
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.
Jonas Gulle
2008-10-01 08:41:04
This is what I was originally looking for. Unfortunately, I haven't had any luck with this on Windows. Have you?
Landon
2008-10-02 00:56:55
+1
A:
There are two stack sizes in Windows. The initially commited size, and the total reserved size. You can set both with a STACKSIZE statement in a .def file.
MSalters
2008-10-01 10:04:07