Hello,
I try to increase the reserved stack size of my output .exe ! I use Code::Blocks on Windows with the MingW compiler. Can I set a variable ?
Thanks for help !
D:\desktop>ld --help |grep stack
--stack <size> Set size of the initial stack
Thanks !
Ok for cmd line, but can I configure this in CodeBlocks ? It will be easier if I haven't to go through the cmd line before each run in CodeBlocks ...
project->build options->linker settings->other linker options
Quote from: Maciek on January 02, 2008, 10:55:55 PM
project->build options->linker settings->other linker options
... and make sure to tack "-Wl," on the beginning -- i.e. "-Wl,--stack=1024", or whatever you choose for your stack size.
Hi all,
Trying to increase stack size for example with "-Wl --stack,1024" from linker or compiler options in Code Block didn't work for me. Is anyone know solution of this problem by using IDE?
Thanks.
Quote from: hokselato on May 13, 2012, 05:38:14 PM
for example with "-Wl --stack,1024"
That is wrong. Instead of "-Wl --stack,1024", use "-Wl,--stack,1024" (notice the comma).
Thanks for reply,
Sorry for typo. I tried your suggestion but at compile time a blue warnings says unused linker option and end of compile this message disappears. This option is not working. Do you have any alternate advice to increase stack size? I will use my code at an embedded platform so I dont want to use malloc. All my memory allocations must be at stack.
My linker option is (and I also tried it as compiler option)
-Wl,--stack,52800000
Compiler Warning is;
Compiling: FFT_anysize.c
mingw32-gcc.exe: --stack: linker input file unused because linking not done
mingw32-gcc.exe: 528000000: linker input file unused because linking not done
Thanks.
Quote from: hokselato on May 14, 2012, 08:57:44 AM
Compiler Warning is;
Why don't you simply look up, for example here:
http://sourceware.org/binutils/docs-2.16/ld/Options.html
?
This is a Code::Blocks, not a compiler/linker related forum. You should better ask this question in a forum related to the compiler you are using, e.g. GCC mailing list. It may heavily depend on the platform and version you are using - and for such stuff, you should better ask compiler people, see here:
Quote
--stack reserve
--stack reserve,commit
Specify the amount of memory to reserve (and optionally commit) to be used as stack for this program. The default is 2Mb reserved, 4K committed. [This option is specific to the i386 PE targeted port of the linker]
An advice for this action would be to also rebuild the program (Build->Rebuild).
I tried typing "-Wl --stack,1024" and after I have rebuilt the program, the stack size was indeed changed.
Hello,
I am trying to increase the stack size
I write in the linker options "-Wl,--stack,2048" but I receive an error unrecognized option '--stack'
Could anyone help?.
1. Are you sure you're giving it to the linker. To verify inspect the full build log
2. Are you sure your linker supports it? To verify inspect the linker's documentation.
Quote from: Raef Mohamed on February 05, 2021, 05:52:18 PM
Hello,
I am trying to increase the stack size
I write in the linker options "-Wl,--stack,2048" but I receive an error unrecognized option '--stack'
Could anyone help?.
The string "-Wl,--stack=2048" worked for me. Also, I believe that the units are bytes, rather than megabytes, so it's probably sensible to add a few 0s. (Happy to be proven wrong)