Page 1 of 1

does anyone use the Linker options file ?

Posted: Thu Jun 23, 2022 2:33 pm
by jack
in testing my code that [ab]uses the stack I needed to increase the stack size, seems to me it would be simpler to have a stack size option rather than to have the option in a file, just curious if people use the linker options

Re: does anyone use the Linker options file ?

Posted: Thu Jun 23, 2022 5:40 pm
by STARGÅTE
I use the Linker option to increase the stack size as well.
To use a file for this is fine for me.

Re: does anyone use the Linker options file ?

Posted: Thu Jun 23, 2022 9:19 pm
by idle
An examples would be good.

Re: does anyone use the Linker options file ?

Posted: Thu Jun 23, 2022 10:10 pm
by jack
hello idle, not sure what you meant, but here's my file to set the stack size
linker_options.txt
/STACK:2097152

Re: does anyone use the Linker options file ?

Posted: Thu Jun 23, 2022 10:11 pm
by skywalk
From the interwebs:
msvc--> /STACK:256000000
gcc --> -Wl,--stack=256000000

Re: does anyone use the Linker options file ?

Posted: Thu Jun 23, 2022 11:21 pm
by idle
Thanks it's good to provide examples for other people. I'm not sure you need a file though

on on linux you can use

Code: Select all

ImportC "-Wl,--stack=256000000" : Endimport   
n windows with pb 6 at least you can use

Code: Select all

ImportC "/STACK:2097152" : EndImport

Re: does anyone use the Linker options file ?

Posted: Thu Jun 23, 2022 11:53 pm
by jack
thanks for the tip idle :)

Re: does anyone use the Linker options file ?

Posted: Fri Jun 24, 2022 1:36 am
by idle
jack wrote: Thu Jun 23, 2022 11:53 pm thanks for the tip idle :)
I'm not sure how long that has worked on windows, so I learned something new! :D

Re: does anyone use the Linker options file ?

Posted: Fri Jun 24, 2022 2:33 am
by skywalk
Very interesting!
I wound up making global def's for very big structures cause of stack limit.
I didn't think to change the stack size. :oops:

Re: does anyone use the Linker options file ?

Posted: Fri Jun 24, 2022 7:43 am
by Caronte3D
The change of stack size is for EXE only or works also on DLL compilation?

Re: does anyone use the Linker options file ?

Posted: Fri Jun 24, 2022 5:42 pm
by STARGÅTE
I tried it, but it doesn't work. The stack size is not saved in the DLL, its defined by the parent application which uses the DLL.

Re: does anyone use the Linker options file ?

Posted: Fri Jun 24, 2022 5:53 pm
by Caronte3D
Thanks!
I was read that on the Microsoft info and supposse was the same on PB.